UAC recording and playback*
1. Linux environment*
1.1 Linux system*
Use aplay | arecord on the command line
view device
arecord -l
root@ubuntu:/disk3# arecord -l
List of CAPTURE Hardware Devices **
card 0: AudioPCI [Ensoniq AudioPCI], device 0: ES1371/1 [ES1371 DAC2/ADC]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Dongle [NationalChip UAC Dongle], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0
-
It can be seen that 8008 is recognized as a usb sound card, "NationalChip UAC Dongle"
-
Recording: According to the above information, it is found that 8008 is card 1, device 0. Therefore, the pcm method of recording mono, 16K, 16bit is
arecord -r 16000 -c 1 -f S16_LE -D hw:1,0 > 1.wav
-
Play 48K 16bit pcm audio:
aplay -r 48000 -c 2 -f S16_LE -D hw:1,0 1.wav
1.2 android system*
-
View the current sound card
rk3288:/ # cat /proc/asound/cards 0 [rkhdmianalogsnd]: rk-hdmi-analog- - rk-hmi-analog-snd rk-hdmi-analog-snd 1 [Dongle ]: USB-Audio - NationalChip UAC Dongle (8008c sound card device, the device name is configured in the code) NationalChip NationalChip UAC Dongle at usbff540000.usb-1.2, high speed
-
View pcm device list
rk3288:/ # cat /proc/asound/pcm 00-00: HDMI-ANALOG multicodec-0 : : playback 1 : capture 1 01-00: USB Audio : USB Audio : playback 1 : capture 1
-
Check which processes currently occupy the pcm device node
lsof | grep pcm
-
Check which audio device nodes are available
rk3288:/ # ls /dev/snd/ controlC0 controlC1 pcmC0D0c pcmC0D0p pcmC1D0c pcmC1D0p timer
-
From the above information, we can see that our current device is card1device0 on Android
Use tinyalsa to operate the sound card
-
The corresponding tools are as follows. These applications follow the alsa driver rules, and the recording needs to be connected with the underlying hardware.
-
tinymix: view configuration mixer
-
tinypcminfo: View pcm channel related information
rk3288:/ # tinypcminfo -D 1 -d 0 Info for card 1, device 0: PCM out: Access: 0x000009 Format[0]: 0x000004 Format[1]: 00000000 Format Name: S16_LE Subformat: 0x000001 Rate: min=48000Hz max=48000Hz Channels: min=2 max=2 Sample bits: min=16 max=16 Period size: min=48 max=131072 Period count: min=2 max=1024 PCM in: Access: 0x000009 Format[0]: 0x000004 Format[1]: 00000000 Format Name: S16_LE Subformat: 0x000001 Rate: min=16000Hz max=16000Hz Channels: min=4 max=4 Sample bits: min=16 max=16 Period size: min=16 max=65536 Period count: min=2 max=1024
-
tinycap: recording
tinycap data/cap.wav -D 1 -d 0 -c 4 -r 16000 -b 16 -D sound card selection -c channel 4 means 4 channels -r sampling rate -b number of bits to sample
-
tinyplay: play audio
tinyplay data/cap.wav -D 1 -d
1.3 ubuntu interface tools*
-
Install audacity recording software
sudo apt-get install audacity
-
Make sure the usb sound card device is recognized correctly
-
Open the audicity software and set it up
-
Device selection Nationalchip UAC Dongle
-
Sampling rate 16000
-
The number of channels is UAC firmware burned according to actual needs
-
-
Save the audio, if necessary, you can save the audio in wav format, select custom mixing in the edit-preferences, so that the original audio data of 4 channels can be saved
Attention
Do not verify the above operations on the linxu virtual machine, as recording exceptions may occur.
2. Windows environment*
GX8008 only supports UAC2.0
GX8008C supports UAC1.0 and UAC2.0
The UAC protocol supported by the relevant firmware can be clearly communicated with FAE
For systems before win10, drive-free support UAC1.0. Win10 relatively new system supports UAC1.0 and UAC2.0
-
Win10 version that supports UAC2.0
Starting with Windows 10, release 1703, a USB Audio 2.0 driver is shipped with Windows. It is designed to support the USB Audio 2.0 device class. The driver is a WaveRT audio port class miniport. For more information about the USB Audio 2.0 device class,
-
Directly use audacity to record, also use audacity to record, the method is the same as under linux, but there are two problems below
- When recording more than two channels of data, it may be necessary to switch the recording frame of audacity
- When modifying the recording configuration, there will be a problem that the new configuration cannot be recorded
-
When the above problems occur, follow the steps below:
-
You can see that the current sound card cannot detect the volume level of the microphone (the sound card device is: Source/Sink)
-
Uninstall the device from device manager
-
Confirm uninstallation
-
uninstalled successfully
-
Re-scan the hardware, it will re-scan to our UAC sound card
-
It can be seen that the sound card can detect the volume output
-
Finally, when using audacity to record 4-channel data (the number of channels that can be recorded is related to the final firmware, the 4-channel provided in this article is just an example), the recording framework can only choose WASAPI, and this framework can only see 4 channels
-