Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Sound Tweak Rpi4
#81
They are separate from one another and serve different purposes. The audio buffer queues up decoded PCM samples for delivery to the audio device. The input buffer queues up whole un-decoded files into a buffer cache.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#82
I agree with you Kent, it’s not the way I thought it would work.
Reply
#83
(07-22-2020, 08:01 PM)kit1cat Wrote: I agree with you Kent, it’s not the way I thought it would work.

It can't cache the whole playlist in advance because it could end up purging stuff from the cache before it has been played. I haven't had the time to pull the mpd git repo and grep it to see where the cache methods are being called from. I couldn't find it with a brief look.

Phil

Reply
#84
Right, it's not as simple as it would seem. The other question it begs is whether it's effective when either MPD random play or auto-shuffle random play are active. Auto-shuffle in particular is only adding 2 tracks to the Playlist.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#85
It definitely ain't broke as is. Very much enjoying the sound over here. Playing through my entire Mercury Living Presence collection. Tended to avoid many of the titles previously. They sound great with MPD 0.22 . My system has never sounded better.  Smile
Reply
#86
@philrandal

I don't disagree with what you said but I was strongly influenced by the documentation language such as "The input cache prefetches queued song files before they are going to be played", "by prefetching several songs at a time..." and "bulk transfers may be faster and more energy efficient than loading small chunks on-the-fly".

I don't think the docs make sense now that I've reread the section and I'll be interested to hear what you make of the code itself.

Practically, I don't notice any particular advantage to the cache when, for example, I play three consecutive tracks in the queue one after the other and then jump back to the first. I'd expect the first track to start quicker because it's still cached. I believe it is because the mem usage kept growing with each track. Didn't notice an improvement.

This suggests to me the cache need not be very big if size confers no advantage.

I can't help also but wonder what and how good the garbage collection routine is ("If the cache grows larger than that, older files will be evicted.")

Somehow a circular buffer would seem like a desirable solution.

Regards,
Kent
Reply
#87
I often get problems with my WiFi, signal breakup etc. Hoping this input cache could solve the problem, similar to how the buffer works for streaming video.
Reply
#88
(07-22-2020, 10:23 PM)kit1cat Wrote: I often get problems with my WiFi, signal breakup etc. Hoping this input cache could solve the problem, similar to how the buffer works for streaming video.

If WiFi signal strength is the problem, try 5G Hz band. The reason is that the very short RPi onboard antenna is not good for 2.4G WiFi. Another work around is to use HomePlug Ethernet bridge.
Reply
#89
(07-22-2020, 10:59 PM)efung Wrote:
(07-22-2020, 10:23 PM)kit1cat Wrote: I often get problems with my WiFi, signal breakup etc. Hoping this input cache could solve the problem, similar to how the buffer works for streaming video.

If WiFi signal strength is the problem, try 5G Hz band. The reason is that the very short RPi onboard antenna is not good for 2.4G WiFi. Another work around is to use HomePlug Ethernet bridge.

Thanks for your suggestions, I use a USB wifi adaptor on the end of a extension lead (pi in metal case). I have a very good signal strength, I think the problem is more about speed, I have re positioned by wifi extender (using ipad to check speed) and I hope that has helped with the problem.
Reply
#90
(07-22-2020, 10:50 AM)TheOldPresbyope Wrote: @DRONE7

You'll have to edit /var/www/inc/playerlib.php.

Here's a snippet of function UpdMpdConf

Code:
       // Input                            <<< this is line 1674 more or less
       $data .= "max_connections \"128\"\n";
       $data .= "\n";
       $data .= "decoder {\n";
       $data .= "plugin \"ffmpeg\"\n";
       $data .= "enabled \"yes\"\n";
       $data .= "}\n\n";
       $data .= "input {\n";
       $data .= "plugin \"curl\"\n";
       $data .= "}\n\n";

       // Resampler
       $data .= "resampler {\n";
       $data .= "plugin \"soxr\"\n";
       $data .= "quality \"" . $samplerate_converter . "\"\n";
       $data .= "threads \"" . $sox_multithreading . "\"\n";
       $data .= "}\n\n";

I inserted a new Input Cache stanza so that this snippet reads

Code:
       // Input
       $data .= "max_connections \"128\"\n";
       $data .= "\n";
       $data .= "decoder {\n";
       $data .= "plugin \"ffmpeg\"\n";
       $data .= "enabled \"yes\"\n";
       $data .= "}\n\n";
       $data .= "input {\n";
       $data .= "plugin \"curl\"\n";
       $data .= "}\n\n";

       // Input Cache
       $data .= "input_cache {\n";
       $data .= "size \"1 GB\"\n";
       $data .= "}\n\n";

       // Resampler
       $data .= "resampler {\n";
       $data .= "plugin \"soxr\"\n";
       $data .= "quality \"" . $samplerate_converter . "\"\n";
       $data .= "threads \"" . $sox_multithreading . "\"\n";
       $data .= "}\n\n";


I stuck them there out of a perverse sense of style but I suppose they could have preceded the decoder and input stanzas.

Regards,
Kent

PS - I'm unsure what the max cache value should be for 512MB RPis. Memory usage in normal operation suggests there's at least 128MB free but maybe less than 200 MB. Anyone have any thoughts?
 Yes...odder than an odd thing. if you know your Blackadder...

Reboots and reloads of updates seem to play havoc with the settings.

Sometimes it is clean and with wonderful diction...next it's heavily bass thumping.... Sad

https://www.prestomusic.com/classical/pr...world-wags

Bob
----------
bob
Reply


Forum Jump: