[LINUX STATION] Getting KODI to run as default windows manager

Discussion about various official QPKG software applications. Login required to view the contents.
Locked
sergiensergien
First post
Posts: 1
Joined: Sat Dec 17, 2016 9:55 pm

[LINUX STATION] Getting KODI to run as default windows manager

Post by sergiensergien »

¡Hi!

As Kodi is discontinued on HD Station, for a time I was using the contributed packages from other members. The packages are great, but I had some problems and addons I cannot execute over HD Station so I have installed Kodi using Linux Station in my QNAP 453A.

Of course going to the Linux Station way has its own set of problems that had to be solved before I had a functional standalone KODI. As many of the solutions and workarrounds are distributed through many posts, I wanted to contribute with one post with all the things done to do it.

Please be aware that Linux Station is in fact a container, so we will have to configure things on the QNAP host OS and others in the Ubuntu container side. So for sake of clarity, I'm indicating where the operation is performed usign [QNAP] or [UBUNTU].
  • [QNAP] Under QTS, set up Linux Station to be use instead HD Station. Install Ubuntu 16.04 the way is described in QNAP's user guide.
  • [QNAP] Setup the graphics ouput in the "configuration" section. If you are going to "clone" screesn, you will be not able to use the internal VNC client as the watchdog software will inmediately change the screen setup to "extend".
  • [UBUNTU] Log into the Ubuntu container (through the HDMI terminal) using "admin" credentials. Open a XTerm, and perform the usual "sudo apt-get update; sudo apt-get upgrade"
  • [UBUNTU] "ifconfig" will list the used IP. In my case the Ubuntu container is using 2 IP's, one on the Virtual Switch 2 and the other on Virtual Swtich 1 (this is the one I use for administration porpouses).
  • [UBUNTU] Additionally, also perform "sudo apt-get install ssh" to get remote access to the platform. It will be more easy to perform changes using a SSH session.
  • [QNAP] As I want to use ALSAL instead of PulseAudio, to files has to be modified at QNAP OS to prevent the PulseAudio daemon to respawn.
    In file/share/CACHEDEV1_DATA/.qpkg/ubuntu-hd/lxc/ubuntu_1604/pulse/pulse.common/client.conf set autospawn=no
    In file /share/CACHEDEV1_DATA/.qpkg/ubuntu-hd/lxc/ubuntu_1604/pulse/pulse.common/default.pa set load-module module-udev-detect tsched=0
  • [UBUNTU] To get a fully IR-002 functional remote, I had to create file /etc/rc_keymaps/rc6_mce with the following content:

    Code: Select all

    # table rc6_mce, type: RC6
    
    0x800f041e KEY_UP
    0x800f041f KEY_DOWN
    0x800f0420 KEY_LEFT
    0x800f0421 KEY_RIGHT
    0x800f0422 KEY_ENTER            # KEY_OK
    0x800f0423 KEY_BACKSPACE        # KEY_EXIT
    0x800f045b KEY_ESC              # KEY_RED
    0x800f0426 KEY_C                # KEY_EPG
    0x800f040f KEY_I                # KEY_INFO
    0x800f040c KEY_SLEEP
    0x800f040e KEY_MUTE
    0x800f0411 KEY_VOLUMEDOWN
    0x800f0410 KEY_VOLUMEUP
    
  • [UBUNTU] A new destop session with the needed parameters for ALSA Kodi is needded. Create fle /usr/shase/xsessions/kodi_alsa.desktop with the following content:

    Code: Select all

    [Desktop Entry]
    Name=Kodi ALSA
    Comment=This session will start Kodi media center in ALSA mode
    Exec=env AE_SINK=ALSA kodi-standalone
    TryExec=kodi-standalone
    Type=Application
    
  • [UBUNTU] To get autologin working, the file /etc/lightdm/lightdm.conf has to be as follows:

    Code: Select all

    [Seat:*]
    autologin-user=admin
    
    If you need to disable autologin (ie. to lauch the Unity desktop instead Kodi), the file has to be modified to:

    Code: Select all

    [Seat:*]
    autologin-user=admin
    
  • [UBUNTU] To get KODI as the default windows manager, modify /home/admin/.dmrc to:

    Code: Select all

    [Desktop]
    Session=kodi-alsa
    
  • [QNAP] Reboot the Ubuntu container using the web tool.
  • [UBUNTU] One thing that can be needed is to "reset settings to defaults", under "configuration->system->audio" to get all the passthrough configuration.
[UPDATE] I've adquired a Pulse-Eight CEC adapter, so I digged how to make it work in this configuration .....
  • [QNAP] At file /share/CACHEDEV1_DATA/.qpkg/ubuntu-hd/lxc/ubuntu_1604/config the following lines have to be inserted just after the "# lirc" section:

    Code: Select all

    lxc.mount.entry = /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
    lxc.cgroup.devices.allow = c 166:* rwm
    
    Restart the UBUNTU container to make the changes effective.
  • [UBUNTU] Even if the Pulse-Eight CEC adapter is now visible and detected by Kodi it is still unuable till we add the user admin to the dialout gorup:

    Code: Select all

    sudo usermod -a -G dialout admin
And those are the steps to get an standalone Kodi with ALSA I followed.

Now I'm trying to get to know how I can have 2 cloned screen with differente resolutions. On an "standard" Ubuntu 16.04 this will be done with the following command on Ubuntu's side:

Code: Select all

   xrandr --output HDMI1 --mode 4096x2160 --scale 1x1 --output HDMI2 --same-as HDMI1 --mode 1280x720 --scale-from 4096x2160
This will get a full 4K screen on main TV and an scaled down HD Ready image to the second monitor. Problem is QNAP has a "nice" watchdog running on QNAP side who inmediately reverts to the original configuration ... ¿any ideas?

Cheers,
Sergien
crypticc
Starting out
Posts: 30
Joined: Sat May 20, 2017 7:31 am

Re: [LINUX STATION] Getting KODI to run as default windows manager

Post by crypticc »

Good instructions. Thank you

FYI for step 6 in order to disable pulse I needed to edit this client.conf file location to get it to stick - so presumably the file has moved on latest QNAP firmwares.

/share/CACHEDEV1_DATA/.qpkg/ubuntu-hd/lxc-config/pulse/pulse.common/client.conf

Without that QNAP kept resetting client.conf per other guides on this site.

I also did not setup load-module module-udev-detect tsched=0. When I did that the NAS wouldn't find my USB DAC
Locked

Return to “Official Apps”