Thank you for your donation!


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


Sound Tweak Rpi4
#61
DRONE7 wrote:
Quote:Currently I'm using XMOS USB to i2s to hardware resampler (everything is resampled to DSD256) and an ES9028 DAC and I've just replaced the pwr xformer to the XMOS with a USB battery bank (Major xformer death causing this) so I have many variables to assimilate and compare.



Do you have any recommendations for a decent budget hardware resampler? You posted on this one in diyAudio in 2018 
Raspi-4137 Raspberry Pi Digital Network Player Supports 32bit 384K DSD256 | eBay  Looks interesting, but not sure if I can use it with my current USB DAC.
Reply
#62
(07-21-2020, 03:17 AM)DRONE7 Wrote:
(07-21-2020, 01:35 AM)Tim Curtis Wrote: You can try it out yourself with 0.22~git (wait till it rebuilds the database after switching to it)

sudo nano /etc/mpd.conf

add this input block

input_cache {
   size "1 GB"
}

then sudo systemctl restart mpd

I've been using 0.22~git as default anyway so no regen needed.

Currently I'm using XMOS USB to i2s to hardware resampler (everything is resampled to DSD256) and an ES9028 DAC and I've just replaced the pwr xformer to the XMOS with a USB battery bank (Major xformer death causing this) so I have many variables to assimilate and compare.
  Hi, it sounds good with this cache added it to 0.22 -git.
Reply
#63
(07-21-2020, 02:51 PM)hifinet Wrote: DRONE7 wrote:
Quote:Currently I'm using XMOS USB to i2s to hardware resampler (everything is resampled to DSD256) and an ES9028 DAC and I've just replaced the pwr xformer to the XMOS with a USB battery bank (Major xformer death causing this) so I have many variables to assimilate and compare.



Do you have any recommendations for a decent budget hardware resampler? You posted on this one in diyAudio in 2018 
Raspi-4137 Raspberry Pi Digital Network Player Supports 32bit 384K DSD256 | eBay  Looks interesting, but not sure if I can use it with my current USB DAC.

Unless you can access the i2s lines within your USB DAC I doubt you could use these two re-samplers.
----------
bob
Reply
#64
(07-21-2020, 01:35 AM)Tim Curtis Wrote: You can try it out yourself with 0.22~git (wait till it rebuilds the database after switching to it)

sudo nano /etc/mpd.conf

add this input block

input_cache {
   size "1 GB"
}

then sudo systemctl restart mpd

Smile   How to make it stick ?  mpd.conf is overwritten at boot Wink 

Bob.
----------
bob
Reply
#65
@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?
Reply
#66
The value is prolly something that should be auto-calculated depending on the memory specs. In the Pi family we have .5, 1, 2, 4, and 8GB. Maybe something like 25% with a max of 512MB ??

Assuming 30 MB avg for the size of FLAC encoded track (Popular music)

512 MB -> 128 MB -> 4 tracks
1 GB -> 256 MB -> 8 tracks
2 GB -> 512 MB -> 16 tracks
4 GB -> 512 MB -> 16 tracks
8 GB -> 512 MB -> 16 tracks

Alternatively it could be an option in MPD Config that has a range of values up to 50% of RAM.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#67
(07-22-2020, 01:03 PM)Tim Curtis Wrote: The value is prolly something that should be auto-calculated depending on the memory specs. In the Pi family we have .5, 1, 2, 4, and 8GB. Maybe something like 25% with a max of 512MB ??

Assuming 30 MB avg for the size of FLAC encoded track (Popular music)

512 MB -> 128 MB -> 4 tracks
1 GB -> 256 MB -> 8 tracks
2 GB -> 512 MB -> 16 tracks
4 GB -> 512 MB -> 16 tracks
8 GB -> 512 MB -> 16 tracks

Alternatively it could be an option in MPD Config that has a range of values up to 50% of RAM.

I have the 4GB Pi 4, and have been running the 0.22~ with 3GB of cache 24 hours of the day (as a test). So far no problems. The one GB RAM left over is plenty for everything else running on the Pi. By-the-by I’m also running it with two cores reserved exclusively for MPD, and that also seems to be running without problems. Also now running it on the 64-bit kernel, and that too is now running without problems (incl. updating the MPD database).
Reply
#68
Thats cool. What does moodeutl -m show for RAM_USED?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#69
(07-22-2020, 01:12 PM)Tim Curtis Wrote: Thats cool. What does moodeutl -m show for RAM_USED?

CPU: 1.5 GHz | LOAD: 1% | TEMP: 53�C | RAM_USED: 77% | DISK_USED: 20% | DISK_FREE: 11G | FPM_POOL: 5 workers

[Image: 7QYjgiw.png]
Reply
#70
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.
Reply


Forum Jump: