How to resample with MPD
|
Posts: 89
Threads: 7
Joined: Mar 2019
Reputation:
15
20-Jun-2019, 11:14 AM
(This post was last modified: 20-Jun-2019, 11:53 AM by mkysimes.)
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
Posts: 2,800
Threads: 180
Joined: Feb 2016
Reputation:
503
Location: Perth, WA
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!!!
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. 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.
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!
Posts: 89
Threads: 7
Joined: Mar 2019
Reputation:
15
Quote:LSR is very very good, unfortunately it's also very very slow and CPU intensive. 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.
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!
Posts: 2,800
Threads: 180
Joined: Feb 2016
Reputation:
503
Location: Perth, WA
(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.
Snakeoil Operating System - Music, your way!
Posts: 89
Threads: 7
Joined: Mar 2019
Reputation:
15
21-Jun-2019, 06:43 PM
(This post was last modified: 21-Jun-2019, 06:51 PM by mkysimes.)
(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.
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.
Posts: 2,800
Threads: 180
Joined: Feb 2016
Reputation:
503
Location: Perth, WA
(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 .
Snakeoil Operating System - Music, your way!
Posts: 89
Threads: 7
Joined: Mar 2019
Reputation:
15
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!
Posts: 57
Threads: 9
Joined: Jan 2021
Reputation:
7
Location: India
(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
Posts: 57
Threads: 9
Joined: Jan 2021
Reputation:
7
Location: India
05-Jul-2023, 12:05 AM
(This post was last modified: 08-Jul-2023, 01:02 PM by vinaymoturi.)
(20-Jun-2019, 11:14 AM)mkysimes Wrote:
unable to apply this settings to MPD 0.23.12. Can anyone help me.
Posts: 89
Threads: 7
Joined: Mar 2019
Reputation:
15
(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.
|
Users browsing this thread: |
1 Guest(s)
|
|
Welcome
|
You have to register before you can post on our site.
|
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.
|
|
|