protyposis / LocalAudioBroadcast

Streams local Windows audio playback into a UPnP network
Apache License 2.0
34 stars 3 forks source link

Reduce lag? #5

Closed akaleeroy closed 8 months ago

akaleeroy commented 6 years ago

I use Foobar2000 with the foo_out_upnp component to play audio to my UPnP renderer and it barely has any lag. When using LocalAudioBroadcast there's a delay of a few seconds.

Can this lag be improved? Or is it fundamentally a different kind of situation when streaming from PC's audio? I'm curious because it occurred to me renderer is clearly capable of short lag.

Thanks!

protyposis commented 6 years ago

LocalAudioBroadcast sends the audio data to the renderer as fast as possible (except for a 100ms startup delay) so there is nothing done (e.g. buffering) that might introduce a lag. I noticed though that some UPnP renderers (e.g. Kodi) like to buffer 1 - 2 seconds of audio before rendering it, leading to the lag.

I've basically made the same experience as you with foo_upnp_out but did unfortunately never find out what it does differently to avoid the buffering in the renderer.

akaleeroy commented 6 years ago

Or is it fundamentally a different kind of situation when streaming from PC's audio? I'm curious because it occurred to me renderer is clearly capable of short lag.

I installed MusicBee with the UPnP plugin and found out the following:

output as a continuous stream [enables gapless playback and cross-fading but output will lag and the device will not be able to show current track information]

So I think the lag-free streaming is when you stream a bounded audio file to the device, and the laggy streaming is when the stream is continuous.

protyposis commented 8 months ago

Closing due to repo archival (and because the question is actually answered :)).