Tuesday, 10 February 2015

SickRage

For some reasons I decided to install SickRage on OpenElec by myself.
There are few main advantage for me ... but disadvantage for sure is that I have to update package on my own.

Here is procedure of updating... (its little bit problematic I would admit ;) )

First stop SickRage, tar all the files
tar cvf /tmp/sick.tar /storage/HTPC/SickRage/

and copy to my laptop

on my laptop I have to cancel all my local changes (will get back to that in few)...
git stash save --keep-index
git stash drop
Then pull all the changes
git pull


And tar + copy back to HTPC

Here we need to do few changes so it works fine in Openelec.

we need to edit SickBeard.py file and add (just below import lines) :
import os 
sys.path.append(os.path.join(".", 'pylib'))

We need to make sure that in pylib directory we have Cheetah python module (its depedency).


Also in autostart I added link to file script.AutoSickRage.sh

#!/bin/bash
dir="/storage/HTPC/SickRage/"
script="SickBeard.py"
name="sick"

cd $dir
screen -S $name -d -m python $script


It starts screen session (you have to install screen module first) and starts SickRage.

After that we're done... we can start script  script.AutoSickRage.sh.

This is note mainly for me - I suggest using ready to use modules on OpenElec repository :) (audo is the name afair)

Saturday, 29 November 2014

Remote control of Kodi (configure my own remote) in Openelec

As I mentioned my little PC came without remote. What's more zbox for some reasons doesn't support CEC (over HDMI) , so it's not possible to just use TV remote that easily. 
In general there are many option of controlling kodi - everything described on the wiki

There are few options I was considering.
  • buy CEC adapter (for example HERE). It is really nice solution if you don't want to have additional remote. Fortunately mine Zbox has built in IR receiver on front panel so I decided to ignore this option.
  • phone app (possibilites described on wiki). It works really nice but in my opinion remote is more convenient
  • buy remote - almost done  it - but I didn't like idea of having another remote
Finally for me most obvious solution was to play with LIRC and Kodi configuration and try to make my TV remote work with Kodi. This way I would have only 1 remote for TV and HTPC and I would save some $$$.

Sooooooo...

Just to mention at the moment I use openelec 4.95.3 beta (with beta Kodi 14.0 Helix).
I needed to stop lirc service

systemctl stop eventlircd

Then to be sure clear current mappings and set generic protocols:

ir-keytable -p NEC,RC-5,RC-6,JVC,SONY,LIRC,OTHER
ir-keytable -c

After that we can test if our remote works. Execute:

ir-keytable -t

and start pushing buttons on remote. I could see something like :

1417281263.268482: event type EV_MSC(0x04): scancode = 0x02
1417281263.268482: event type EV_SYN(0x00).
1417281263.627818: event type EV_MSC(0x04): scancode = 0x4010
1417281263.627818: event type EV_SYN(0x00).

I also for some reasons didn't finally used all generic protocols and i found out that my remote (from Phillips TV) works with RC-6 (of course i executed ir-keytable command with one protocol at a time [not with the full list] and checked which one is working fine). So finally my command is:

ir-keytable -p RC-6 -t

So now we can generate list of mappings. First we need to know names of keys... Possibilities are listed HERE or you can list it by command

irrecord -list namespace

Then we have to create file in /storage/.config. You can use whichever name you want (in my case "phillips_remote"). And list key codes from remote with names of keys from LIRC. My conf file looks like that:

# table phillips_remote, type: RC-6

0x005c KEY_ENTER
0x005b KEY_RIGHT
0x005a KEY_LEFT
0x0058 KEY_UP
0x0059 KEY_DOWN
0x0010 KEY_VOLUMEUP
0x0011 KEY_VOLUMEDOWN
0x000a KEY_ESC # back
0x004c KEY_MENU # right >|
0x004d KEY_CONTEXT_MENU # left <|
0x0000 KEY_0
0x0001 KEY_1
0x0002 KEY_2
0x0003 KEY_3
0x0004 KEY_4
0x0005 KEY_5
0x0006 KEY_6
0x0007 KEY_7
0x0008 KEY_8
0x0009 KEY_9
0x004b KEY_INFO # teletext

Just in case also second remote

# table exposure_remote, type: RC-5

