How to enable USB audio device with SP7021 boards
The goal of the document is to explain how to enable USB audio device with SP7021 boards.
As an embedded system, to minimize the use of system resources, SP7021 Linux only enables necessary kernel features by default. To enable USB audio device, first, you need to download source files of SP7021 from GitHub. Second, you need to run kernel menuconfig to enable necessary kernel features or device drivers. Finally, you need to re-build SP7021 Linux images. Please follow the following steps.
1. Download source files of SP7021
Source files of SP7021 can be downloaded from GitHub. Refer to GitHub - sunplus-plus1/SP7021 or 2. HOW TO GET SOURCE FILE AND PACKAGE.
2. Enable necessary kernel features or device drivers.
Run make kconfig command in project top folder. When “Linux/arm 5.4.35 Kernel Configuration” menu pops up, please use arrow key to move cursor down to “Device Drivers”. Refer to screenshot below, cursor is moved to “Device Drivers”:
Press <Enter> to enter “Device Driver” sub-menu. Next, move cursor down to “Sound card support” and press <Space> or “y” to enable it. Refer to screenshot below, “Sound card support” is enabled:
Next, press <Enter> to enter “Sound card support” sub-menu. Next, move cursor down to “Advanced Linux Sound Architecture” and press <Space> or “y” to enable it. Refer to screenshot below, “Advanced Linux Sound Architecture” is enabled:
Next, press <Enter> to enter “Advanced Linux Sound Architecture” sub-menu. Next, move cursor down to “USB sound devices” and press <Space> or “y” to enable it. Refer to screenshot below, “USB sound devices” is enabled:
Next, press <Enter> to enter “USB sound devices” sub-menu. Next, move cursor down to “USB Audio/MIDI driver” and press <Space> or “y” to enable it. Refer to screenshot below, “USB Audio/MIDI driver” is enabled:
Finally, move cursor to <Save> button and press <Enter> to save configuration.
3. Build Linux image
Go to project top folder. Run make to build SP7021 Linux images.
4. Boot system
Boot system with the built image. Plug in the USB audio adapter. You’ll see kernel messages as shown below:
~ # [ 101.243149] usb 4-1: new full-speed USB device number 2 using ohci1-sunplus
[ 101.653757] input: C-Media Electronics Inc. USB Audio Device as /devices/platform/soc@B/9c103080.usb/usb4/4-1/4-1:1.3/0003:0D8C:0014.0002/input/input1
[ 101.734077] hid-generic 0003:0D8C:0014.0002: input,hidraw0: USB HID v1.00 Device [C-Media Electronics Inc. USB Audio Device] on usb-9c103080.usb-1/input3
~ #
You can find USB audio device in directory /dev/snd by using ls -l /dev/snd command:
~ # ls -l /dev/snd
crw-rw---- 1 root root 116, 0 Jan 1 00:01 controlC0
crw-rw---- 1 root root 116, 24 Jan 1 00:01 pcmC0D0c
crw-rw---- 1 root root 116, 16 Jan 1 00:01 pcmC0D0p
crw-rw---- 1 root root 116, 33 Jan 1 00:00 timer
~ #