Re: uac2: diagnosing uac2 audio gadget problems

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

 



On Mon, Jun 13, 2016 at 4:04 PM, Caleb Crome <caleb@xxxxxxxxx> wrote:
> On Mon, Jun 13, 2016 at 2:53 AM, Peter Chen <hzpeterchen@xxxxxxxxx> wrote:
>> On Wed, Jun 08, 2016 at 04:11:11PM -0700, Caleb Crome wrote:
>>>
>>> Here is the script I use for starting the gadget interface:
>>>
>>> cd /sys/kernel/config/usb_gadget
>>> mkdir g1
>>> cd g1
>>> echo "0x1d6b" > idVendor
>>> echo "0x0104" > idProduct
>>> mkdir strings/0x409
>>> echo "0123456789" > strings/0x409/serialnumber
>>> echo "Foo Inc." > strings/0x409/manufacturer
>>> echo "Bar Gadget" > strings/0x409/product
>>> mkdir functions/uac2.aud0
>>> mkdir functions/ecm.usb0
>>> #echo 64000 > functions/uac2.aud0/c_srate
>>> #echo 64000 > functions/uac2.aud0/p_srate
>>> mkdir configs/c.1
>>> mkdir configs/c.1/strings/0x409
>>> echo "CDC ECM + audio" > configs/c.1/strings/0x409/configuration
>>> ln -s functions/uac2.aud0 configs/c.1
>>> ln -s functions/ecm.usb0 configs/c.1
>>> echo `ls /sys/class/udc/` > /sys/kernel/config/usb_gadget/g1/UDC
>>>
>>
>> Try to use below command to see if it works, it works at my i.mx6 board.
>>
>> 1. **** List of PLAYBACK Hardware Devices ****
>> root@imx6sxsabresd:~# aplay -l
>> **** List of PLAYBACK Hardware Devices ****
>> card 0: wm8962audio [wm8962-audio], device 0: HiFi wm8962-0 []
>>   Subdevices: 1/1
>>   Subdevice #0: subdevice #0
>> card 1: imxspdif [imx-spdif], device 0: S/PDIF PCM Playback dit-hifi-0 []
>>   Subdevices: 1/1
>>   Subdevice #0: subdevice #0
>> card 2: UAC2Gadget [UAC2_Gadget], device 0: UAC2 PCM [UAC2 PCM]
>>   Subdevices: 1/1
>>   Subdevice #0: subdevice #0
>> 2. **** List of CAPTURE Hardware Devices ****
>> root@imx6sxsabresd:~# arecord -l
>> **** List of CAPTURE Hardware Devices ****
>> card 0: wm8962audio [wm8962-audio], device 0: HiFi wm8962-0 []
>>   Subdevices: 1/1
>>   Subdevice #0: subdevice #0
>> card 2: UAC2Gadget [UAC2_Gadget], device 0: UAC2 PCM [UAC2 PCM]
>>   Subdevices: 1/1
>>   Subdevice #0: subdevice #0
>> 3. Using below command to play (it is playback, the audio file is from
>> PC)
>> root@imx6sxsabresd:~# arecord -f dat -t wav -D hw:2,0 | aplay -D hw:0,0 &
>>
>> NOTE: arecord uses uac2_gadget to record, aplay uses real codec to play
>>
>
> Great to hear that it works on your board, that gives me hope :-)
>
> 2 questions:
> 1) What kernel version do you use?
> 2) What are the commands you send to configfs to get it working?  Does
> it look like mine?
>
> The command you suggest
>  # arecord -f dat -t wav -D hw:2,0
>
> does not work  for me:  again, I get an error message:
>
> # arecord: pcm_read:2031: read error: Input/output error
>
>
>>>
>>> When I run the script above I get the following dumped into /var/log/syslog:
>>> Jun  8 23:08:14 wandboard kernel: [  139.994081] using random self
>>> ethernet address
>>> Jun  8 23:08:14 wandboard kernel: [  139.994107] using random host
>>> ethernet address
>>> Jun  8 23:08:14 wandboard NetworkManager[359]:
>>> nm_device_get_device_type: assertion 'NM_IS_DEVICE (self)' failed
>>> Jun  8 23:08:14 wandboard NetworkManager[359]: <info>  (usb0): new
>>> Generic device (carrier: OFF, driver: 'g_ether', ifindex: 4)
>>> Jun  8 23:08:14 wandboard kernel: [  140.125255] usb0: HOST MAC
>>> 3e:52:2d:0d:98:fe
>>> Jun  8 23:08:14 wandboard kernel: [  140.153803] usb0: MAC 0e:cf:aa:06:aa:8a
>>> Jun  8 23:08:14 wandboard systemd-udevd[773]: Failed to apply ACL on
>>> /dev/snd/controlC3: Operation not supported
>>> Jun  8 23:08:14 wandboard systemd-udevd[776]: Failed to apply ACL on
>>> /dev/snd/pcmC3D0c: Operation not supported
>>> Jun  8 23:08:14 wandboard systemd-udevd[775]: Failed to apply ACL on
>>> /dev/snd/pcmC3D0p: Operation not supported
>>> Jun  8 23:08:14 wandboard systemd-udevd[773]: Process
>>> '/usr/sbin/alsactl -E HOME=/var/run/alsa restore 3' failed with exit
>>> code 99.
>>> Jun  8 23:08:14 wandboard NetworkManager[359]: <info>  devices added
>>> (path: /sys/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/gadget/net/usb0,
>>> iface: usb0)
>>> Jun  8 23:08:14 wandboard NetworkManager[359]: <info>  device added
>>> (path: /sys/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/gadget/net/usb0,
>>> iface: usb0): no ifupdown configuration found.
>>>
>>>
>>> Any idea what could be wrong?Is the 'Failed to apply ACL' relavent?
>>
>> Sorry, I don't know what that mean, do that mean there is something
>> wrong with your local codec?
>
> No, I'm not trying to use a local codec at all.  I'm trying to capture
> to a .wav file.  I'm just getting the above messages that look like
> this:
>
>>> Jun  8 23:08:14 wandboard systemd-udevd[773]: Failed to apply ACL on
>>> /dev/snd/controlC3: Operation not supported
>
> Any idea why that is?  It's the UAC2 audio device.  Do you get that
> message in your syslog?

Ah, I found that setting CONFIG_TMPFS_POSIX_ACL in the kernel config
fixed the ACL problem, but did nothing for my input/output error.  I
still get

arecord: pcm_read:2031: read error: Input/output error


-Caleb
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux