Hi Clemens,
That is where my confusion was. When you said hw_params are only what the HW supports (makes sense :) ). Making minchan=maxchan, I can now record less than max channels.
Thanks for the help!
On Wed, Sep 21, 2016 at 12:01 AM, Clemens Ladisch clemens@ladisch.de wrote:
Rob Nertney wrote:
I'm building the hardware, so I can technically do whatever I want. I didn't want to add more to the hardware if ALSA can handle this.
The hardware is spec-ed to *always* have 16 channels worth of data being written into DDR. I think this comes full-circle to my original question
of
whether arecord can filter out channels.
When the ALSA library automatically converts sample formats, it can also adjust the number of channels. (This does not happen if some program decides to use the "hw" device to bypass all conversions.)
It sounds like arecord can handle multiple channels, but its under the assumption that the hardware itself changes (in the pcm_open function) to only copy in the requested channels worth of data; i.e. arecord assumes that the data in dma_area is exactly as requested by arecord.
The ALSA kernel framework assumes that the snd_pcm_hw constraints correctly describe the capabilities of your hardware. Any conversions happen in userspace.
Your driver never sees what happens in userspace; the values to be set by the .hw_params callback are guaranteed to fit into your driver's constraints.
Regards, Clemens