Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

very high latency streaming to WiiM #124

Open
shuffle2 opened this issue Mar 13, 2024 · 5 comments
Open

very high latency streaming to WiiM #124

shuffle2 opened this issue Mar 13, 2024 · 5 comments

Comments

@shuffle2
Copy link

I'm on Windows, streaming to "WiiM Amp" device.
The delay between audio on speakers connected to the windows computer and speakers on WiiM is 4-6 seconds, which seems extreme.

Do you happen to know if this is a known issue with WiiM Amp? or is something else going on?

I've tried pretty much all combination of settings available from swyh-rs

@dheijl
Copy link
Owner

dheijl commented Mar 13, 2024

These are the things that affect latency:

  • the minimum latency under optimal conditions seems to be around 250 msecs
  • a good ethernet connection will normally have lower latency than wifi
  • the buffer size in the receiver determines the minimum latency. The bigger the buffer, the larger the latency, but also the smaller the chance that you'll suffer from stutter or drop-outs in the audio.
  • the streaming protocol also is responsible for some latency. From best to worst:
    • lpcm
    • wav/rf64
    • flac
  • finally a higher bit depth (24 bit vs 16) and a higher sampling rate (176/192 khz vs 44/48 khz) will fill the buffer of the receiver much faster resulting in a lower latency.

I did not find any reference to a configurable buffer size for your WiiM Amp in the documentation, so there is probably not much you can do.

@shuffle2
Copy link
Author

fwiw, I did try with some foobar2k plugins and the latency went down to 2-3 seconds with https://www.foobar2000.org/components/view/foo_out_upnp , however it was still 4-6 seconds with https://www.foobar2000.org/components/view/foo_upnp
But yea, seems some delay is still imposed by the renderer.

@dheijl
Copy link
Owner

dheijl commented Mar 14, 2024

Can you point me to the source code of foo_out_upnp? Perhaps it would show me where I can shave off some time.
As an alternative a Wireshark sniffer trace of a foo_out_upnp session with the 2-3 seconds delay could be helpful.

@shuffle2
Copy link
Author

shuffle2 commented Mar 14, 2024

I doubt the source is available. That plugin appears to set the dlna renderer as the only output of foobar2k, as opposed to operating on the output of foobar2k, so my guess is the overhead that's getting removed is somewhere in the windows audio stack, but i haven't really looked into it.
I can sniff the traffic

@dheijl
Copy link
Owner

dheijl commented Mar 14, 2024

I can sniff the traffic

That would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants