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

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

 



Thank you so much for the informative and detailed response!

Clemens Ladisch wrote:
> This plugin will not do resampling.

It's a relief to hear that plug, in this situation, will not cause 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.  :)

Ah, yes - like when applications mix or change the volume of streams
before talking to ALSA. I'll be sure to try to have the applications
send a bit-perfect stream to the aforementioned newly defined pcm.

>> 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.)

Using the linear plugin directly also works for me. Thanks for
clarifying how stuff is working under the hood. I'm directly using the
linear plugin now to make my asoundrc config more readable and clear
to me in the future.

>> 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.

Ah, right - CD audio uses LPCM. So only zero-padding occurs... by left
shifting zeros from the right into the samples (without taking
endianness into account)? To only increase precision without losing
information. Ah, it makes sense.

>> 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".

And so we get:

links |= SND_PCM_HW_PARBIT_RATE;

I was just using a rather vanilla configuration of vim to browse the
code base. Perhaps I should look into plugins and such to make looking
up references/definitions easier. Thanks, yet again, for the
clarification and taking the time to respond to my long post!

Thanks,
Vincent

------------------------------------------------------------------------------
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