Audio recording device is separate hw:0,1 on imx28evk with 3.14 kernel

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Audio recording device is separate hw:0,1 on imx28evk with 3.14 kernel

1,080 Views
CraigMcQueen
Contributor III

I'm testing the 3.14.19 kernel on imx28evk, with a Yocto build that uses the linux-fslc kernel provider.

The recording device is hw:0,1 rather than hw:0,0 (the playback device is hw:0,0). This is different to the 2.6.35 kernel case. It means that sound doesn't work "out of the box" (using ALSA lib implicit config, which I assume tries to use hw:0,0). That is, just doing arecord test.wav doesn't work; it is necessary to do something like:

arecord -D hw:0,1 -f s16 -c 2 -r 16000 test.wav

This doesn't use the dsnoop plugin, so there's no automatic sample rate conversion etc (unlike playback with aplay, which automatically uses the dmix plugin for sample rate/channel conversion as needed).

To be able to use arecord without needing the -D hw:0,1 option (and to use dsnoop plugin etc), it would be necessary to define a custom /etc/asound.conf I assume, to direct recording to hw:0,1. But Yocto core-image-minimal build for imx28evk doesn't provide one.

Looking in the driver history, it seems that the two i.MX28 SAIF interfaces are being treated as separate devices. But it wasn't done this way in the 2.6.35 kernel. Is this some new technical constraint of the 3.x kernels? Would it be possible to change the driver so that the recording device also appears as hw:0,0?

Labels (2)
Tags (1)
0 Kudos
6 Replies

660 Views
CraigMcQueen
Contributor III

2.6.35 kernel

root@imx28evk:~# uname -a

Linux imx28evk 2.6.35.3-maintain+yocto+gb3912bb #1 PREEMPT Tue Nov 11 10:46:45 AEDT 2014 armv5tejl GNU/Linux

root@imx28evk:~# aplay -l

**** List of PLAYBACK Hardware Devices ****

card 0: mxsevk [mxs-evk], device 0: SGTL5000 SGTL5000-0 []

  Subdevices: 1/1

  Subdevice #0: subdevice #0

card 1: mxsevk_1 [mxs-evk], device 0: MXS SPDIF mxs spdif-0 []

  Subdevices: 1/1

  Subdevice #0: subdevice #0

root@imx28evk:~# arecord -l

**** List of CAPTURE Hardware Devices ****

card 0: mxsevk [mxs-evk], device 0: SGTL5000 SGTL5000-0 []

  Subdevices: 1/1

  Subdevice #0: subdevice #0

3.14 kernel

root@imx28evk:~# uname -a

Linux imx28evk 3.14.19-fslc+g00e4721 #1 Wed Nov 12 12:13:58 AEDT 2014 armv5tejl GNU/Linux

root@imx28evk:~# aplay -l

**** List of PLAYBACK Hardware Devices ****

card 0: mxssgtl5000 [mxs_sgtl5000], device 0: HiFi Playback sgtl5000-0 []

  Subdevices: 1/1

  Subdevice #0: subdevice #0

root@imx28evk:~# arecord -l

**** List of CAPTURE Hardware Devices ****

card 0: mxssgtl5000 [mxs_sgtl5000], device 1: HiFi Capture sgtl5000-1 []

  Subdevices: 1/1

  Subdevice #0: subdevice #0

0 Kudos

660 Views
fabio_estevam
NXP Employee
NXP Employee

Yes, different implementations, but don't see a problem nor error with the way mainline kernel represents the two audio interfaces.

0 Kudos

660 Views
CraigMcQueen
Contributor III

I guess you're right. I think I need to make a suitable /etc/asound.conf so that arecord doesn't need -D hw:0,1 parameter, and sets up plug or dsnoop or whatever plugin for sample rate, channels, sample format conversion.

0 Kudos

660 Views
fabio_estevam
NXP Employee
NXP Employee

record and playback are treated by different SAIF interfaces, so it is OK to have them as different devices.

0 Kudos

660 Views
CraigMcQueen
Contributor III

They may be "different" SAIF interfaces, but those SAIF interfaces aren't independent; they share clocks, and so playback and record must be at the same clock rate. So it makes more sense to consider them as one device.

0 Kudos

660 Views
fabio_estevam
NXP Employee
NXP Employee

Not all mx28 designs use one SAIF for playback and the other for recording.

One can design a system where SAIF0 and SAIF1 are both for playback, or both are record, or only SAIF0 is used for playback, or only SAIF0 is used for recording, or only SAIF1 is used for playback and so on.