Hi there, I think we can increase the microphone gain through ALSA controls. I just tried it with my setup which uses a Logitech C920 and it works just fine. I’ll share instructions to test it then if this works we can discuss how to make this changes permanent.
Here is what you need to do:
- SSH into the
kiosk service on your device. This can be done either via balenaCloud’s dashboard or through the balena CLI.
- In the
kiosk service, install ALSA utils package by running apt-get update && apt-get install alsa-utils
Now we need to figure out how to modify the microphone’s gain. We are going to use amixer to achieve that.
- First run
amixer controls to see what’s the numid of the mic’s gain. Here is the output in my case:
root@83e816d2bd8a:/usr/src/app# amixer controls
numid=4,iface=CARD,name='Keep Interface'
numid=2,iface=MIXER,name='Mic Capture Switch'
numid=3,iface=MIXER,name='Mic Capture Volume'
numid=1,iface=PCM,name='Capture Channel Map’
As you can see numid=3 seems to control the microphone’s capture volume. In your case it might be different.
- Run
amixer cget numid=3 to get details on the capture volume (where 3 is the numid from step 1). Again, output in my case:
root@83e816d2bd8a:/usr/src/app# amixer cget numid=3
numid=3,iface=MIXER,name='Mic Capture Volume'
; type=INTEGER,access=rw---R--,values=1,min=0,max=15,step=0
: values=11
| dBminmax-min=20.00dB,max=50.00dB
Here we can see that volume is set to 11 and can go all the way up to a max of 15.
- Finally, increase the mic’s capture volume by running
amixer cset numid=3 15, where 3 is the capture volume numid and 15 is the desired volume (adjust this value based on the max value your system reports). Output shows the change took place:
root@83e816d2bd8a:/usr/src/app# amixer cset numid=3 15
numid=3,iface=MIXER,name='Mic Capture Volume'
; type=INTEGER,access=rw---R--,values=1,min=0,max=15,step=0
: values=15
| dBminmax-min=20.00dB,max=50.00dB
This should inmediatly increase the microphone’s gain. If you notice this improves your setup let us know and we can work on a way to make this changes permanent. By running this commands via SSH the changes will be lost everytime you reboot or restart the kiosk service.