0x1435 KEY_ENTER
0x1420 KEY_RIGHT
0x1421 KEY_LEFT
0x1430 KEY_UP
0x1436 KEY_DOWN
0x1010 KEY_VOLUMEUP
0x1011 KEY_VOLUMEDOWN
0x1432 KEY_ESC # <<
0x1434 KEY_MENU # >>
0x141c KEY_CONTEXT_MENU # random
0x141d KEY_INFO # repeat
0x140b KEY_PLAY # time
0x140f KEY_STOP # display
0x142d KEY_AUDIO # open
0x1451 KEY_PREVIOUS # sel-
0x1450 KEY_NEXT # sel+
Next step is to apply it to system

ir-keytable -c -p RC-6 -w /storage/.config/phillips_remote

And test under Kodi. Here I had weird situation. At beginning most of buttons worked fine but not all... for example KEY_ESC didn't work - I tried with KEY_BACK etc and nothing could work. From what I noticed it was because we cleared all default mappings (as suggested on official wiki) and somehow since then not all the mappings were fine.
After getting back to default settings (and restarting lirc service) it went back to normal. If you want to be sure - after you get all the mappings from your remote (by ir-keytable -t) you should restart your PC.
Anyway finally, in my case, all keys - I wanted - worked fine.

So now we have working setup - we need to make it permanent. Trick is easy as mentioned HERE...

We just put final command (ir-keytable) into autostart.sh

EDIT...

I decided that I want to map one of the keyboards to start music "Party mode" - so i can start it without turning on TV.
To do that:


cp /usr/share/kodi/system/Lircmap.xml /storage/.kodi/userdata
cp /usr/share/kodi/system/keymaps/remote.xml /storage/.kodi/userdata/keymaps

I mapped my button with KEY_AUDIO (of course it can be something different)
Then I used command irw
 
# irw 188 0 KEY_AUDIO devinput 188 0 KEY_AUDIO_UP devinput
So I check Lircmap.xml file searching for devinput string where I can see :
<mymusic>KEY_AUDIO</mymusic>

So it means that this button is mapped to label mymusic in Kodi.
Now we  go to file remote.xml and I found

<mymusic>ActivateWindow(MyMusic)</mymusic>

Then we go to Kodi wiki site HERE
and search for Party mode function.
There is PlayerControl(command)
and short description

Partymode(music/video) toggles the appropriate partymode, defaults to 
music if no parameter is given, besides the default music or video 
partymode you can also pass a path to a custom smartplaylist (.xsp) as 
parameter.
 So simply we edit our remote.xml file and  do a small change:

<mymusic>PlayerControl(Partymode(music))</mymusic>

Restart of kodi and we're ready :)



Of course it is only one of ways to accomplish the task... there are few other options - described on kodi wiki of course :)

Executing commands/ scripts while booting

Today really quick note... but useful...

When you want to execute command while booting of your HTPC (before Kodi starts) you need to create (if it doesn't exist yet) file autostart.sh in .config directory

echo "#!/bin/bash" > /storage/.config/autostart.sh 
and make sure its executable

chmod +x /storage/.config/autostart.sh



Now anything you put there in the file will be executed as we wanted.

Monday, 24 November 2014

youtube to Kodi from laptop


Just quick note...

Sometimes i browse youtube from my laptop and I want to watch it on big screen.

Its now really easy to do...

Chromium/Firefox has great addon called :

Send to XBMC

Project site: link

On both plugin conf and Kodi you have to specify user/password/port (on Kodi its web interface settings).
Btw if you install it - you can forward also movies / music / pictures from your laptop - not only youtube links.

if you set it up correctly next to youtube movie you will see  icon:

     Send to:


Of course there is also Youtube addon in default Kodi repository which I also recommend.

Thursday, 20 November 2014

Basic Kodi setup

About installing and configuring Openelec / Kodi there are many many websites + already mentioned wiki.

I will just mention some of my basic modifications...

I'm still considering which Skin I should choose. I like default one but also thinking about Transparency! skin as it focus on fanart and it looks really nice.

For me important visual setting is choosing music visualization : I'm  projectM...
and also i turn off fanart background while showing visualization  (not that obvious to find ;) )

System -> Settings -> Appearance -> Skin -> Settings -> Background Options

and option: 

Hide Fanart in full screen visualisation

Of course very important for me are video / audio settings - but in most cases default settings are really fine + I will have closer look later (when I have my full HTPC setup ready - especially audio system).

I'm from Poland and sometimes I use subtitles while watching movies - having proper polish characters is not that obvious too (especially that I prefer to have my Kodi in English).

