02-16-2021, 04:25 PM
I've been playing with the MPD input cache feature simply because my RPi was cruising along with about 10% memory used and I thought I might as well make use of the spare capacity. Reading the entry for the cache in the MPD User's Manual I would expect that when I hit play on a playlist, the whole list would be pre-fetched into memory, up to the limit of the cache size I selected. The 2GB I have at hand would mean I could easily have entire albums loaded into memory.
If the cache is working as described by the MPD manual, I'd expect to see memory use jump a large amount at the start of playback, then remain constant as tracks play. What I actually observe however is that the memory increments a small amount at the commencement of each track. It looks for all the world as if tracks are still read from disc at the start of each track and loaded into the memory and then simply remain there after they have been played. No 'pre-fetching' seems to be happening. I can't see any benefit to this behaviour.
Do other folk observe the same as me? Have I misunderstood what this is supposed to do? Is the behaviour without the input cache actually reading the source file as continuous stream, meaning the cache is only really need to be just larger than the largest file one has?
This is purely a question for my own education, I don't have a problem that needs solving. I just wish to understand better how this little player actually works.
If the cache is working as described by the MPD manual, I'd expect to see memory use jump a large amount at the start of playback, then remain constant as tracks play. What I actually observe however is that the memory increments a small amount at the commencement of each track. It looks for all the world as if tracks are still read from disc at the start of each track and loaded into the memory and then simply remain there after they have been played. No 'pre-fetching' seems to be happening. I can't see any benefit to this behaviour.
Do other folk observe the same as me? Have I misunderstood what this is supposed to do? Is the behaviour without the input cache actually reading the source file as continuous stream, meaning the cache is only really need to be just larger than the largest file one has?
This is purely a question for my own education, I don't have a problem that needs solving. I just wish to understand better how this little player actually works.
----------------
Robert
Robert