This article provides how to use the USB 2.0 Gadget Audio on SP7350 board which makes the board as an audio card.
Table of Contents |
---|
Hardware Configuration
...
Item 13 : USB 2.0 Type A
Item 14 : USB 2.0 Micro-AB
Item 15 : USB 3.0 Type C
Kernel Setup
Enter kernel configuration
...
Code Block |
---|
sunplus@ubuntu:~$ cat /proc/asound/cards 0 [spaud ]: sp-aud - sp-aud Q645/Q654, Sunplus Technology Inc. 1 [UAC1Gadget ]: UAC1_Gadget - UAC1_Gadget UAC1_Gadget 0 2 [Device ]: USB-Audio - USB Audio Device C-Media Electronics Inc. USB Audio Device at usb-xhci-hcd.1.auto-1, full speed sunplus@ubuntu:~$ |
In Device Manager of Windows PC, “AC Interface” of “Sound“Capture Input terminal (AC Interface)“ and “Speakers (AC Interface)“ will show up in Audio inputs and outputs. “AC Interface” will show up in Sound, video and game controllers” will show up in Device Managercontrollers.
...
Test
Record and Play
...
Play music and choose “Speakers (AC Interface)“ in Windows PC and . Then use arecord -D hw:1,0 -c 2 -r 48000 -f S16_LE | aplay -D hw:2,0 -c 2 -r 48000 -f S16_LE command to output the sounds to the earphone of the USB sound card in USB 3.0 type C port in the SP7350 platform.
Code Block |
---|
sunplus@ubuntu:~$ arecord -D hw:1,0 -c 2 -r 48000 -f S16_LE | aplay -D hw:2,0 -c 2 -r 48000 -f S16_LE Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo |
Record Channel
...
Play music and choose “Speakers (AC Interface)“ in Windows PC and . Then use arecord -D hw:1,0 -c 2 -r 48000 -f S16_LE pc_music.wav command to record it as pc_music.wav in the SP7350 platform.
Code Block |
---|
sunplus@ubuntu:~$ arecord -D hw:1,0 -c 2 -r 48000 -f S16_LE pc_music.wav Recording WAVE 'pc_music.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo |
...
Use aplay -D hw:1,0 -c 2 -r 48000 -f S16_LE pc_music.wav command to play pc_music.wav in the SP7350 platform. Then choose “Capture Input terminal (AC Interface)“ and record it in the Windows PC.
...