How to resample with MPD
#1
For those who are unaware of MPD's ability to resample, this is for you. What you will get is tighter imaging (better focus) and smoother sound on those recordings that are less than stellar. In some cases, on my system at least, it can make it sound similar to an analog filter. Unfortunately, as with most resampling, there will probably be a slight loss in detail especially on very revealing systems.

There are two quality resamplers that I am aware of in MPD. From my understanding, and I could be wrong, resampling is only available on versions .20 and up but please let me know if that's not the case so I can correct this. Those two resamplers are SoX and SRC (Secret Rabbit Code), otherwise known as libsamplerate.

One way to use these is to make sure you are using MPD (.20 and up) in Snakeoil and check the box for "custom audio output". Then just copy and paste one of the configs below depending on which one you want to use. You will have to substitute your sound device unless you use the same one as me (snd_allo_digione).

libsamplerate:
Code:
resampler {
plugin "libsamplerate"
type "1"
}

audio_output {
name "snd_allo_digione"
type "alsa"
device "hw:0,0"
format "192000:24:2"
auto_resample "no"
auto_format "no"
enabled "yes"
}

SoX:
Code:
resampler {
plugin "soxr"
quality "very high"
threads "0"
}

audio_output {
name "snd_allo_digione"
type "alsa"
device "hw:0,0"
format "192000:24:2"
auto_resample "no"
auto_format "no"
enabled "yes"
}

This will get you started. I'm sure there are other options for both of these. As a matter of fact, I know for sure that the quality of libsamplerate can be set to "0" (type "0") for even better sound but unfortunately for me the Rpi that I use is too slow to accommodate. 

Also, obviously if your gear is unable to sample at 192K then you'll have to change that. 

On my system, the libsamplerate sounds the best, even though I can't go full quality on it. It seems to retain more detail and really helps locate sounds in the stage. SoX seems to be a little bit beefier in the bass and maybe even smoother on the highs but tends to remove some "reality" to the recording much like the difference between MPD and LMS. But that could be specific to my setup. Ultimately it's up to the individual's preference.

Enjoy, and if you have any questions this link is a good place to start:
https://www.musicpd.org/doc/html/plugins...er-plugins
[-] The following 1 user Likes mkysimes's post:
  • Snoopy8
Reply

#2
Was just about to ask which resampling library you prefer, then I read this:

(20-Jun-2019, 11:14 AM)mkysimes Wrote: On my system, the libsamplerate sounds the best, even though I can't go full quality on it. It seems to retain more detail and really helps locate sounds in the stage. SoX seems to be a little bit beefier in the bass and maybe even smoother on the highs but tends to remove some "reality" to the recording much like the difference between MPD and LMS. But that could be specific to my setup. Ultimately it's up to the individual's preference.
Absolutely agree 100% with this!!! Angel 1

Tracks resampled with SRC don't lose the clarity whereas SoX will 'blur' the sound stage (adds a layer of blur to the sound stage). If your system is good at sound localisation (pin point accuracy), then the differences with LSR and SoX can be easier to differientiate.

LSR is very very good, unfortunately it's also very very slow and CPU intensive. Sad This library requires a relatively fast CPU - Celerons and Atoms can't do this well.

Ever since I moved to a Atom PC I've stopped using this, and this post reminded me just how good SRC is. Heart

Back with MPD v17, this was the old way of doing things. There are other resampling libs one can use if not wrong, but I can't find the details of that atm (things might have changed now).

Great job on this walkthrough.
Snakeoil Operating System - Music, your way!
Reply

#3
Quote:LSR is very very good, unfortunately it's also very very slow and CPU intensive. Sad This library requires a relatively fast CPU - Celerons and Atoms can't do this well.

Ever since I moved to a Atom PC I've stopped using this, and this post reminded me just how good SRC is. Heart
 
Hah, funny you should say this. I was just going to ask how well the atom processor handles resampling. I love the way the RPi/digione combo sounds but it falls way short in the processing department. 

I would ultimately love to hear what libsamplerate sounds like in all its glory but it's definately an audio slideshow with the Pi. With LMS I am able to offload all the processing to a separate, more powerful PC and when fully maxed out, the Sox processing on LMS seems to sound better than that on MPD but it still sounds a bit dull compared to SRC on MPD. 

For now, until RPi gets more powerful or there is a more cost effective way to get that level of sound I guess I'm stuck with what I got.....and I'm certainly not complaining!
Reply

#4
(21-Jun-2019, 08:54 AM)mkysimes Wrote: Hah, funny you should say this. I was just going to ask how well the atom processor handles resampling. I love the way the RPi/digione combo sounds but it falls way short in the processing department. 
It'll work in general. But there are times when audio will start skipping. e.g. when scanning the music DB.

(21-Jun-2019, 08:54 AM)mkysimes Wrote: I would ultimately love to hear what libsamplerate sounds like in all its glory but it's definately an audio slideshow with the Pi. With LMS I am able to offload all the processing to a separate, more powerful PC and when fully maxed out, the Sox processing on LMS seems to sound better than that on MPD but it still sounds a bit dull compared to SRC on MPD. 

For now, until RPi gets more powerful or there is a more cost effective way to get that level of sound I guess I'm stuck with what I got.....and I'm certainly not complaining!
It depends on user preferences I think. There's a pro and con to every tweak. With upsampling in general, the pros in my setup is better bass response, improvement in clarity (SRC), better pin point precision.

The downside, OTOH, is the "rawness" of the voice is gone. Not sure how to explain this, but to me when music is upsampled, with some recordings, the music becomes like a recording, instead of a real live performance. This isn't necessary a bad thing, but since my Atom can't keep up, I just disabled it and havn't really looked into this since.

Last few years, upsampling is picking up moementum again (it's a feature a lot has been asking for), and walkthroughs like this will definitely help people set up this system for this. Thumbs Up
Snakeoil Operating System - Music, your way!
Reply

#5
(21-Jun-2019, 10:52 AM)agent_kith Wrote:
(21-Jun-2019, 08:54 AM)mkysimes Wrote: Hah, funny you should say this. I was just going to ask how well the atom processor handles resampling. I love the way the RPi/digione combo sounds but it falls way short in the processing department. 
It'll work in general. But there are times when audio will start skipping. e.g. when scanning the music DB.

(21-Jun-2019, 08:54 AM)mkysimes Wrote: I would ultimately love to hear what libsamplerate sounds like in all its glory but it's definately an audio slideshow with the Pi. With LMS I am able to offload all the processing to a separate, more powerful PC and when fully maxed out, the Sox processing on LMS seems to sound better than that on MPD but it still sounds a bit dull compared to SRC on MPD. 

For now, until RPi gets more powerful or there is a more cost effective way to get that level of sound I guess I'm stuck with what I got.....and I'm certainly not complaining!
It depends on user preferences I think. There's a pro and con to every tweak. With upsampling in general, the pros in my setup is better bass response, improvement in clarity (SRC), better pin point precision.

The downside, OTOH, is the "rawness" of the voice is gone. Not sure how to explain this, but to me when music is upsampled, with some recordings, the music becomes like a recording, instead of a real live performance. This isn't necessary a bad thing, but since my Atom can't keep up, I just disabled it and havn't really looked into this since.

Last few years, upsampling is picking up moementum again (it's a feature a lot has been asking for), and walkthroughs like this will definitely help people set up this system for this. Thumbs Up

I agree wholeheartedly and know EXACTLY what you're talking about when you mention the "rawness" of a voice or that some recordings sound too much like a..well...recording. On recordings that have great depth and lots of ambience it seems some of that "live" character gets lost when resampling. Unfortunately for me I don't have a library of flac files to access (maybe i should start ripping some cds) as i use Tidal exclusively just out of pure laziness.

On alot of the finer recordings it definately does no justice to resample as you lose some of the character of the music. I couldn't have said it better myself...you described it perfectly. Slightly fuller bass and more pinpoint imaging, but there is that sacrifice of finer detail. I guess in this day and age of mp3s and bad cd rips resampling has indeed made a comeback because of its ability to smooth out some of the rough stuff and make crappy recordings easier to listen to on systems that tend to be picky about recordings. Man I miss the analog days...lol. Except for the hiss and crackles. I don't miss that so much.
Reply

#6
(21-Jun-2019, 06:43 PM)mkysimes Wrote: I agree wholeheartedly and know EXACTLY what you're talking about when you mention the "rawness" of a voice or that some recordings sound too much like a..well...recording. On recordings that have great depth and lots of ambience it seems some of that "live" character gets lost when resampling. Unfortunately for me I don't have a library of flac files to access (maybe i should start ripping some cds) as i use Tidal exclusively just out of pure laziness.
I have a lot of CDs. Not crazy many, but enough for me to last a while. As such I have not explored the likes of Tidal and Spotify yet.

(21-Jun-2019, 06:43 PM)mkysimes Wrote: On alot of the finer recordings it definately does no justice to resample as you lose some of the character of the music. I couldn't have said it better myself...you described it perfectly. Slightly fuller bass and more pinpoint imaging, but there is that sacrifice of finer detail. I guess in this day and age of mp3s and bad cd rips resampling has indeed made a comeback because of its ability to smooth out some of the rough stuff and make crappy recordings easier to listen to on systems that tend to be picky about recordings. Man I miss the analog days...lol. Except for the hiss and crackles. I don't miss that so much.
It's the old "pick your poison" chestnut. Kind of what makes this hobby a lot of fun, as there is no universal solution that will suit every one. I am very happy to be able to come up with this Snakeoil OS to allow everybody to tailor their system exactly the way they want it.

It seemed like a crazy idea when first conceived, but to see so many acceptinig this philosophy, I am indeed honoured Thanks .
Snakeoil Operating System - Music, your way!
Reply

#7
Well, I for one am very grateful for gurus such as yourself who put your time into creating software that allows us to pick and choose how we want the music to sound on any given day. I've always been a bit of a tweaker and Snakeoil is just so easy to use and perfectly laid out. Once again, thanks for sharing this incredible solution!
[-] The following 1 user Likes mkysimes's post:
  • agent_kith
Reply

#8
(20-Jun-2019, 11:14 AM)mkysimes Wrote: For those who are unaware of MPD's ability to resample, this is for you. What you will get is tighter imaging (better focus) and smoother sound on those recordings that are less than stellar. In some cases, on my system at least, it can make it sound similar to an analog filter. Unfortunately, as with most resampling, there will probably be a slight loss in detail especially on very revealing systems.

There are two quality resamplers that I am aware of in MPD. From my understanding, and I could be wrong, resampling is only available on versions .20 and up but please let me know if that's not the case so I can correct this. Those two resamplers are SoX and SRC (Secret Rabbit Code), otherwise known as libsamplerate.

One way to use these is to make sure you are using MPD (.20 and up) in Snakeoil and check the box for "custom audio output". Then just copy and paste one of the configs below depending on which one you want to use. You will have to substitute your sound device unless you use the same one as me (snd_allo_digione).

libsamplerate:
Code:
resampler {
plugin "libsamplerate"
type "1"
}

audio_output {
name "snd_allo_digione"
type "alsa"
device "hw:0,0"
format "192000:24:2"
auto_resample "no"
auto_format "no"
enabled "yes"
}

SoX:
Code:
resampler {
plugin "soxr"
quality "very high"
threads "0"
}

audio_output {
name "snd_allo_digione"
type "alsa"
device "hw:0,0"
format "192000:24:2"
auto_resample "no"
auto_format "no"
enabled "yes"
}

This will get you started. I'm sure there are other options for both of these. As a matter of fact, I know for sure that the quality of libsamplerate can be set to "0" (type "0") for even better sound but unfortunately for me the Rpi that I use is too slow to accommodate. 

Also, obviously if your gear is unable to sample at 192K then you'll have to change that. 

On my system, the libsamplerate sounds the best, even though I can't go full quality on it. It seems to retain more detail and really helps locate sounds in the stage. SoX seems to be a little bit beefier in the bass and maybe even smoother on the highs but tends to remove some "reality" to the recording much like the difference between MPD and LMS. But that could be specific to my setup. Ultimately it's up to the individual's preference.

Enjoy, and if you have any questions this link is a good place to start:
https://www.musicpd.org/doc/html/plugins...er-plugins

how to do this, i am new to linux
Reply

#9
(20-Jun-2019, 11:14 AM)mkysimes Wrote:  

unable to apply this settings to MPD 0.23.12.  Can anyone help me.
Reply

#10
(27-Jan-2021, 08:37 PM)vinaymoturi Wrote:
(20-Jun-2019, 11:14 AM)mkysimes Wrote: For those who are unaware of MPD's ability to resample, this is for you. What you will get is tighter imaging (better focus) and smoother sound on those recordings that are less than stellar. In some cases, on my system at least, it can make it sound similar to an analog filter. Unfortunately, as with most resampling, there will probably be a slight loss in detail especially on very revealing systems.

There are two quality resamplers that I am aware of in MPD. From my understanding, and I could be wrong, resampling is only available on versions .20 and up but please let me know if that's not the case so I can correct this. Those two resamplers are SoX and SRC (Secret Rabbit Code), otherwise known as libsamplerate.

One way to use these is to make sure you are using MPD (.20 and up) in Snakeoil and check the box for "custom audio output". Then just copy and paste one of the configs below depending on which one you want to use. You will have to substitute your sound device unless you use the same one as me (snd_allo_digione).

libsamplerate:
 
Code:
resampler {
plugin "libsamplerate"
type "1"
}

audio_output {
name "snd_allo_digione"
type "alsa"
device "hw:0,0"
format "192000:24:2"
auto_resample "no"
auto_format "no"
enabled "yes"
}

SoX:
 
Code:
resampler {
plugin "soxr"
quality "very high"
threads "0"
}

audio_output {
name "snd_allo_digione"
type "alsa"
device "hw:0,0"
format "192000:24:2"
auto_resample "no"
auto_format "no"
enabled "yes"
}

This will get you started. I'm sure there are other options for both of these. As a matter of fact, I know for sure that the quality of libsamplerate can be set to "0" (type "0") for even better sound but unfortunately for me the Rpi that I use is too slow to accommodate. 

Also, obviously if your gear is unable to sample at 192K then you'll have to change that. 

On my system, the libsamplerate sounds the best, even though I can't go full quality on it. It seems to retain more detail and really helps locate sounds in the stage. SoX seems to be a little bit beefier in the bass and maybe even smoother on the highs but tends to remove some "reality" to the recording much like the difference between MPD and LMS. But that could be specific to my setup. Ultimately it's up to the individual's preference.

Enjoy, and if you have any questions this link is a good place to start:
https://www.musicpd.org/doc/html/plugins...er-plugins

how to do this, i am new to linux

It's been a while since I posted this mini tutorial. At the time I was working with the 1.1 variant of Snakeoil OS. Haven't been able to do this on 1.2 variants. Not sure why. Sorry, maybe others have gotten it to work on more recent versions.
[-] The following 1 user Likes mkysimes's post:
  • vinaymoturi
Reply



Bookmarks



Users browsing this thread:
1 Guest(s)

[-]
Our Sponsors

[-]
Welcome
You have to register before you can post on our site.

Username/Email:


Password:





[-]
Latest Threads
ZimaBoard 2x NIC, 2x SATA, 2x USB, 1x PC...
Last Post: agent_kith
26-Mar-2024 12:04 PM
» Replies: 13
» Views: 626
LMS Upgrade ?
Last Post: uglymusic
15-Mar-2024 09:14 PM
» Replies: 7
» Views: 149
Squeezebox shutdown
Last Post: TripleX
13-Mar-2024 07:34 AM
» Replies: 4
» Views: 71
MP3 Not Playing
Last Post: Coacharnold
10-Mar-2024 10:25 AM
» Replies: 3
» Views: 52
Fail to install myMPD
Last Post: hkphantomgtr
03-Mar-2024 08:45 PM
» Replies: 9
» Views: 195
Intel HFI Driver Can "Save Tons Of CPU C...
Last Post: hkphantomgtr
28-Feb-2024 09:15 PM
» Replies: 0
» Views: 41
Announcing Snakeoil Measurements 1.3.0
Last Post: agent_kith
26-Feb-2024 10:02 PM
» Replies: 94
» Views: 4150
More Problems with Squeezelite in 1.3
Last Post: Coacharnold
17-Feb-2024 09:47 PM
» Replies: 2
» Views: 69
Snakeoil Music server & Snakeoil its own...
Last Post: Snoopy8
17-Feb-2024 11:20 AM
» Replies: 8
» Views: 366
RoonBridge (64 bit only)
Last Post: scrarfussi
15-Feb-2024 08:26 PM
» Replies: 3
» Views: 4126

[-]
SnakeoilOS Mission Statement

Our mission is to create a free to use computer OS that is easy to install, intuitive to operate and play music that will connect and engage with you emotionally.

SnakeoilOS gives you the freedom to spend more time on listening, enjoying and exploring music. Wasting time on computers is now a thing of the past! Everything is constantly evolving/improving. Please check back often for updates.

If you like this project, do show your support with a small token donation. All donations collected will be used to run this website, and for purchasing new equipment for the project.


Powered By MyBB, © 2002-2024. Theme © Melroy van den Berg.