Microphone can't be accessed

Hi there, completely new to Pi & Balena so apologies if others find this obvious.

I have been following the instructions for a TV/Video chat device (https://www.balena.io/blog/put-friends-and-loved-ones-on-the-big-screen-with-this-instant-video-call-project/) and have been successful at every point bar one.

When using an MS lifecam-5000, chromium does not allow access to the inbuilt mic (message reads: failed to access your microphone cannot use microphone for unknown reason). All permissions have been granted in the settings, chromium can see the device, but all I can get is a picture (briefly it picked up some sounds although they came across very, very quiet).

Any help much appreciated,

Hi, welcome to Balena and the Forums!

Just to check, have you followed the steps in the ‘Config mode’ section of that article? Does your microphone configuration looks like the shared screenshot?

Could you try restarting the kiosk service? You can do this from the dashboard on the summary view of your device. Does the problem persist?

Does anything appear in the kiosk service logs when you try accessing the microphone in your device? You can filter the logs by service by using the ‘Add filter’.

Thanks for your help!

Thanks for getting back to me,

Yes, I have set all the permissions as described in the config mode section. I have tried several restarts, both soft and hard with no joy.

Nothing in the log to my amateur eye but I’ll stick a screen dump in:

Thanks

Hi there, we’ve only tested this project with Microsoft Lifecam 3000, but in any case if you could grant support access to the device, we can try to take a look to see if we can find anything obvious.

Thanks Guys,

I have updated the Pi’s firmware as listed in this article, Poor mouse and webcam performance, and have got the kit working on both Raspberry Pi OS and Balena, but the sound input from the mic is still to low. On Pi OS, I was able to boost the gain using the audio control panel, and hey presto, no more problems, but can’t see a way to do this in Balena.

Is there a way to do this, as this is literally the only hurdle left to using Balena now.
Thanks

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:

  1. SSH into the kiosk service on your device. This can be done either via balenaCloud’s dashboard or through the balena CLI.
  2. 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.

  1. 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.

  1. 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.

  1. 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.

So, running amixer controls gave me the same options.

Now, going into amixer cget numid=3 I had:

`root@0b2495319f53:/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=56,step=0
: values=7
| dBminmax-min=-20.00dB,max=36.00dB`

No wonder it was quiet! Boosted it up to about 30 and no problems hearing via the webcam but this then had issues with audio output and hearing other users depending on which HDMI was plugged in.

Doing a bit of extra research and I think that this webcam is just too old to work for what I am trying to do; On one boot loop I did see that the camera wasn’t initialising properly but whether this was the Pi or the cam I can’t be sure. More advanced users may have better luck figuring this out but I think I’m going to cut my loses and upgrade my web cam.

Thanks for all your help though!!!

Cool - if you do get back to using that, and make any progress, do let us know though!