Buffering issues cmyth w/HD-PVR
#1
Hi

I'm currently running xbmc and mythfrontend on the same computer in my living room. Mythfrontend can stream just fine from the backend, even though the backend is located at another place and is accessed over the internet. The connection between the two is 60mbit, both on fiber, latency averaging between 5-10ms. Everything is wired at their respective locations.

The problem I'm having is that the cmyth plugin constantly needs to buffer, which never was a problem with mythfrontend. After some debugging I can see that cmyth is reading anywhere from 700bytes to 32k a time, mostly in the lower part of that spectrum, which I belive is the problem. Is there an easy way to try to increase this?

I also get a lot of these, which I'm guessing is related.
Code:
13:02:44 T:2465442624 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer
13:02:44 T:2414857024 WARNING: Previous line repeats 3 times.
13:02:44 T:2414857024 WARNING: CDVDMessageQueue(audio)::Get - asked for new data packet, with nothing available
13:02:45 T:2465442624 WARNING: CDVDMessageQueue(video)::Get - asked for new data packet, with nothing available

If I didn't know it was possible to run mythtv over this link already I would've just guessed it was due to bandwith/latency, but since mythfrontend can handle it just fine, I'm hoping there's something I can do to get it working with xbmc.

My other suspicion is that cmyth is too close to the beginning of the ringbuffer and is therefor not getting new data, but pausing for a while and unpausing again doesn't seem to help for long, so I've kinda abandoned that idea.

Running latest version (49f2df82f3d7a6156cae2ba36e21deac93d0b677) of the plugin compiled from git earlier today, xbmc 12 on ubuntu 12.10. Backend is running Ubuntu 12.10, mythbackend 0.26.
Reply
#2
On the raspberry pi, I'm having a similar buffering problem as well streaming mpeg2-ts using livetv on a 100mbit ethernet connection. It also happens when I try to watch recordings using the plugin as well, but doesn't occur when I watch those recordings using the "video" section of xbmc.

Everything works fine when I use mythfrontend on a laptop instead.
Reply
#3
Well, the HD-PVR is outputting mpeg4, and it's being decoded with the x264 decoder in xbmc if I remember correctly. I've not tried this on the pie yet, but three other more than powerful enough computers. I tried both software decoding and hardware decoding and for everything else it works fine including 1080p. This includes recordings via the cmyth plugin. The only thing not working is LiveTV.

Forgot to mention that I tried increasing the "cachemembuffersize", but not sure if that makes any difference.

Average bandwith when mythfrontend is running is 15mbit btw, with peaks just above 20.
Reply
#4
Hmm.. not sure what I did since, but I don't seem to be having the buffering problems with my RPI anymore.

Things I did.
(1) I reset my backend.
(2) I changed the advancedsettings.xml and set the cachemembuffersize

(3) I changed the sysctl.conf to the following:
vm.min_free_kbytes = 16384
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_syncookies = 1
net.core.wmem_max=1048576
net.core.rmem_max=4194304
#net.core.rmem_max = 327680
#net.core.wmem_max = 327680
net.ipv4.tcp_rmem = 4096 87380 260096
net.ipv4.tcp_wmem = 4096 16384 260096

Not sure which of things worked since I made the changes all at once but I definitely not getting the buffering problems anymore.
Reply
#5
Wink 
Did you change these on there server/client or both. I'm not able to test right now, in a day or so before I'll be able to I guess. But thanks Smile

Just want to add for any devs reading too, the GUI for this stuff looks amazing. Far better than what I've seen before from any other PVR solution!
Reply
#6
Smile 
Hi,

First : sorry for my english, i'm french Wink

I have the same problem on a XBMC/ATV2/Mythtv addon.

When I look on ATV2 from a recording made on my MythTV backend, it stops regularly for caching. Since my PC running Ubuntu 12.04 with XBMC for cons hopefully no buffering ...

I did one of the things that you know to edit advancedsettings.xml reports. Can you tell me the value that you chose in the cachemembuffersize.
Secondly you indicate that changes in sysctl.conf, is it done on the backend or mythtv machine where xbmc?

Thank you in advance for your answers

Spart34 from France
Reply
#7
I did these things only on the Raspberry Pi, which I use as the client, therefore I am not entirely convinced that these fixes will work on other hardware.

I don't remember what I exactly entered in for the cache size, but I think it was 5280000, somewhere around that number. Since then I have been running a new nightly of openelec for the RPI that doesn't use cachemembuffersize, but uses another method which takes a % of the remaining free memory, so I can't look up the #. Anyways everything is still working with little or no buffering.

Question for you both, do you have buffering when playing video files under the "Videos" section?
Reply
#8
If you're seeing this problem, could you please ssh into your MythTV box and run top to check for excessive cpu usage on the mythbackend process while a video is playing. Some of us have been experiencing this, especially when the MythTV system has not been rebooted for some time.

The developers of the plugin suspect that cacheing of images may be causing this, and have provided for testing a version of the plugin that does not use images. However, it needs more testing to be sure that the images are triggering the problem. Any help with this would be appreciated.
Reply
#9
I'll check when I get home from work today. Is the plugin in a branch on github or something? I'll be more than happy to test it out.

Huuh: No, I never have any problems at all in the Videos section.
Reply
#10
(2013-02-10, 19:18)Huuh Wrote: On the raspberry pi, I'm having a similar buffering problem as well streaming mpeg2-ts using livetv on a 100mbit ethernet connection. It also happens when I try to watch recordings using the plugin as well, but doesn't occur when I watch those recordings using the "video" section of xbmc.

Everything works fine when I use mythfrontend on a laptop instead.

I didn't see this mentioned, but did you purchase the MPEG-2 decoder for your Pi?

http://www.raspberrypi.com/mpeg-2-license-key/
Reply
#11
There's almost no CPU usage at all on the mythtv-backend.
Reply
#12
Morning

Ok....this might be a strange suggestion but replace the USB cable from the HDPVR to the computer. I too have the same box, and mythfrontend would always play my files fine, be it recordings or livetv. I then tried the XBMC plugin and it wouldn't play shit. Well it would play but it would drop frames like a bitch all over the place, Same computer for frontend/xbmc but wouldnt play any recordings nor livetv. One day I plugged the HDPVR into windows machine to see if there was a firmware update maybe fix the problem and Windows was not detecting it at all, Saying problem with my device. Replaced the USB cable that came with it with another one i had lying around and boom, everything works now. XBMC wont play the old recordings, but liveTV and new recordings are working just fine now.

Cheers!
Reply
#13
That sounds really weird, but I'll try it next time I have a chance Smile

The thing that stumps me is that I have no problems running it with mythfrontend. Frustrating since I need to switch between xbmc/myth when I really want to have everything working in xbmc.
Reply
#14
That has also been my experience. If I access MythTV recordings (1080i or 576i, h.264 codec, mpeg ts container, situated on a remote back end connected by GigE) via either the old myth:// protocol, or via the cmyth PVR plugin then the recordings are basically unwatchable due to constant buffering, almost like XBMC is unable to access the network interface efficiently enough to keep the video buffers full. However, if I access those same recordings via either UPnP video source, or just via SMB mapped directory in Videos then they play back fine, no skipping issues or buffering. Very strange! I'm pleased to see I'm not the only one with this issue. I have the same problem on both of my PC based XBMC (Frodo) installs and my OpenElec RPi.
Reply
#15
Quote:I didn't see this mentioned, but did you purchase the MPEG-2 decoder for your Pi?
What for? This conversation is about hdpvr which is h264.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply

Logout Mark Read Team Forum Stats Members Help
Buffering issues cmyth w/HD-PVR2