Re: [asoundrc] "lossless" format conversion without any rate conversion?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Vincent Yu wrote:
> Will any sample rate conversions occur with this .asoundrc config?
>
> pcm_slave.force_24_bit_no_rate_convert {
>         pcm "hw:0,0"
>         format S24_3LE # Or other 24-bit format
>         rate "unchanged" # Necessary?
> }
>
> pcm.my_new_default {
>         type plug
>         slave force_24_bit_no_rate_convert
> }

http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html#pcm_plugins_plug

This plugin will not do resampling.

> Specifically, does sample rate conversion still occur anywhere in the
> signal chain even though I provided the "unchanged" string for rate?

The hardware, another plugin layered on top of this, or some application
might still do resampling.  :)

> I would like to create a configuration to force digital audio output
> from my PC (Arch Linux - ALSA only, no Pulseaudio) to remain at or be
> converted to 24-bit format without any sample rate conversion.

Then try the linear plugin, which changes only the sample format:

pcm.my_new_default {
    type linear
    slave {
        pcm "hw:0,0"
        format S24_3LE
    }
}

(The "plug" plugin does nothing but dynamically inserting other plugins,
such as "linear"/"route"/"rate", when required.)

> I understand that the word, "lossless," in the title may be a bit of
> a misnomer, since quantization noise from quantization errors during
> bit depth conversion will raise the noise floor of the signal by
> a small (and probably inaudible) amount

Converting between integer sample formats does not change the bits; you
get quantization errors only with volume changes.

> looking at the code and trying to grep directory trees recursively for
> the string, "unchanged", to see if I can get any leads, I got lost in
> the behemoth of a code base

The "unchanged" string is parsed in pcm.c; in pcm_plug.c, search for
"== -2".


Regards,
Clemens

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user



[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux