uac2: diagnosing uac2 audio gadget problems

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

 



Hello,
   I am attempting to use the USB audo gadget uac2 so that my i.MX6
based Wandboard can be a USB audio device.

I am using a stock 4.5 linux with no modifications, direct from git
and compiled locally:
uname -a shows:

Linux wandboard 4.5.0 #4 SMP Tue Jun 7 10:09:16 PDT 2016 armv7l armv7l
armv7l GNU/Linux


I have brought up and configfs setup, and have successfully gotten
aplay and arecord to show the devices like this:

aplay -L shows:
...
hw:CARD=UAC2Gadget,DEV=0
    UAC2_Gadget, UAC2 PCM
    Direct hardware device without any conversions
...

and arecord -L shows:
...
hw:CARD=UAC2Gadget,DEV=0
    UAC2_Gadget, UAC2 PCM
...

I have tried both 48000 and 64000 sample rates (via s_srate and
c_srate), but I can't either play or record audio, and nothing goes
over to the host.

On the host side, I can play and record -- i.e. time progresses
without error in audacity when I hit the record button (which does a
full-duplex play/record).

On the client side I get this, regardless of what's happening on the host side:

...
root@wandboard:/home/caleb/gadget# aplay -D hw:CARD=UAC2Gadget,DEV=0 sine64k.wav
Playing WAVE 'sine64k.wav' : Signed 16 bit Little Endian, Rate 64000 Hz, Stereo
aplay: pcm_write:1939: write error: Input/output error
...


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


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?

Thank you!

Sincerely,
  -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