Thank you for your donation!


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


Sound Tweak Rpi4
#71
(07-22-2020, 02:21 PM)kit1cat Wrote: Just tried this on my pi 3B+ using Kent's mod, tried values of 500 MB and 250 MB but not sure if it's working. RAM usage went from 18% to 23% for both values, was expecting a bigger RAM usage increase.

Make sure your changes in /etc/mpd.conf are not overwritten by Moode itself. Every time you make changes in Moode that file is re-generated by Moode. If your settings are correct then restart the daemon
Code:
sudo systemctl restart mpd


Then the start playing some tracks and you should see the RAM usage for MPD increase for each file you play, until it maxes out somewhere below your set limit.
Reply
#72
(07-22-2020, 02:21 PM)kit1cat Wrote: Just tried this on my pi 3B+ using Kent's mod, tried values of 500 MB and 250 MB but not sure if it's working. RAM usage went from 18% to 23% for both values, was expecting a bigger RAM usage increase.

Yeah, I'm puzzled by what I'm seeing on my RPi3A+ too.

At least two possibilites come to mind:

1) I screwed up. I am the first to admit I'm crap with PHP.
[UPDATE- but my resulting mpd.conf looks okay visually]

2) The MPD parser doesn't grok "MB". I may be crap with PHP, but at least I can read it. I can't even read the C++ sources of MPD. The syntax and semantics is Sanskrit to me. Maybe some C++ aficionado could look through to see how the mpd.conf file gets parsed.

Regards,
Kent
Reply
#73
I'm not sure how the input cache is supposed to work but maybe someone with C++ expertise can go through the MPD sources and try and figure it out https://github.com/MusicPlayerDaemon/MPD...nput/cache
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#74
(07-22-2020, 02:43 PM)Tim Curtis Wrote: I'm not sure how the input cache is supposed to work but maybe someone with C++ expertise can go through the MPD  sources and try and figure it out https://github.com/MusicPlayerDaemon/MPD...nput/cache

Just looked at the code. The size parameter is a maximum, and it allocates as needed up to that value. The config parser recognises MB ok, and it defaults to 256 MB if the size isn't specified in the config file..

Try 1024MB instead of 1GB. Not sure if it needs it as "1 GB" or "1GB". It is case-sensitive.

Phil

Reply
#75
Interesting.

In Manager.cxx there is the TODO comment below but I'm not exactly sure what is meant by "remote" files.

// TODO: allow caching remote files

Obviously streaming sources (http/https radio stations etc) aren't cached cos they are not files but the upmpdcli proxy queues up files with whose path is http://... so I wonder if these files are currently excluded from being cached.

Also, usually files on NAS devices are considered remote so Im wondering whether these are also currently excluded from being cached until the TODO is completed. ??
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#76
(07-22-2020, 03:25 PM)Tim Curtis Wrote: Interesting.

In Manager.cxx there is the TODO comment below but I'm not exactly sure what is meant by "remote" files.

// TODO: allow caching remote files

Obviously streaming sources (http/https radio stations etc) aren't cached cos they are not files but the upmpdcli proxy queues up files with whose path is http://... so I wonder if these files are currently excluded from being cached.

Also, usually files on NAS devices are considered remote so Im wondering whether these are also currently excluded from being cached until the TODO is completed. ??

NAS mounts appear as a standard filesystem path, so should be OK.  MPD isn't doing anything particularly clever there.

Phil

Reply
#77
Thanks @philrandal and @hestehandler

I think my problem was simply a misunderstanding of how the input_cache feature would work. Whatever I was expecting aside, here's what seems to happen.

With input_cache enabled, I load a list of tracks into the queue. When I begin playing a track the mem usage begins to climb, apparently because MPD is loading in the entire track. The mem usage more or less levels off at a higher value. 

Then I begin playing the next track. The mem usage begins climbing again until it more or less levels off at a higher value.

This continues as I play more tracks.

This is contrary to the situation with no input_cache. The mem usage stays more or less constant.

Since this is a 512MB RPi3A+ I'm experimenting on, I chose "128 MB" (also tried "128MB") as the cache value. Unfortunately, such ruses as mpd -V don't tell me whether the input_cache is (or will be) enabled and what the parsed value is. I haven't yet loaded enough tracks to hit the cache size limit.

Regards,
Kent
Reply
#78
Seems to be working ok for me, played some music for about 50 minutes and RAM usage went from 20% to 71%.
Pi 3B+ with 512 MB cache.
Reply
#79
I didn't mean to imply that it wasn't working; only that it doesn't seem to be working the way I expect from the MPD docs:

Quote:The input cache prefetches queued song files before they are going to be played.
  • by prefetching several songs at a time,....

Maybe I'm misreading the tea leaves but "prefetch" suggests to me that the mem usage will start to increase when a track is added to the queue, rather than after I've told MPD to play the track. And how are "several songs" prefetched?

Regards,
Kent
Reply
#80
How is this cache related or integrated with the "Audio buffer" in the MPD config settings?
Reply


Forum Jump: