One of my OSMC boxes (RPi2) is set up primarily for music streaming. It uses a slow (class 4) SanDisk 16GB SD card and is connected to the internet via powerline:
Most of the time the device works just fine. But maybe once or twice an hour there will be a pause in playback (like it is buffering).
I always assumed this would be a problem with network speed, and maybe it is, but it occurred to me today it might also be related to the slow SD card. Is that possible?
Is there a definitive way to test? I already tried a couple of speedtest apps, and I get similar down/up speeds as on my PC attached to the main router. But since the second router is connected by powerline, I guess it is possible to have intermittent noise or interference. So I am not sure there is an easy way to validate the network part. If a slow SD card is a possible culprit, I could just try replacing it to see.
I thought of using a powerline as well for my pi behind the TV but initial tests proved just thatâŚi had occasionally slow speeds. I dont know whyâŚbut i was really not satisfied with it.
Eventually i set an AP on the balcony, and use a wifi stick on the pi. I can stream 1080 with no problems. sudo apt-get install wavemon to install a program to âfindâ the sweetspot, on where to place the AP. It gives a live feedback of the dbm the wifi stick has with the AP.
Nobody can tell me if a slow SD card could theoretically harm streaming speed / performance?
I donât mind trying a new card. But wonât bother if someone definitively could tell me that SD card speed is completely unrelated and could not be contributing to this issue.
OK, thanks. Thatâs what I was trying to learn. I did not know if streaming is literally direct to output, or if there is an intermediate step that buffers locally on the SD card. I guess if there is any buffering, it would be done in RAM?
There is one thing you can try to figure out whats wrong.
Put your âstream/movie/musicâ on a usb stick, and play it directly from the pi.
Remove the powerline and connect a wifi stick and stream the same music over wifi
Do the same thing but with a cable (LAN) connection, not a wifi or powerline
This way youâll know for sure, whose fault it is.
My guess is the speed with the powerline isnt that high, I dont know what type of stream you are sharingâŚmp3, ogg etcâŚbut try a movie insteadâŚdoes it do the same thing ? Or any other online addon like youtubeâŚIf itâs caused by low bandwidth then those things should stutter and buffer as well.
If the usb method, or the LAN cable method does not cause you problems, then its not the cpu, ram etcâŚits the powerline, that gives low speeds.
By default, Kodi caches a small amount of data to ensure there is little to no buffering.
Try reading and writing simultaneously to a class4 card and let me know how that works out.
If you are streaming with a USB install device, then you are using precious USB bandwidth that is needed for network data. Donât forget that eth0 is slapped on the USB.
Caching - Depends if you specify ram or local storage in the advancedsettings.xml,
@CaNsA - thanks for all your helpful replies. I went ahead and ordered a Samsung EVO class 10.
I am not at home right now to check my advancedsettings.xml, but have not changed this setting myself so it should be using default. Do you know what default is? It sounds like you are indicating it is the SD card, but I thought it would generally be RAM for this type of operation?
Doesnât this suggest I could get around the slow SD card by using RAM for cache instead of the card? (Just curious, as I said I went ahead an ordered a new card anyway.)
By default RAM is used for buffering the video.
However there will be occasional sdcard accesses when playing video (e.g. log messages or loading of skin resources when pressing buttons). It is just possible that a big delay from the sdcard could cause a playback issue.
I donât think itâs likely that the sdcard is the cause of streaming issues, but it is not impossible.
So I tried a Class 10 SD card (Samsung EVO 16GB). I have not had a chance to test extensively, but I was listening for an hour or so yesterday and still noticed a couple of gaps.
But today I just saw this post about âmicro dropoutsâ. It sounds kind of similar to what I am experiencing. In that thread, @popcornmix suggested setting buffermode=1 (Kodi page). I will try this when I get home and see if it helps my setup too.
I have found that my RPi machines on hard wired network can manage thruput at 98Mb/Sec. Connect two RPi machines on the same switch and run iperf. (client on one machine and server on the other). That test is only HDX but then so is streaming video.
You may have loss in your powerline connections. IF you are making errors the protocol will be making retrys and the total thruput suffers.
As some have pointed out buffering can be either in RAM or in SD or USB memory. Even though my network performs nicely I still allocate 20MB of RAM for buffer.
Itâs always hard to say with this kind of intermittent problem, but I listened for about an hour again last night (after setting buffermode=1) and did not notice any streaming issues this time. So this is definitely promising.
I will continue to monitor and report back once the new setup has a little more history.
Update: I used the unit on-and-off for the last several days and have yet to encounter another incident of music buffering or lag. I think it is fair to say that setting buffermode=1 in advancedsettings.xml has resolved the problem.