Recently, the project encountered a problem that Bluetooth and voice simultaneously occupy a recording device.
The error report is printed as follows:
audio_hw_primary: cannot open pcm_cap: cannot open device '/dev/snd/pcmC0D0c': Device or resource busy
View in system / dev/snd:
# ls /dev/snd/ -l total 0 crw-rw---- 1 system audio 116, 0 2019-04-19 17:50 controlC0 crw-rw---- 1 system audio 116, 32 2019-04-19 17:50 controlC1 crw-rw---- 1 system audio 116, 24 2019-04-19 17:50 pcmC0D0c crw-rw---- 1 system audio 116, 16 2019-04-19 17:50 pcmC0D0p crw-rw---- 1 system audio 116, 25 2019-04-19 17:50 pcmC0D1c crw-rw---- 1 system audio 116, 17 2019-04-19 17:50 pcmC0D1p crw-rw---- 1 system audio 116, 56 2019-04-19 17:50 pcmC1D0c crw-rw---- 1 system audio 116, 48 2019-04-19 17:50 pcmC1D0p crw-rw---- 1 system audio 116, 33 2019-04-19 17:50 timer
You can see all the sound card devices:
Control C0, Sound Card Control Equipment
pcmC0D0c, recording equipment
pcmC0D0p, playback device
timer, timing
C0D0c stands for Card 0 Device 0, that is, device 0 under sound card No. 0. C stands for capture, which means recording device; p stands for playback, which means playback device.
Playback: Description of playback capability, such as the number of channels supported by playback equipment, sampling rate, audio format;
capture: Capability description, such as channel number, sampling rate and audio format supported by recording equipment;
tinymix
By inputting tinymix, we can see the configuration parameters related to the audio channel:
# tinymix Mixer name: 'saf775d-audio' Number of controls: 22 ctl type num name value 0 INT 2 DAC1 Playback Volume -1 -1 1 INT 2 DAC2 Playback Volume -1 -1 2 INT 2 DAC3 Playback Volume -1 -1 3 INT 2 DAC4 Playback Volume -1 -1 4 INT 2 ADC1 Capture Volume -1 -1 5 INT 2 ADC2 Capture Volume -1 -1 6 BOOL 2 DAC1 Invert Switch On On 7 BOOL 2 DAC2 Invert Switch On On 8 BOOL 2 DAC3 Invert Switch On On 9 BOOL 2 DAC4 Invert Switch On On 10 BOOL 2 ADC1 Invert Switch On On 11 BOOL 2 ADC2 Invert Switch On On 12 BOOL 1 ADC High-Pass Filter Switch On 13 BOOL 1 DAC De-emphasis Switch On 14 ENUM 1 ADC1 Single Ended Mode Switch (null) 15 ENUM 1 ADC2 Single Ended Mode Switch (null) 16 INT 1 DAC Single Volume Control Switch -1 17 ENUM 1 DAC Soft Ramp & Zero Cross Control Switch (null) 18 BOOL 1 DAC Auto Mute Switch On 19 BOOL 1 Mute ADC Serial Port Switch On 20 INT 1 ADC Single Volume Control Switch -1 21 ENUM 1 ADC Soft Ramp & Zero Cross Control Switch (null)
DAC, Digital-to-analog converter, DAC
ADC, Analog-to-digital converter, ADC
DAC1 Playback Volume, maximum audio control value, corresponding to the corresponding registers, can modify the maximum volume output voltage;
ADC1 Capture Volume, maximum audio recording, corresponding to the corresponding registers, can modify the maximum volume output voltage;