Core V2 as a USB gadget audio

Hello,



I’m trying to make core V2.0 USB audio card.



I modified kernel that you already shared.

(disable otg serial and enable USB_AUDIO for UAC2)



-# CONFIG_USB_AUDIO is not set

+CONFIG_USB_AUDIO=m



-CONFIG_USB_F_ACM=m

-CONFIG_USB_U_SERIAL=m

-CONFIG_USB_CONFIGFS_ACM=y

+# CONFIG_USB_CONFIGFS_ACM is not set



Core V2.0 is connected to desktop as a USB audio card.

executed ‘sudo modprobe g_audio p_srate=48000 c_srate=48000’ on the device and

connected each other through OTG port.





Here is aplay/arecord -l



=== Host(desktop)

jcsing@desktop2:~/temp$ aplay -l

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

card 0: PCH [HDA Intel PCH], device 0: ALC662 rev3 Analog [ALC662 rev3 Analog]

Subdevices: 1/1

Subdevice #0: subdevice #0

card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]

Subdevices: 1/1

Subdevice #0: subdevice #0

card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]

Subdevices: 1/1

Subdevice #0: subdevice #0

card 2: Gadget [Linux USB Audio Gadget], device 0: USB Audio [USB Audio]

Subdevices: 1/1

Subdevice #0: subdevice #0

jcsing@desktop2:~/temp$ arecord -l

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

card 0: PCH [HDA Intel PCH], device 0: ALC662 rev3 Analog [ALC662 rev3 Analog]

Subdevices: 1/1

Subdevice #0: subdevice #0

card 0: PCH [HDA Intel PCH], device 2: ALC662 rev3 Alt Analog [ALC662 rev3 Alt Analog]

Subdevices: 1/1

Subdevice #0: subdevice #0

card 2: Gadget [Linux USB Audio Gadget], device 0: USB Audio [USB Audio]

Subdevices: 0/1

Subdevice #0: subdevice #0





== Device

respeaker@v2:~$ aplay -l

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

card 0: seeed8micvoicec [seeed-8mic-voicecard], device 1: 100b0000.i2s1-rk3228-hifi rk3228-hifi-1 []

Subdevices: 1/1

Subdevice #0: subdevice #0

card 1: UAC2Gadget [UAC2_Gadget], device 0: UAC2 PCM [UAC2 PCM]

Subdevices: 1/1

Subdevice #0: subdevice #0

respeaker@v2:~$ arecord -l

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

card 0: seeed8micvoicec [seeed-8mic-voicecard], device 0: 100b0000.i2s1-ac108-pcm0 ac108-pcm0-0 []

Subdevices: 1/1

Subdevice #0: subdevice #0

card 1: UAC2Gadget [UAC2_Gadget], device 0: UAC2 PCM [UAC2 PCM]

Subdevices: 1/1

Subdevice #0: subdevice #0





playback is working well (desktop play sound though USB gadget device)

host(my desktop) : aplay -f dat sound.wav -Dhw:2,0

device(core v2.0) : arecord -f dat -t wav -D hw:1,0 | aplay -D hw:0,1



but capture is not working.

host(my desktop) : arecord -f dat -Dhw:2,0 device.wav

device(core v2.0) : aplay -Dhw:1,0 test.wav



error messages

host

arecord: set_params:1297: Unable to install hw params:

[ 472.232772] usb 1-1.1.2: 2:1: cannot get freq (v2/v3): err -110

[ 472.232793] usb 1-1.1.2: 2:1: freq mismatch (RO clock): req 16000, clock runs @0



device

aplay: pcm_write:2011: write error: Input/output error





I think gadget driver has something problems. Do you have any suggestions?



Thank you.

gadget driver should be no problem, It should be different from what you do in terms of usage. Check the linux documentation for details

hello,I’m trying to make core V2.0 USB audio card,too.
but I can’t connected to desktop as a USB audio card.
and can‘t executed the g_audio ,can you give me your image ?
thank you!