Kodi Community Forum

Full Version: HOW TO: Minimal Ubuntu 16.04 with Kodi, Steam & EmulationStation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
Hi gammelobst,

I don't know how to send you PMs in this forum.

Can you please tell me how your Zbox is working with Kodi?
In my case the Videos have frequently little lags every 2-3 seconds.

Do Kodi play the videos smoothly in your case?
If yes, what did you to get it working?

Greetings

Nicke
@Nickelino

Hi,

my ZBox Nano CI320 with a 30GB Kingston SSD and 4GB of RAM is running smoothly while:
- playing 1080p content from a self ripped Blu-Ray to a mkv in untouched quality with DTS-HD MA in Kodi
- streaming 1080p/50Hz and 1080p/60Hz in Steam InHome-Streaming
- streaming 1080p content from youtube/AmazonPrime in Kodi
- surfing the Kodi menu while watching TV

the Cons aka not running smoothly:
- Steam in BigPictureMode

not tested (because of killed .kodi folder while installing RetroPie x86 - i'm reconfiguring atm):
- gaming in Emulationstation

What i've done to achieve this:

I've installed Kodibuntu 14.04, then i've done a apt-get update && apt-get upgrade -y
rebooted, just to be sure, then a apt-get dist-upgrade with a following reboot.
After this i activated Passthrough-Audio because of DTS-HD MA and the Dolby-thing and rebooted.
Then the funny part: do-release-upgrade with the following reactivation of the repos in 16.04.
I've added xorg-edgers repo for a updated intel driver and installed kernel 4.8.0 from standard xenial repo
Installed/updated Kodi to Krypton RC
installed the pvr-plugin and finally:
i followed this Guide here with a small addition
sudo apt-get install libva1:i386 libva-x11-1:i386 libva-glx1:i386 just to be sure.
(Maybe Installing RetroPie x86 would be better if it would be installed directly after the release-upgrade because it deleted my config the other way - or just leave away the experimental packages if all are selected)

hope this helps a little

cya

BTW:
i added
Code:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_idle.max_cstate=1"
to /etc/default/grub because my BayTrail system will freeze without it. (Only the standard 14.04 LTS Kernel worked without it)

and don't forget to do a
Code:
dpkg --add-architecture i386
before installing steam as it's a 32bit application and the 32bit deps need to be installed

Code:
sudo rm /etc/apt/preferences.d/pulseaudio.pref
will allow you to install pulseaudio, but see my previous post for deactivation of autospawning
@gammelobst:

Hi,

I will try to get my Zbox working perfectly as soon as I can. At first I will try it with my configuration. If it doesn't help, I will start at Kodibuntu 14.04 as you suggested.
You will be informed when I'm done.

Back to our problem:

I changed the configs a little bit:

/etc/lightdm/lightdm.conf ($USER is a placeholder)

Code:
[Seat:*]
autologin-user=$USER
autologin-session=openbox

~/.config/openbox/autostart
added the line emulationstation

Code:
hsetroot -solid black

emulationstation

Now a "normal" openbox session starts with emulationstaion in autostart.
I wasn't still able to start roms or other applications started by runcommand.sh.
The ports like Descent Rebirth or Eduke3d start without errors. (They aren't started with runcommand.sh)

That prooves your assumption that openbox has a conflict with the runcommand.sh.

Usually if runcommand.sh is being executed a terminal window appears with a message to press a button to get into the runcommand menu. This terminal windows doesn't appear in the openbox session.

I hope this informations will help you to find a solution. If i can help you with my tiny skills, let me know.

Greetings

Nicke

EDIT: Now I tried both opportunities to get the Zbox working better:

At first I followed all the steps of your How-To that I haven't already done with my current system.
After that I followed your complete suggestions startet by Installing Kodibuntu 14.04.

Both procedures didn't stop the frame lags.
@Nickelino

RetroPie-Problem solved. Before i saw your last post i tried opening a terminal in the gui and start emulationstation from there and voila it's working.
So edit your Advanced Launcher Emulationstation Paramenter entry from
Code:
emulationstation
to
Code:
gnome-terminal -e emulationstation
and emulationstation has a shell to display it's messages and run as expected.

and going through my bash-history
Code:
sudo apt-get install libvdpau-va-gl1 i965-va-driver vdpauinfo
sudo apt-get install xf86-video-intel lib32-mesa-libgl lib32-libva-intel-driver
sudo apt-add-repository ppa:wsnipex/vaapi
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install pulseaudio libasound2-plugins:i386
weren't mentioned here, but lag-free video is possible ootb with Kodibuntu 14.04.
Do you already have installed the latest bios-update?
Have you checked if you have one of those ZBoxes with the not removed plastic from the CPU-cooler? And yes it needs disassembling the device, but if there is no guarantee on it...

Which codecs are used in those stuttering videos?
and the most easy one: do you use a Refresh-Rate with a multiplier from the video you play? e.g. 1080p50Hz for PAL or 1080p59.94Hz for NTSC...

and my /etc/X11/xorg.conf
Code:
Section "Device"
  Identifier  "Device0"
  Driver      "intel"
  VendorName  "INTEL Corporation"
  # a user reported, that this could cause high jumping fps in the menus when running on Ubuntu Raring
  # in that case set it to "uxa" instead
  Option "AccelMethod" "sna"
EndSection

Section "Screen"
  Identifier  "Screen0"
  Device      "Device0"
  Monitor     "HDMI1"
  DefaultDepth  24
  SubSection "Display"
    Depth       24
    Modes     "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" "640x480_60.00" "800x600_60.00" "1024x768_60.00" "1280x1024_60.00" "1280x720_60.00" "1280x720_50.00" "1280x720_59.94"
  EndSubSection
  SubSection "Display"
    Depth       16
    Modes     "[email protected]" "[email protected]" "[email protected]" "[email protected]" "1920[email protected]" "640x480_60.00" "800x600_60.00" "1024x768_60.00" "1280x1024_60.00" "1280x720_60.00" "1280x720_50.00" "1280x720_59.94"
  EndSubSection
  SubSection "Display"
    Depth       32
    Modes     "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" "640x480_60.00" "800x600_60.00" "1024x768_60.00" "1280x1024_60.00" "1280x720_60.00" "1280x720_50.00" "1280x720_59.94"
  EndSubSection
EndSection

Section "Monitor"
  Identifier  "HDMI1"
  HorizSync   14.0 - 70.0
  VertRefresh 24.0 - 62.0
  Option      "DPMS" "true"
  # you might have to tune the 23.97 modeline it is a bit of trail and run
  ModeLine      "[email protected]" 74.175 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
  ModeLine      "[email protected]" 74.400 1920 2558 2602 2758 1080 1084 1089 1124 +hsync +vsync #INTEL
  ModeLine      "[email protected]"    148.500 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync
  ModeLine      "[email protected]" 148.352 1920 1960 2016 2200 1080 1082 1088 1125 +hsync +vsync
  ModeLine      "[email protected]"    148.500 1920 2008 2056 2200 1080 1084 1089 1125 +hsync +vsync
  Modeline      "640x480_60.00" 23.86 640 656 720 800 480 481 484 497 -HSync +Vsync
  Modeline      "800x600_60.00" 38.22 800 832 912 1024 600 601 604 622 -HSync +Vsync
  Modeline      "1024x768_60.00" 64.11 1024 1080 1184 1344 768 769 772 795 -HSync +Vsync
  Modeline      "1280x1024_60.00" 108.88 1280 1360 1496 1712 1024 1025 1028 1060 -HSync +Vsync
  Modeline      "1280x720_60.00" 74.48 1280 1336 1472 1664 720 721 724 746 -HSync +Vsync
  Modeline      "1280x720_50.00" 60.47 1280 1328 1456 1632 720 721 724 741 -HSync +Vsync
  Modeline      "1280x720_59.94" 74.41 1280 1336 1472 1664 720 721 724 746 -HSync +Vsync

EndSection

Section "Extensions"
  # fixes tearing
  Option      "Composite"           "Disable"
EndSection
@gammelobst

Your solution with the gnome-terminal parameter is a very nice workarround!
But when I start RetroPie now, it closes Kodi, opens the Terminal and Emulationstation and Kodi appears again, so I have 3 windows open. Is it possible to stop Kodi from launching till Emulationstation is closed?

I followed the steps of your bash_history and created the /etc/X11/xorg.conf with the content of yours and it works better now. I will spectate it the days but seems to be fine now.

I think I updated the BIOS but today I'm not really shure, here are some specs that I found in the BIOS' main page:

BIOS Information:
Project Version: B219P 020 x64
Build Date and Time: 11/28/2014

TXE Information:
Sec RC Version: 00.05.00.00
TXE FW Version: 01.01.02.1120

I tried a lot of operating systems (Debian, Ubuntu, Kodibuntu, Windows 8.1, OpenELEC and LibreELEC) and everytime I had an issue with the frames. This is the first time it works.

I looked after the platic thing on the heat platform but there was only this green heat transfer thing on it.
No worries about the warranty, the Zbox has more than 2 years and I think here in Germany after this time its already gone.

The shuttering was in all of my tested videos. I think it was in place all the time but in the videos I could see it clearly.
I tested it with Netflix in Google-Chrome and from a UPNP-server (Serviio) transcoding a mkv-video with 1080p.

I dont know what you mean with the refresh-rate multiplier? Is it a setting in the Kodi-configs?

Greetings

Nicke
(2017-01-29, 03:07)Nickelino Wrote: [ -> ]@gammelobst

Your solution with the gnome-terminal parameter is a very nice workarround!
I wouldn't call it a workaround as it is needed to display the dialog. It would be a workaround if i could capture the text and insert in in a GUI-window...
Quote:But when I start RetroPie now, it closes Kodi, opens the Terminal and Emulationstation and Kodi appears again, so I have 3 windows open. Is it possible to stop Kodi from launching till Emulationstation is closed?
Have you readded your own fix for the multiple-kodi-session problem? Because after implementing this kodi is closed on my box, but never automatically reopened. I have to use the mouse to restart kodi, but this is by far the least worst thing. I live with it until i find a better solution
Maybe we could implement a service that autostarts kodi after some time if no other program and/or window are open
Quote:I followed the steps of your bash_history and created the /etc/X11/xorg.conf with the content of yours and it works better now. I will spectate it the days but seems to be fine now.
nice to hear Blush
Quote:I think I updated the BIOS but today I'm not really shure, here are some specs that I found in the BIOS' main page:

BIOS Information:
Project Version: B219P 020 x64
Build Date and Time: 11/28/2014

TXE Information:
Sec RC Version: 00.05.00.00
TXE FW Version: 01.01.02.1120

I tried a lot of operating systems (Debian, Ubuntu, Kodibuntu, Windows 8.1, OpenELEC and LibreELEC) and everytime I had an issue with the frames. This is the first time it works.
Strange, i've updated the bios once i got my ZBox and Kodibuntu was running perfectly while OpenELEC froze after some time (missing Kernel-Parameter as i know now), but running smoothly at video playback
Quote:I looked after the platic thing on the heat platform but there was only this green heat transfer thing on it.
No worries about the warranty, the Zbox has more than 2 years and I think here in Germany after this time its already gone.
I'm from Germany too, so english would not be necessary, but in an english forum...
Quote:The shuttering was in all of my tested videos. I think it was in place all the time but in the videos I could see it clearly.
I tested it with Netflix in Google-Chrome and from a UPNP-server (Serviio) transcoding a mkv-video with 1080p.
Which is exactly the other way i use it for. Why do you transcode the mkv before playing, as kodi could play it directly from a samba share and import it in it's database?
The database could also be located at the streaming server for network usage
Quote:I dont know what you mean with the refresh-rate multiplier? Is it a setting in the Kodi-configs?
I mean playing a 25fps video with a refresh rate of 25Hz or a multiple of it(50 or 75Hz)
Quote:Greetings

Nicke

cya
@gammelobst:

Hi,

its a little bit confusing with the kodi-runprogram-script because in my case meanwhile it works correctly with both the original script and my solution.

For now I prefer the media server DLNA solution because the server isn't running alle the time and my home is a completely Linux environment and I don't want to use SMB shares. I prefer NFS in this case but since Ubuntu 16.04 it is really hard to get NFS working correctly. The clients which mount the NFS-shares hang at the shutdown sequence when the share isn't reachable anymore. Thats the reason why I Use DLNA nowadays.

I found out that if I use your /etc/X11/xorg.conf I cannot login to Unity anymore. If i type in the password on the login screen and push login the screen goes black for 1 second and then I'm on the login screen again. So I deleted reanmed it and now the shuttering is back :-(

Can you say me, how the repositories are called, to install the follwoing packages?
I tried to found out the names with Google but didn't found the them.

Code:
sudo apt-get install xf86-video-intel lib32-mesa-libgl lib32-libva-intel-driver

Greetings

Nicke
@Nickelino

as i am coming from Kodibuntu i never used Unity on this box, but how about an other desktop environment? Ubuntu-Mate is the one i prefer on my Desktop-Machine.

Code:
sudo apt-get install xf86-video-intel lib32-mesa-libgl lib32-libva-intel-driver
was from steam-forum and didn't work. I just copied not before used lines from my bash-history. So sorry for this.

Have you tried setting up nfs in kodi instead of directly through ubuntu?
I use my samba-shares via kodi. I haven't set them up in fstab because of the same hanging you get via nfs. Using them in kodi is so uncomplicated please try if this also applies to nfs and give me reply.

BTW:
I solved the kodi not restarting thing with a simple bash-script
Code:
vi /home/kodi/check_running_processes.sh
and insert
Code:
i can't post it because of cloudflare   Cloudflare Ray ID: 32a75d0f147563c7

bash script to monitor 3 processes ...
use post #6 with -gt "0" instead of -lt "3" and set the kodi start command in the else statement. I also set the DISPLAY-variable to make sure kodi starts on screen 0


It grep's for the number of my watched processes and it does not start kodi if the number is greater than zero.
Now run it every 30secs via
Code:
crontab -e
and add
Code:
* * * * * /home/kodi/check_running_processes.sh
* * * * * sleep 30;/home/kodi/check_running_processes.sh
at the end and kodi will be restarted if no monitored processes are running with acceptable waiting time

cya
@gammelobst

I tried to setup the NFS-option in Kodi and if i choose the server, it shows the directories, but I cannot open them. I think if it works, it will be a great solution to bypass the systemd-nfs-issue . Maybe I have to change the exports file from the Server, but this is another project....

I followed your suggestion to monitor the running processes and it works great.
Here is the current configuration:

- start session Openbox in lightdm.conf

- Openbox autostarts Kodi

- My Monitorinig script checks wether there are openbox-childprocesses, gnome-terminal-sessions and kodi-sessions. If no one of them is active, it starts kodi.

- crontab starts the script every 10 seconds in my case

Thanks for your help. I will test this config the next days.

EDIT: I saw that if Kodi is started by cron, the shutdown-options in kodi are missing. Maybe kodi needs in cron a parameter to show this options again?

Greetings

Nicke
@Nickelino

great to see that nearly all our problems are solved now.
I can shutdown my box via the "Ausschalten"-function in the Power menu in Aeon Nox.
Which options do you mean?
I run it every 30seconds because most of the time the script is called earlier and pulseaudio needs a few secs to start.

cya

BTW: i use
Code:
killall -9 pulseaudio
DISPLAY=:0 LANG=de_DE.UTF-8 /usr/bin/kodi &
to start kodi
and the final missing piece:
Code:
vi /home/kodi/emulationstation_starter.sh
and insert
Code:
sleep 2
pulseaudio -D
sleep 5
SDL_AUDIODRIVER=pulse gnome-terminal -e emulationstation
to start pulseaudio while using emulationstation.

oh, and i use the guide here with additions exept those mentioned in post #14
Kodi is started via kodi-openbox on boot, after that kodi is started by my script.
Pulseaudio is deactivated @boottime, as mentioned in one of my earlier posts, so kodi-openbox is ok. For Steam and Emulationstation i start pulseaudio so there is need for my cronjob as it kills pulseaudio before starting kodi...
Now i begin to wonder if there are any other useful fullscreen-apps to integrate. Any ideas?
Additions:

Browser (Firefox Nightly)
Code:
sudo add-apt-repository ppa:ubuntu-mozilla-daily/ppa
sudo apt-get update
sudo apt-get install firefox-trunk
install "mfull" extension and configure it to go into fullscreen as default
add "firefox-trunk" to the monitored processes in check_running_processes.sh

Create a launcher in AdvancedLauncher for Firefox:

Open the add-on
Open the Default folder
Bring up the Context Menu and select Standalone Launcher
In the Path dialogue that appers select Root and navigate to: /usr/bin/kodi-openbox-runprogram. Press Done.
In the Arguments dialogue enter the argument: firefox-trunk
In the Title dialogue enter the name Firefox
In the Platform dialogue select Linux
Leave the next two dialogues blank.

More will be added if useful for a HTPC and can be easily integrated here
@gammelobst:

I meant exactly this Power-options in the Aeon Nox skin. I fI start it with a script started by cron, there only appears "Beenden" (quit) and not "Ausschalten" (shutdown) or "Neustarten" (reboot).

My solution for this issue is to start Kodi with gnome-terminal Big Grin

Code:
DISPLAY=:0 LANG=de_DE.UTF-8 gnome-terminal -e kodi

I have no matters with the terminal window beside kodi

There are no problems with sound or pulse-audio in my case.

Seems that the box is ready to use now, finally

I'm going to configure retropie now. The next step is getting my old games working in a DosBox with xbox-controller support

Greetings

Nicke
@Nickelino

strange, i have these optionsHuh
but a window in the background isn't disturbing so ok.

Maybe HTPC Manager could be an useful addition to have a graphical disk usage and the installation is very straightforward.(And i have most of the other services running on my OMV-Server) Big Grin
Oh and i forgot to mention: i have squeezelite running in the background with a 90 second startup delay because kodi keeps alsa blocked for 60 seconds. After 5 more seconds squeezlite frees the audio device and the system is all up.
While TV is off and no sound is played for a minute i can stream music to my Box via my Logitechmediaserver. This gives me multiroom audio with synced playback - controlled via webinterface or the "squeezer" app on Android.

cya
@gammelobst:

here is a better solution for the problem with the missing entries in the shutdown menu.
I don't know what is the problem in general but the issue came when I started Kodi via scripts.

Here is the solution ($USER is a placeholder for the operating user):

Code:
sudo nano /etc/polkit-1/localauthority/50-local.d/custom-actions.pkla

Code:
[Actions for $USER user]
Identity=unix-user:$USER
Action=org.freedesktop.login1.*;org.freedesktop.udisks.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes

[Untrusted Upgrade]
Identity=unix-user:$USER
Action=org.debian.apt.upgrade-packages;org.debian.apt.update-cache
ResultAny=yes
ResultInactive=yes
ResultActive=yes

Now I can start Kodi via scripts and I have the entries in the shutdown menu. Now I needn't to start Kodi with gnome-terminal and there is no Terminal-window in the background.

Greetings

Nicke
@Nickelino

ok, i already had
Code:
[Actions for $USER user]
Identity=unix-user:$USER
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*;org.debian.apt.upgrade-packages;org.debian.apt.update-cache;org.freedesktop.login1.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes
in it, so this is it if someone is missing.

cya
Pages: 1 2 3 4 5 6 7