Re: [Alsa-user] 'Supported bit depths' according to alsa-lib seem to differ from real values

2019-11-25 Thread Feli Kramer
Hello Clemens,Thank you so much! This is valuable information.I was working with the API reference. I guess I should start reading a book or tutorial. :)Kind regards,Feli___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] 'Supported bit depths' according to alsa-lib seem to differ from real values

2019-11-24 Thread Clemens Ladisch via Alsa-user
f...@interkatz.de wrote:
> according to hda-verb, the supported capturing parameters are 16/20/24
> bits per sample

These are the sample formats that are transmitted on the HDA bus.

> Alsa-lib, on the other hand, claims that the supported formats (for
> `hw:0,0` in this case) are S16LE and S32LE

These are the sample formats that the HDA controller writes into memory,
and that your application sees in the buffer.

> I expected that ALSA returns something like: S16LE, S20LE, S24LE.

S20 and S24 are smaller samples that are aligned at the least
significant bit in the 32-bit memory word.  This would make them harder
to handle, and almost no DMA controller is stupid enough to use them.

The 20- or 24-bit samples you get from HDA are aligned at the most
significant bit, i.e., you can handle them like 32-bit values.  If you
really want to know how many bits are actually significant, call
snd_pcm_hw_params_get_sbits() after you've set the hw params.


Regards,
Clemens


___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


[Alsa-user] 'Supported bit depths' according to alsa-lib seem to differ from real values

2019-11-24 Thread feli
Hello,

I have tried using alsa-lib to query hardware capabilities in order to capture 
sound at natively supported settings using the built-in sound card (ALC269VC).

However, I have found that `snd_pcm_hw_params_get_format_mask()` returns 
different results from what is shown in the /proc/asound/card[...]/codec#[...] 
file or what is returned by calling `hda-verb /dev/snd/hw[...] 0x[...] 0xF00 
0x0A`.

Namely, according to hda-verb, the supported capturing parameters are 16/20/24 
bits per sample, as well as sampling rates of 44.1/48/96/192 kHz.

Alsa-lib, on the other hand, claims that the supported formats (for `hw:0,0` in 
this case) are S16LE and S32LE, while the sampling rates are the same.

Is this normal ALSA behavior, or is that a bug in ALSA? I expected that ALSA 
returns something like: S16LE, S20LE, S24LE.

Kind regards,
Feli Kramer


___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user