Fix Skipping Videos Running OSMC on Raspberry Pi 3

Issue: no matter the network connection speed videos which are larger than ~12GB per 1.5 hours are constantly skipping, buffering and are completely unwatchable.

The proposed fix will work only if your network bandwidth really could accommodate the speed needed for seamless video streaming. This is easy to check – say you want to see if your 20GB video should in theory play smoothly on the network player. In order to check this you could start copy process from your network storage to your workstation via Samba or FTP (or anything else you can think of) and see the estimated time of file transfer. Let’s imagine it says that your 20GB file will be copied in 50 minutes, in case the video playtime is 120 minutes you can be sure that it should be possible to stream this file seamlessly to a network player and you should not experience any stutter. In reality I am facing the issue described at the very beginning of this post.

Fix: apply fix described here in Example #4.

SSH to RPi

And check KODI version, for fix to be simple copy-paste the version should be >= 17. Currently NOOBS installation of OSMC is supplied with 17.6 by default. In case your version is older, please refer to the linked fix and read how settings names should be changed for older versions. Obviously you have to know the IP address of your RPi device with OSMC installed, it is easy to do either from System Info inside OSMC GUI or by checking connected devices on your router web interface.

Login: osmc
Password: osmc

Credentials are default, ssh is also on by default after OSMC installation.

Screen Shot 2018-04-15 at 18.38.05

Apply the Fix

Go to /home/osmc/.kodi/userdata/ and create file ‘advancedsettings.xml’ there. I have installed Midnight Commander for convenience and also used its embedded text editor for pasting the correct text inside the file.

Screen Shot 2018-04-15 at 18.39.33Screen Shot 2018-04-15 at 19.12.24
Now save the file and reboot by ‘sudo shutdown -r now’ from your ssh session. On the next boot you should have no more issues playing large video files.

Never cut power to your RPi without doing a proper shutdown from OSMC or other available OS GUI because it is easy as 1-2-3 to corrupt OS on your SD card and be forced to re-install the OS.

 

DLNA Audio Player for iOS

KODI, how I wish you were available for iOS!

Well, technically if you are ready to jailbreak your phone or suffer through other ways of getting a development build on your iDevice, then KODI *is* actually available for iOS: http://kodi.wiki/view/HOW-TO:Install_Kodi_for_iOS#Development_and_custom_builds

However for the majority of people AppStore is where the apps are, so I started looking there, the obvious place, right?

2.5 hours and approximately 40 EUR later I sort of have found what I was looking for, had to install paid versions of multiple players just to learn that they are incapable of doing what I wanted them to do.. Am I just retarded or there is no easy way to ask for a refund on app from the AppStore, like on Android for example?

Oh yeah, if you mean this -> http://ioshacker.com/how-to/get-refund-app-purchased-app-store then FUCK THAT SHIT! I think I know now how AppStore gets much better earnings per app than PlayStore – it just makes it hard for people to get refunds for the crap they bought! Don’t buy crap you say? Well what if I need to test before I can give the verdict and there is no ‘lite’ version or ‘lite’ version do not have the feature I am after? Well, FUCK THAT SHIT AGAIN I AM PISSED!

With this rant out of the way I can get back to the core of the issue – what I was after, what the requirements have been.

Find a UPnP / DLNA player that can play folders served from the server and have ’shuffle play’ functionality.

That was it! I thought well, should be easy, basic stuff.. I do not wish to litter the post with swearing more but to put it mildly – expectation turned out to be very different from reality… Play individual tracks? Here you go, please, but playing the whole folder – NOOooo, soooo difficult!

Why did I write that I sort of have found the solution? The player I found is able to play folders but not the topmost folders, for example if you have a folder ’some shit’ and it has a subfolder ‘more shit’ then you will be able to play only the ‘more shit’ folder and only if that folder contains nothing but tracks, if it has tracks + some folders, you are screwed again. Did I mention that this player has UI resembling Pablo Picasso paintings more than human usable interface? The screenshot cannot show all the WTF? moments you are going to have, so if you are the first time user – good luck finding where to tap! Add to that the complete freezes where you have to kill the app and re-launch (thankfully do not happen while playing, rather happen when browsing through the DLNA server much).

IMG_0636

I am done with this search, Creation 5 will likely to stay with my iDevice – I have no mental power left to continue looking for alternatives and with this, still very much pissed, I would like to conclude the post.

From Plex to Serviio via MiniDLNA

I’ve decided to make a switch – NUC (previously wrote about it here) is replaced by Raspberry Pi 3 B in Media Player role and NUC itself will serve File Server role from now on. In order to do that, I have made some reconfiguration and also installed Plex on my NUC (which has Ubuntu 15.10 at the moment of writing this blog post). It did not go well..

Plex was visible from other devices but as soon as I try accessing files from DLNA-enabled device, Plex occupies all CPU cores almost at 100% and nothing happens, I mean content cannot be accessed. This problem did not go away despite my several attempts at fixing it. Finally I gave up on Plex and went searching for another options.

MiniDLNA was a logical next step as this is quite popular solution for embedded devices and Linux. Well, almost worked – music and videos were all right but collection of photos did not want to show up on Kodi or similar players on any platform. Randomly some photo would display after very long delay but it was so slow to show up to be considered unusable. MiniDLNA log file showed errors like this a lot: “Returning UPnPError 701: No such object error”. Somewhere on the forums I’ve seen people saying the error is insignificant and everything should still work. Unfortunately not my case – I was unable to fix pictures display on any of the media players when MiniDLNA was serving the content.

Serviio came up next in my search after the fiasco with MiniDLNA. It is Java application that runs from terminal by default (with an option to make it a daemon), it is configured by using a web interface (a-la Plex) and to my delight it actually handles all content pretty well, the problem is resolved, thanks, Serviio!

Raspberry Pi 3 B as Media Center

Over the weekend experimented with OpenELEC Linux flavor for Raspberry Pi 1 B. Experimented with wired and wireless connection options, unfortunately in all cases performance was very laggy on high quality HD movies, if 720p was ok in some cases, 1080 was never played at an acceptable level. I compare it with Intel NUC which I setup for media center some time ago and now using it for different purposes – comparison is very bleak, if NUC is fully capable as media center, from playing music and movies to viewing vacation photos then RPi only able to play music somewhat ok. Still I have used Xonar USB audio because embedded sound produced noticeable static when playing music.

I understand that I compare something that costs ~600 EUR to something around ~50 EUR and it does not seem fair.. Anyways, I decided to give a shot at newer model of Raspberry Pi – model 3 B. Just ordered it at http://www.modmypi.com/raspberry-pi/set-up-kits/rpi3-model-b-kits/supreme-kit-including-raspberry-pi-3-model-b. Will update this post once I get my hands on what is in the kit, here is the list I got in my mailbox, accompanying my order:

Supreme Kit Including NEW Raspberry Pi 3 Model B
– Includes Raspberry Pi: Raspberry Pi 3 B **R..
– Raspberry Pi Case: Raspberry Pi Foundat..
– Select Case Colour: Official Black and G..
– Micro SD Card Size: 8GB w/ Official Adap..
– Power Supply Select: Black Universal 5V 2..
– Video Cable Select: HDMI – Black – 2m **..
– USB Cable Select: Standard – Black – 1..
– RJ45 Cable Select: Black – 2m **CAB-000..
– Keyboard & Mouse Select: Wireless – Ultra-Min..

It Has Arrived!

20160328_131312

Please note that Asus Xonar U3 was not part of the package, I use this external audio card in conjunction with Raspberry because Pi’s internal audio has too much interference and the situation did not change for the better with this newer model, sound output is as noisy as it was on RPi 1.

This new model came with 8GB flash card that had NOOBS installed on it. I have selected OSMC from the list of possible operating systems and installed it. Please note that you have to plug the wire into the Ethernet socket in order to get some other OS different from Raspbian, this is because NOOBS will download the needed OS from Internet, which would have been possible with WiFi too but unfortunately NOOBS does not support wireless and it seems it won’t get such support in foreseeable future, so get your Ethernet ready before powering on the RPi.

What was interesting about the package is this: Rii mini wireless keyboard with touchpad (and laser pointer). From previous experience with standalone media players running Linux, sometimes problems happen that require mouse and keyboard to be hooked to the player in order to fix the issue, so previously I was taking the devices from my workstation, plugging those into the player, fixing the issue and plugging the devices back to the workstation. Not anymore! Rii is going to be very close to the RPi device, always ready to intervene in case of an issue that cannot be solved with Kodi Remote (using Kore on Android phone).

Verdict

IT FREAKING PLAYS EVERYTHING WITHOUT ISSUES!

You can configure anything and everything, as I mentioned above I am using additional sound card with RPi and I had no issues setting the sound output to the card instead of RPi analog output or my TV’s HDMI. There was slight annoyance though – I had to increase buffer size because some particularly large videos were not playing smoothly. Just create file called advancedsettings.xml with this code:



1
100000000
4.0


And copy the created file to /home/osmc/.kodi/userdata/. Just mind that you have to SSH into your RPi running OSMC and create file there, not on your workstation :) Login / pass for default OSMC installation is osmc / osmc.

20160328_131422

Plex, Twonky, XBMC & NUC

DLNA was out there for quite a while now, call me a slowpoke but I finally decided to give it a try!

First question that needs to be answered is WHY? Well, if you have a bunch of stuff like music, movies and photos on your home file server (NAS) it is likely you want to have some convenient way of accessing all those riches preferably from all your devices and in a more or less the same way – this is exactly what DLNA server on your NAS does for you. If you have one that is – some NAS devices come equipped with DLNA server right out of the box but if your file server is not a commercially available NAS but some custom solution, like maybe ageing PC turned into a file server then you have to add DLNA capabilities yourself.

Second question is WHAT? And here is what you need to get going:

XBMC/KODI

Media centre that is able to find available UPnP devices on local network and play the content. Versions of this media centre is available for Linux, Android, Windows and OSX at least. I should note that for OSX I have also tried the alternative - PlugPlayer. Cannot say I was too impressed with it though because mostly I was seeing this screen below while trying to use PlugPlayer:
PlugPlayer dies again

My advise is to stick to XBMC/KODI.

Another very nice thing about XBMC/KODI is the remote control capabilities – you have to enable control over HTTP in the settings menu and after that you will be able to control the playback with Android app for example.

Plex or Twonky

Both of them are quite popular server side solutions that have Linux versions (my file server is running Linux) so I decided to try one of these first and see if I am good or should explore the alternatives.

I have started with Twonky and got a show-stopper issue right out of the box: scaling of the photos did something very ugly to the pictures – everything became very low resolution and blocky, pixelated. There are some solutions to try like this one for example but it did not work for me, after couple of hours of fruitless tinkering I decided to say goodbye to Twonky and move on to the alternatives.

Enter Plex – media server with a very good Web frontend that could do anything really be it playing video, music, browsing photos or configuring the server itself. It worked as expected immediately and you do not really have to create Plex account to use it, so I opted out and still got what I needed.
There was no issues and especially that nasty rescaling of photos was gone, picture quality was great.

Of course other solutions are out there like minidlna, for instance but Plex worked well for me and I decided to not fix what is not broken. There is one feature though that is heavily discussed online – accessing your content outside of your LAN. This is possible via Plex account and paid membership (I think so but did not actually try, so may be wrong). However people also write that you could have something like this done with SSH port forwarding feature just forwarding correct ports from the PC running Plex to your router with external static IP.

XBMC/Plex integration

To get all the content from your server shown on your XBMC/KODI media centre you have to add UPnP source for each of the sections – Music, Video, Pictures. However there is a different way of getting much more significant integration with proper search capabilities like that of a native Plex client. This could ‘theoretically’ be achieved by using PleXBMC addon (installed beta4 version because others gave me errors) I just did not try it yet so probably update the post once I have some positive experience with this addon.

One very annoying thing to keep in mind without the addon – search in XBMC/KODI will not work with your remote server, meaning that searching for anything will give you 0 results whatever you do. What you have to do is use ‘filtering’ instead of searching, meaning you have to get inside the directory on your remote server and once there, use the sliding menu on the left screen border to enter filter, so you get only entries that pass your filter. Not sure why XBMC is not recreating some local version of remote media database for search to work but this is how it is. Maybe I am doing something wrong but I was not able to figure out how to make search work.

NUC

The last part of the equation, not required by the way – a dedicated device that is always on, connected to LAN and a TV, hardware media player. There is nothing stopping you from running XBMC/KODI on whatever platform and device like your laptop for example. I just wanted a new toy so decided to try and turn some micro PC into a media player running Linux + XBMC/KODI hooked to my TV.

There definitely are many alternatives to NUC and cheaper ones however NUC is quite powerful, having i5 CPU, supporting 16 gigs of RAM and SSD HDDs. Basically a real PC but very small-sized. Opting for NUC gave me more flexibility to do something more with this little thing later – not just media player. Talking strictly about media player functionality Raspberry Pi would have been a way cheeper choice though very limiting in terms of hardware power and compatibility (it’s ARM, not x86/64 architecture, no normal version of Windows for instance).

I have decided to install Linux Mint 17.2 on my NUC, it is Long Time Support release so I’m all set until 2019! Windows would also work perfectly fine but where’s fun in that? As much as I would enjoy all these new spyware features in Windows 10 I would still prefer gewd ol’ reliable Linux which is also happens to be free as in free beer sense :) By the way even Intel published a guide on making media centre box out of NUC using Linux Mint & XBMC. Didn’t use the guide though but maybe this one will be useful for somebody out there.

The best advice I got about NUC was from some blog post (unfortunately do not remember which post exactly) recommending UEFI boot – that really got NUC booting up instantaneously. Setting up Linux on NUC definitely use UEFI boot partition, search the web for guide on that if you need.

Overall my experience with the whole setup was quite positive but yeah, there are several annoyances, see below.

Annoyance #1: sporadic wake-ups from suspended state, fixed by turning off wake on LAN feature in BIOS.
Annoyance #2
: XBMC simply hangs after running for many hours straight in idle mode (i.e. not being used actively). No real fix for this one for now, seems I am using the latest version of KODI already, so I have just set up a cron job that restarts KODI during the night time.
Annoyance #3
: do not expect NUC to be completely silent during heavy load (using all CPU cores close to 100% utilisation) it has a very little fan and noise level is that of a small laptop. This does not happen during playback though but will happen during some CPU-intensive operations like creating large archives for example.

I would like to end this post with a little photo-session, so please welcome, NUC!

20150915_21101120150915_210700
20150915_21080420150915_210739
20150915_21162020150915_211119
20150915_21124820150915_211323