Syntax for resampler?

Need help with MPD?
Post Reply
conta
Posts: 100
Joined: October 31st, 2013, 4:59 pm

Syntax for resampler?

Post by conta »

Just a short question:
Does somebody know the correct syntax for the resampler-plugins in mpd.conf?
I tried to integrate soxr with:

resampler {
plugin "soxr"
quality "high"
}


like it is written in the documentation, but that does not work. With this lines MPD does not start any more...
Then i found the syntax

samplerate_converter "soxr high"

somewhere in the net and that works.
But i did not find a way to integrate soxr with multithreading enabled.
So, is there somebody who know the working syntax for that?

max
Forum team
Posts: 1128
Joined: January 15th, 2013, 3:43 pm

Re: Syntax for resampler?

Post by max »


conta
Posts: 100
Joined: October 31st, 2013, 4:59 pm

Re: Syntax for resampler?

Post by conta »

conta wrote:
like it is written in the documentation, but that does not work.

max
Forum team
Posts: 1128
Joined: January 15th, 2013, 3:43 pm

Re: Syntax for resampler?

Post by max »

Apparently, you don't want my help. I'll remember that.

conta
Posts: 100
Joined: October 31st, 2013, 4:59 pm

Re: Syntax for resampler?

Post by conta »

Sorry - seems to be a misunderstanding. Of course i want your help! :)

You told me to look here: http://www.musicpd.org/help/
Here the first point is to read the documentation, which i did.
Second point is to get a error-log, but this is not possible. When i start MPD with the described lines it does not start and does not create any log-file.
When i delete the described lines, MPD starts normaly, so this problem is not caused by file-permission-problems or something like that.
I have here just the problem, that MPD with:

resampler {
plugin "soxr"
quality "high"
}

in the mpd.conf does not start.

So my questions is:
Do you successfully start MPD with soxr-integration with this syntax?
When this is true, it seems that i have a very strange configuration-problem because the syntax:

samplerate_converter "soxr high"

works perfectly for me.

And now i am coming to my "core-problem":
In the mpd-documentation the enabling of multithreading for soxr is described, but i don't know how to put the line:

"threads = 0"

to the mpd.conf.
Do you now understand my problem?

Ran
Posts: 151
Joined: February 25th, 2013, 3:47 am

Re: Syntax for resampler?

Post by Ran »

Seriously...

We have a forum and an IRC channel for requesting help (see links on the left). Before you go there:

read the documentation
read the troubleshooting page
check file permissions
check the log file (--verbose)
make sure you have the latest MPD version (0.19.13)
make sure you have the latest version of all decoder libraries
When you do request help, post the following data (use paste.debian.net on IRC):

output of “mpd --version”
your configuration file (mpd.conf)
relevant portions of the log file (--verbose)
be clear about what you expect MPD to do, and what is actually happening
Your collaboration is necessary to solve your problem. We can’t help you if you don’t follow the instructions above.

If MPD crashes, do not ask for help! Submit a bug report instead (with a full backtrace).

conta
Posts: 100
Joined: October 31st, 2013, 4:59 pm

Re: Syntax for resampler?

Post by conta »

Thanks for your effort, but...
MPD runs more or less perfect here, including soxr-integration.
So there is no need for checking file permissions or log-files.
The only problem is: How to enable multi-threading in soxr?
The documentation seems to be wrong and in the www there is nothing to find.
I just tried the following syntaxes:

Code: Select all

samplerate_converter "soxr very high"  "threads 0"

samplerate_converter "soxr very high"  
threads "0"

samplerate_converter		"soxr very high.threads 0"

samplerate_converter		"soxr very high:threads 0"

samplerate_converter		"soxr very high:0"

samplerate_converter		"soxr very high":"0"

samplerate_converter		"soxr very high", "0"

samplerate_converter		"soxr very high" "0"
Nothing of these works. Maybe its just a fake and there is no multi-threading at all? :shock:

tuxx
Posts: 20
Joined: March 21st, 2015, 5:21 pm

Re: Syntax for resampler?

Post by tuxx »

Hi all,

I have latest mpd 0.20.6 installed:

http://pastebin.ca/3789313

It's been compiled with libsoxr support and sox is enabled with the following configuration (as per musicpd documentation):

resampler {
plugin "soxr"
quality "very high"
}

audio_output {
enabled "yes"
type "alsa"
name "Aune S16"
device "hw:1,0"
format "352800:32:2"
auto_resample "no"
auto_channels "no"
auto_format "no"
dop "yes"
}

I am trying to find some logging information to see wether resampling uses soxr or not.

I've set logging to verbose, but I can't see anything regarding sox on it.

However I have tried different qualities in soxr block and I see a difference in cpu use that leads me to believe that I am actuallly using soxr.

In addition resampling is confirmed via the following command:

Code: Select all

cat /proc/asound/card1/pcm0p/sub0/hw_params 
access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 352800 (352800/1)
period_size: 32768
buffer_size: 131072

Is there any way to be 100% sure about the resampler I am using?

Many thanks in advance,

Michael

tuxx
Posts: 20
Joined: March 21st, 2015, 5:21 pm

Re: Syntax for resampler?

Post by tuxx »

I am doing several tests having a terminal opened with:

Code: Select all

tail -f /var/log/mpd.log
What I realized is that when changing songs, I managed to get soxr information only once:

Code: Select all

Mar 31 14:06 : alsa_output: opened hw:1,0 type=HW
Mar 31 14:06 : alsa_output: buffer: size=90..131072 time=255..371520
Mar 31 14:06 : alsa_output: period: size=45..65536 time=127..185760
Mar 31 14:06 : alsa_output: default period_time = buffer_time/4 = 371519/4 = 92879
Mar 31 14:06 : alsa_output: format=S32_LE (Signed 32 bit Little Endian)
Mar 31 14:06 : alsa_output: buffer_size=131072 period_size=32768
Mar 31 14:06 : output: opened plugin=alsa name="Aune S16" audio_format=352800:32:2
Mar 31 14:06 : soxr: soxr engine 'double-precision'
Mar 31 14:06 : soxr: samplerate conversion ratio to 8.00
Mar 31 14:06 : output: converting in=44100:16:2 -> f=44100:16:2 -> out=352800:32:2
Mar 31 14:06 : state_file: Saving state file /var/lib/mpd/mpdstate
/code]

In fact, when i clear the playlist and load a new album, I only get all the information above on the first song. When I change to another track there's zero reference to soxr.

Post Reply