Forums › Reference, Evaluation, and Development Boards › OSD32MP1-RED › How to Config Alsa Mixer Controls for a DFSDM Sound Card
Tagged: ALSA, DFSDM, Microphone
We’ve successfuly configured a digital Microphone on our custom board (based on OSD32MP1-RED) as a “STM32MP15DK” dfsdm sound card and able to record audio using “arecord” command. The recorded audio volume is very low and we find no way to increase it.
We added the /etc/asound.conf file
The contents of amixer utility are empty.
The /var/lib/alsa/asound.state configuration file is also empty.
There is no STM32MP15DK card specific alsa-lib configuration file “STM32MP15DK.conf” in /usr/share/alsa/cards/ directory as stated in Soundcard_configuration wiki
How do we assign the “amixer” contents for the STM32MP15DK dfsdm sound card to modify the audio recording volume.
Here are some of the audio commands output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | debian@device-1293a743:~$ sudo arecord -v -r 16000 -f S16_LE -d 20 sound_S16_16khz.wav Recording WAVE 'sound_S16_16khz.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono Plug PCM: Hardware PCM card 0 'STM32MP15-DK' device 0 subdevice 0 Its setup is: stream : CAPTURE access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 1 rate : 16000 exact rate : 16000 (16000/1) msbits : 16 buffer_size : 6144 period_size : 1024 period_time : 64000 tstamp_mode : NONE tstamp_type : MONOTONIC period_step : 1 avail_min : 1024 period_event : 0 start_threshold : 1 stop_threshold : 6144 silence_threshold: 0 silence_size : 0 boundary : 1610612736 appl_ptr : 0 hw_ptr : 0 debian@device-1293a743:~$ debian@device-1293a743:~$ ls -al *.wav -rw-r--r-- 1 root root 640044 Mar 20 20:55 sound_S16_16khz.wav debian@device-1293a743:~$ => Volume is very low in this audio debian@device-1293a743:~$ sudo arecord -l **** List of CAPTURE Hardware Devices **** card 0: STM32MP15DK [STM32MP15-DK], device 0: 4400d000.dfsdm:filter@0:dfsdm-dai-dmic-hifi dmic-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 debian@device-1293a743:~$ debian@device-1293a743:~$ sudo arecord -L null Discard all samples (playback) or generate zero samples (capture) default mic hw:CARD=STM32MP15DK,DEV=0 STM32MP15-DK, Direct hardware device without any conversions plughw:CARD=STM32MP15DK,DEV=0 STM32MP15-DK, Hardware device with all software conversions sysdefault:CARD=STM32MP15DK STM32MP15-DK, Default Audio Device dsnoop:CARD=STM32MP15DK,DEV=0 STM32MP15-DK, Direct sample snooping device debian@device-1293a743:~$ debian@device-1293a743:~$ sudo amixer -v amixer version 1.2.4 debian@device-1293a743:~$ debian@device-1293a743:~$ sudo amixer debian@device-1293a743:~$ debian@device-1293a743:~$ sudo amixer scontrols debian@device-1293a743:~$ debian@device-1293a743:~$ sudo amixer scontrols debian@device-1293a743:~$ debian@device-1293a743:~$ sudo amixer scontents debian@device-1293a743:~$ debian@device-1293a743:~$ sudo amixer controls debian@device-1293a743:~$ debian@device-1293a743:~$ sudo amixer contents debian@device-1293a743:~$ debian@device-1293a743:~$ cat /var/lib/alsa/asound.state state.STM32MP15DK { control { } } debian@device-1293a743:~$ debian@device-1293a743:~$ cat /etc/asound.conf pcm.!default { type asym capture.pcm "mic" } pcm.mic { type plug slave { pcm "hw:0,0" } } debian@device-1293a743:~$ debian@device-1293a743:~$ sudo alsactl -v alsactl version 1.2.4 debian@device-1293a743:~$ debian@device-1293a743:~$ cat /sys/bus/iio/devices/iio:device9/name dfsdm-pdm0 debian@device-1293a743:~$ debian@device-1293a743:~$ ls -al /usr/share/alsa/cards/STM32*.conf ls: cannot access '/usr/share/alsa/cards/STM32*.conf': No such file or directory debian@device-1293a743:~$ Any help is much appreciated. /Farid. |
Hey Farid,
My apologies for the delayed response. Did you take a look at the sound card configuration files from meta-st-stm32mp here: https://github.com/STMicroelectronics/meta-st-stm32mp/tree/kirkstone/recipes-bsp/alsa?
Since you are using the DFSDM interface same as STM32MP157C-EV1, I would look at what the STM32MP157C-EV1 is using for the configuration files that are missing in your system.
Best,
Neeraj
Octavo Systems LLC all rights reserved
OCTAVO is registered in the U.S. Patent and Trademark Office. OSD, C-SiP, and the Octavo Logo are trademarks of Octavo Systems LLC.
"*" indicates required fields
"*" indicates required fields
"*" indicates required fields
"*" indicates required fields