mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #1231] Configurable MINIMUN_DOWNLOAD_SIZE / audio fetch parameters #563
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#563
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lelloman on GitHub (Dec 11, 2023).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1231
I'm manually changing MINIMUM_DOWNLOAD_SIZE and DOWNLOAD_TIMEOUT values in audio/src/fetch/mod.rs, this is because I noticed that the server was shutting the transmission if the pre-fetch was a bit too aggressive. Tuning MINIMUM_DOWNLOAD_SIZE, in the source code, solved the issue.
I think it would be beneficial if the constants in fetch/mod.rs could be configurable, something like a static configuration struct.
The gist of the change would be:
If the feature seems acceptable, I'd be happy to open a PR and eventually iterate on the implementation there.
@kingosticks commented on GitHub (Dec 11, 2023):
Can you add a bit more detail in case anyone else runs into this? What librespot error messages did you see? Is this for music or podcasts? What values did you have to use? Maybe we should also adjust the defaults.
@lelloman commented on GitHub (Dec 11, 2023):
I'm reading AudioFile directly, feeding the audio to my own player, and
readwould returnAudioFileError::WaitTimeoutafter a while, content is always music. WithMINIMUM_DOWNLOAD_SIZE: usize = 48 * 1024;I don't get the error anymore, but the network transfer speed is a bit lower (from ~1200 to ~750 Kb/s). I'm not really sure that changing the defaults is really needed as my usecase is somewhat convoluted, although still very educational.I think that giving the possibility to tune those parameters at runtime would already be a nice improvement, one could experiment with those parameters to see what gives the best user experience, and if a usecase arises that needs tuning, no need to compile from source.
@roderickvd commented on GitHub (Dec 15, 2023):
I think it can be useful. I have no idea how well the current default will work for, I don’t know, cell phones in the jungle or satlink to the space station. Kidding aside, I see there can be edges cases that someone would want to tune.
On the defaults I want to add: in v0.5 I rewrote huge parts of it and there was little feedback on it. Could very well be that the defaults should be improved, I don’t know.