Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 May 2020 23:48:08 -0400 (EDT)
From:      "Sean C. Farley" <scf@FreeBSD.org>
To:        freebsd-gecko@freebsd.org
Subject:   Unable to use microphone in Firefox using ALSA backend
Message-ID:  <alpine.BSF.2.22.395.2005052239330.66167@thor.farley.org>

next in thread | raw e-mail | index | archive | help
I am attempting to get the microphone on my webcam to work using ALSA in 
Firefox 76.  It used to work although I do not know when it stopped.  If 
I use ALSA with ffmpeg, the microphone does work, so I suspect it should 
be something simple that I am missing in Firefox.

My asound.conf makes use of the ASYM PCM plugin to combine the input and 
output from different devices.

/usr/local/etc/asound.conf
--------------------------
# Create slave of the sound card/speakers.
pcm_slave.oss4 {
 	pcm.type oss
 	pcm.device /dev/dsp4
 	pcm.hint.description "Open Sound System"
}

# Create slave of the webcam microphone.
pcm_slave.oss7 {
 	pcm.type oss
 	pcm.device /dev/dsp7
 	pcm.hint.description "Open Sound System"
}

# Mix webcam for input and speakers for output.
pcm.!sysdefault {
 	type asym
 	capture.pcm {
 		type plug
 		slave oss7
 	}
 	playback.pcm {
 		type plug
 		slave oss4
 	}
 	hint {
 		description "Open Sound System"
 	}
}
pcm.!default pcm.sysdefault

# There is no asym for ctl.  It would be nice to tie the controllers together
# into a single device like pcm asym does.
ctl.oss {
 	type oss
         hint {
 		description "Open Sound System"
 	}
}
ctl.!sysdefault ctl.oss
ctl.!default ctl.sysdefault
--------------------------


Notes:
- Running firefox-76.0_2,1 built locally within poudriere.
- Firefox is using ALSA according to about:support.
- Firefox is playing audio just fine.
- Firefox detects both the video (two blank lines) and microphone when a
   WebRTC session starts.  It calls the microphone "default".
- No other backend other than ALSA is installed on the system nor was
   Firefox compiled with one.
- ffmpeg is able to use the microphone with this command:
       ffmpeg -f alsa -i default test.wav
- The webcam mixer mic device is at 100.
- Muting the microphone in a WebRTC session in Jitsi Meet
   (https://meet.jit.si/) or AppRTC (https://appr.tc/) causes the tab to
   crash rather often with a signal 11.  Sometimes it freezes for a
   moment then crashes but mostly crashes instantly.
- FreeBSD 12.1-STABLE r360638.

Any suggestions?  I may have to try sndio or virtual_oss someday, but I 
figure this should still work with Firefox.

Sean
-- 
scf@FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.22.395.2005052239330.66167>