[alsa-devel] Best representation for TDM devices
Hi,
I'm currently working on a device that has two Analog's ADAU7002 connected to an I2S/TDM Controller (sound/soc/sunxi/sun4i-i2s.c, with some modifications), over the slots 1/2 and 3/4.
The capture itself is working fine, however I'm not quite sure about the way to expose those streams to the userspace.
Since I have two codecs, I have two links (described through simple-card) and thus two subdevices. However, the microphones connected are really separate streams, so ideally (I guess?) we should have 1 subdevice per microphone.
An alternative would be that we capture the whole 4 channels and use dsnoop to demux them, but trying to use the device directly (using arecord -D hw:0) results in the ioctl to change the number of channels being rejected, I'm assuming because each codec only has 2 channels?
So I'm a bit lost at this point about how I should go and expose this. I couldn't really find any similar setup either in the kernel. Any preferred way of doing this?
Thanks! Maxime
-- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
On Thu, Jul 25, 2019 at 03:01:12PM +0200, Maxime Ripard wrote:
Since I have two codecs, I have two links (described through simple-card) and thus two subdevices. However, the microphones connected are really separate streams, so ideally (I guess?) we should have 1 subdevice per microphone.
An alternative would be that we capture the whole 4 channels and use dsnoop to demux them, but trying to use the device directly (using arecord -D hw:0) results in the ioctl to change the number of channels being rejected, I'm assuming because each codec only has 2 channels?
So I'm a bit lost at this point about how I should go and expose this. I couldn't really find any similar setup either in the kernel. Any preferred way of doing this?
What is the actual hardware - what do the microphones physically look like in the system, what functional role do they play? My initial guess would be to combine them into a single PCM for userspace, there's some support for that but it's not surprising if that's broken somewhere along the line as it's very infrequently tested.
participants (2)
-
Mark Brown
-
Maxime Ripard