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

IO-less playback of current file #603

JustArchi opened this issue Jul 11, 2019 · 0 comments


None yet
2 participants
Copy link

commented Jul 11, 2019

Question/Feature request

I have rather specific usage case that I'd like MPD to work with. In particular, I'd like to be able to modify the currently played file on-the-fly, without interrupting MPD's playback. This could be needed for various reasons, including unstable network shares, exclusive file acccess, or like in my case, metadata modifications that change the size (and therefore exact place of the audio stream, stopping the playback).

Right now for achieving that I'm using huge audio_buffer_size hack, but that solution is very suboptimal as MPD needs to keep memory equal to that size always allocated, even if the file itself is much smaller, not to mention that it can still not be enough depending on circumstances (the limit is around 131 MB).

I've noticed recent work on input_cache and it looks like it'd almost entirely satisfy me, as long as it's possible to slightly tweak it: instead of accepting maximum cache size, I'd like to be able to specify maximum number of songs that are supposed to be cached in advance, with 1 being the current one.

This is how I see it:

input_cache {
        size "256 MB"

^ MPD allocates static 256 MB and makes use of it entirely to fill as much data as possible. This is currently implemented to the best of my knowledge.

input_cache {
        count "1"

^ My target scenario, MPD reads up to count files in advance (with 1 specifying current song, so 2 would be current + next etc), and keeps read files in memory until song change (on which the cache advances and next song is read). It'd be the best if MPD could dynamically adapt memory usage to the size of the file, so small files would not put as much pressure on the process, while big ones could still benefit from it.

input_cache {
        count "1"
        size "256 MB"

^ Like above, but MPD will never allow the size to grow past specified size, which effectively limits extra memory usage to value specified by the user (as opposed to above config, which doesn't put any limit on it).

Let me know what you think, I'd be happy to further evaluate if needed, and I consider this a very good idea for at least several different scenarios. The above is only my suggestion what could be done in regards to that, I'll be happy with any solution that would allow me to configure MPD in order to read currently played file in full. Thank you in advance for your evaluation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.