So in Video -> Subtitles  settings you have to choose  

Language to download subtitles for -> Polish
Preferred subtitle language -> Polish
Character Set -> Central Europe (Windows)

About music as default scrapper I used:
TheAudioDb Album Scaper
but sometimes I notice that 
Universal Album Scraper works better.

I also did (amongst other small things)...
in Kodi settings:
  • turn off RSS news feeds
  • enabled Webserver in Services
  • Allow remote control of kodi from other systems

in OpenElec settings:
  • setup NTP servers
  • enabled wifi connection
  • in ssh i disabled ssh password (so only authentication is possible with ssh keys)

And i installed many many addons ;)

Btw there is general list of interesting tools in kodi wiki LINK

Monday, 17 November 2014

OS choice

As media player I'm planning to use Kodi. For me its more then obvious choice. There are other solutions of course but to be honest I don't even bother with it (I'm really happy with everything here). 



About operating system itself - there are many possibilities. 
I'm fanboy of linux so from beginning i excluded Windows (+ i saved some money).

I started with OpenElec but I'm also planning to check XBMCbuntu or maybe so called Audiophile Linux.

Openelec is perfect solution for simple and fast deployment. This is dedicated linux minimal distribution - it uses really small amount of disk (hard to believe ~150 MB), has build in Kodi, installation is easy and you get ready to use HTPC system. Both have really good wiki (OE and Kodi) , lots of addons, great community and support. 
Btw here - my biggest respects for guys from Openelec and Kodi teams!!! Amazing job.

Disadvantage (for me) of Openelec is that it is relatively limited system. OE team focused on creating smallest possible, secure and stable system but the cost of it is that its little bit difficult to do some modification of it (i fully understand why they did it). As i mentioned for HT system its perfect but as I don't own any real, always available on internet, server out there so from time to time I want to use my HTPC for different tasks too.
Openelec OS stuff is in fact read only - by default you can't install new packages you want, it's not possible to change configuration of some services etc.
Of course there are many many addons giving you specific features (like torrents, additional tools etc) but sometimes its not enough for me.
There is also way to edit OS image and I will have a look at this option later. But still because of that (sometimes) I consider different solution. 

That's why I want to test XBMCbuntu too. It is based on lubuntu (lightweight Ubuntu) and you're not limited with installing any tool you want. 

About last choice - Audiophile Linux - I also consider it as for me music quality is really important. I'm not any kind of audiophile in fact so i really think Kodi will be enough for me but still want to test it later. Just to mention AL is based on Mint Linux.

Thursday, 13 November 2014

Hello World!

Hello world!

i started new project!

Here i will try to describe how i build my HTPC!

As a base I have Zotac zbox nano AQ02 Plus

CPU: AMD A8-5545M APU Platform (quad-core)
GPU: AMD Radeon™ HD 8510G (integrated)
Memory: 4GB DDR3-1333 SODIMM
HDD: Samsung 500GB 5400RPM HDD

It has possibility to add up to 8GB of RAM but it has only one slot.
It's definitely more then enough for HTPC setup.

Full specification : LINK

Source: liliputing.com

Source: lesnumeriques.com

In general after few days of using I'm really happy with it. I don't like fact that it doesn't support libcec and it doesn't have remote included but i was aware of that while buying. I will try to find best workaround for that - there are few option - so i will post it here later. 

Before buying I was seriously considering also different model - Zbox CI 320.
I wanted to buy it with small SSD disk (64GB or even 32GB) + create some kind of NAS solution, but finally after checking final costs i decided to go with one box with bigger HDD. Maybe in future I will "migrate" to NAS. We'll see.
Anyway CI320 is really nice solution - most important is fan-less! And quite powerful for HTPC needs, especially checking its prize. 
Finally after few days of using AQ02 i can tell its almost completely silent too... you have to try really hard to hear any noise - even though its HDD and fan inside. 
For now I'm happy with my choice. And saved money i will use for better sound system (i have one setup chosen already - but will post something about it later)! Just as a tip - I would suggest buying standard model (not plus version) and buy memory and disk of your choice - for same prize most probably you would get better specification. 
Of course there are different solutions then Zbox or you can even build your own htpc - if you have some basic knowledge I would recommend this option!
I bought this model as I simply found really good opportunity (really good prize).  

My HTPC will be used for movies (TV shows included) and music (about 50% - 50%). I have quite big collection of CD music and i will try to rip everything to flac later.