hzeller / gmrender-resurrect

Resource efficient UPnP/DLNA renderer, optimal for Raspberry Pi, CuBox or a general MediaServer. Fork of GMediaRenderer to add some features to make it usable.
GNU General Public License v2.0
834 stars 202 forks source link

pre-fill buffer? #59

Open edfardos opened 10 years ago

edfardos commented 10 years ago

I know the raspberry pi community has been complaining about audio quality with gmrender. In my case it was pops/clicks/garble/stutter. I isolated this to network activity, specifically on the little usb-wifi adapters which are very popular on the pi's. It's not RF, but seems to be USB traffic.

Having said all that, is there a way to pre-fill the gstreamer buffer to minimize network activity? I've been combing the source, but I don't see anything obvious. Even if we could pre-buffer a meg or so, on audio, that'd be no more than four clicks or pops during a song. A configurable parameter would be even better. I think a lot of us would rather deal with lag than constant clicks and pops every time a packet comes in.

curiously, edfardos

edfardos commented 10 years ago

a bit of research:

"output_gstreamer.c" line 366 case GST_MESSAGE_BUFFERING: /* not caring about these right now */ break;

gstreamer buffering docs: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-buffering.html

ixbidie commented 8 years ago

Yes, please add this feature! Even without much network activity there are clicks and lags from time to time which are very annoying and usually require the stream to stop and resume again.

ewtoombs commented 7 years ago

Yeah, like a --gstout-buffer=time in seconds switch. That'd be lit. Wifi is total shit. I'm constantly getting buffer underruns on the rendering end. It doesn't help that pulseaudio-dlna does not handle spotty connections very gracefully.

ewtoombs commented 7 years ago

This is by far the biggest problem with gmrender-resurrect, since wifi makes up like 90% of use cases. Unless most people use gmrender-resurrect over wifi without problems. If that's true, then my own problem might not be with gmrender-resurrect at all. It might be a buffer overflow at the sending end. So, how many people use gmrender-resurrect over wifi?

ewtoombs commented 7 years ago

I fixed the buffering problem. Gstreamer playbin requires the application to pause upon receipt of a GST_MESSAGE_BUFFERING. I did that, along with a couple other minor things. The commits are attached.

0001-Cleaned-up-whitespace.txt 0002-Expanded-gstreamer-logging.txt 0003-Pause-playback-while-buffering.txt