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

WAV Duration Limit & RF64 Delay #120

Open
Silun opened this issue Feb 27, 2024 · 4 comments
Open

WAV Duration Limit & RF64 Delay #120

Silun opened this issue Feb 27, 2024 · 4 comments

Comments

@Silun
Copy link

Silun commented Feb 27, 2024

Hello! I updated to v1.9.8 today and noticed that my Google Nest Audio speakers stop playing every 2 hours, 4 minutes, and 16 seconds. Sure enough, as I test it with VLC by playing the stream locally, the duration of the stream is exactly 2:04:16. This is probably due to the changes you announced some versions ago to LPCM, WAV, etc. as it matches what I would expect to see if the WAV file is limited to 4GB in total. The current situation is this:

The only format that plays nicely with the Google Nest Audios is WAV:

  • On WAV/16/48, it lasts about 6 hours with a delay of ~4 seconds.
  • On WAV/24/96, it lasts about 2 hours with a delay of <1 second.
  • RF64 plays, it lasts about 3 hours, but has a truly massive delay on the order of ~10 seconds.
  • LPCM straight up won't play any more.
  • FLAC plays, but with a host of issues.

I am using WAV/24/96 to keep the delay to a minimum, but the time limit is quite noticeable when you resume playing many times a day. Since I just tell my speakers to play the stream, essentially what you call internet radio mode, there is no decent way to automatically resume (certainly no seamless way that I know of).

I do not know whether Nest Audios just don't handle RF64 right or what else would cause that extreme delay and 3 hour limit. It might be noteworthy that RF64/24/96 lasts 3h, 6m, 28s which is almost exactly 50% longer than WAV/24/96 to the second (~4 s difference) so maybe there is something going on inside swyh-rs that causes this?

Long story short:
Is there any way for me to make the WAV stream be infinite duration (or at least very, very long) in the settings? I assume that everybody who is using internet radio mode will run into the same situation.

@dheijl
Copy link
Owner

dheijl commented Feb 27, 2024

What has changed is the http content-length header value, to accomodate some other speakers.
I could make it configurable in the config file, a value for each format, allowing you to experiment with it.
Previously IIRC it was u64::max and I had to change it to i64::max and i32::max for these speakers.
You could then compute the value based on bytes per sample, sample rate, number of channels (always 2 here) and the desired duration and insert that value in the config file.
What do you think?
I suppose that the Nest only accepts u64::max as an indication for a never ending stream because that is also what the RF64 header does.

@Silun
Copy link
Author

Silun commented Feb 27, 2024

Sure, that sounds reasonable!

dheijl added a commit that referenced this issue Feb 28, 2024
@dheijl
Copy link
Owner

dheijl commented Feb 28, 2024

Can you try the new RC1 prerelease?

@dheijl
Copy link
Owner

dheijl commented Feb 29, 2024

I released 1.9.9, most combinations of format/streamsize work OK here with my Moode players, at least 2 streamsizes work for every format.

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