Hello everyone, this is my first post in this mailing list.
I am a (really happy) mpd user. I use multiple configurations to enable
upsampling with sox.
However, it seems to me it is not possible to have a configuration that
implements Symmetric Upsampling.
By symmetric upsampling I mean the following (I apologize if I am not using
the proper definitions):

If my source is 44.1kHz and I want 8x upsampling, I want to upsample to
352.8kHz
If my source is 48kHz and I want 8x upsampling, I want to upsample to
384.0kHz

While the fact that this might sound better than a fixed upsampling to
384.0 is not certain (it seems to me, but it might be totally a placebo
effect), there are other applications that allow to achieve this feature
automatically.
One is Foobar 2000, with the sox dsp (mod and mod2 versions), and another
is JRiver (not free): this one allows the user to configure a sort of
table, stating what you want to do with each sampling rate.

After trying (without success) to implement the same via alsa and a mpd
'pipe' output configuration, I tried another way and started looking at the
mpd source code.
I implemented a sort of "hack" that allows me to specify, instead of the
desired sampling rate in the "format" field of a alsa output configuration,
the requested upsampling multiplication factor and a further parameter, the
upsampling limit, that allow me not to touch sampling rates above another
multiplication factor.

So, if I want to upsample x8, I need to specify something like this:


audio_output {

        type            "alsa"

        name            "DAC (x8)"

        device          "hw:DAC,0"      # optional

        format          "X8:24:2"

        auto_resample   "no"

}


Notice the X8 string.


So, if I want to upsample x8, but I want to leave the frequencies 176.4kHz,
192kHz and above untouched, I need to specify:


audio_output {

        type            "alsa"

        name            "DAC (x8)"

        device          "hw:DAC,0"      # optional

        format          "X8L4:24:2"

        auto_resample   "no"

}

Notice the "L4" portion.

So, if I want to upsample x8, but I want to leave the frequencies 88.2Hz,
96Hz and above untouched, I need to specify:


audio_output {

        type            "alsa"

        name            "DAC (x8)"

        device          "hw:DAC,0"      # optional

        format          "X8L2:24:2"

        auto_resample   "no"

}

Notice the L2.

Using "L1" is equivalent to not specify the L parameter.

Of course this is a hack and it is not probably a good way to implement
this configuration in a structured way, but at the moment this works good
for me.

If anyone is interested, I may post my modifications (to files
AudioFormat.hxx, AudioFormat.cxx and AudioParser.cxx).

Thanks a lot for your attention.
Giovanni
_______________________________________________
mpd-devel mailing list
[email protected]
http://mailman.blarg.de/listinfo/mpd-devel

Reply via email to