The officially official Devuan Forum!

You are not logged in.

#1 2025-11-14 22:00:29

bai4Iej2need
Member
From: Ortenau
Registered: 2021-04-25
Posts: 140  

debug firefox-esr microfone sound

with zoom.us test conference the loudspeaker works but the micro not.
Micro selection in zoom has only one choice, which is the one not working.
Microphone works in chromium zoom conference and in alsa loopback

devuan daedalus
only alsa, no pipewire, no pulseaudio. No other sound servers.
firefox-esr                             
Version: 140.5.0esr-1~deb12u1

Edit : desktop mate 1.26.0

where to start?

Last edited by bai4Iej2need (2025-11-15 10:15:15)


The devil, you know, is better than the angel, you don't know. by a British Citizen, I don't know too good.
One generation abandons the enterprises of another like stranded vessels. By Henry David Thoreau, WALDEN, Economy. Line 236 (Gutenberg text Version)
broken by design :
https://bugs.debian.org/cgi-bin/bugrepo … bug=958390

Offline

#2 2025-11-15 10:10:01

stultumanto
Member
Registered: 2023-12-12
Posts: 105  

Re: debug firefox-esr microfone sound

Did you check the mixer? The Mic channel is often muted (or set to 0 volume) when you first set up a new system with ALSA. I'm not sure what desktop you're using, but you should be able to at least open alsamixer in a terminal and check the mic channel.

Offline

#3 2025-11-15 10:16:13

bai4Iej2need
Member
From: Ortenau
Registered: 2021-04-25
Posts: 140  

Re: debug firefox-esr microfone sound

alsamixer : all channels are open.
no, as mic works in chromium and loopback, problem is with interface to firefox-esr and librewolf.

Last edited by bai4Iej2need (2025-11-15 10:17:03)


The devil, you know, is better than the angel, you don't know. by a British Citizen, I don't know too good.
One generation abandons the enterprises of another like stranded vessels. By Henry David Thoreau, WALDEN, Economy. Line 236 (Gutenberg text Version)
broken by design :
https://bugs.debian.org/cgi-bin/bugrepo … bug=958390

Offline

#4 2025-11-15 10:36:10

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,522  

Re: debug firefox-esr microfone sound

For some firefox version I had to introduce a "dsnoop" pcm on the capture side, so that it could handle multiple concurrent accesses to the microphone. It appeared to be that firefox opened the microphone device before forking and thereby ended up in access contention with itself; the "dsnoop" pcm allows the microphone to be shared.

It resulted in a few pcm declarations in ~/.asoundrc:

pcm.!default {
    type plug
    slave {
        pcm splitter
        rate 48000 ; channels 2
    }
}
pcm.splitter {
    type asym
    playback.pcm plughw
    capture.pcm mic
}

# The "mic" PCM adds "dsnoop" to source opening, which allows a single
# source be used by many "consuming processes". This is required by
# firefox, which otherwise locks out itself from using the microphone.
pcm.mic {
    type dsnoop
    ipc_key 5
    ipc_key_add_uid false
    slave {
        pcm "hw:0,0"
        period_size 2048 ; buffer_size 16384
        periods 0 ; period_time 0
        format S16_LE ; rate 48000 ; channels 2
    }
}

Something like that; it was a while ago and I'm not totally sure about it.

Offline

#5 2025-11-15 12:37:51

igorzwx
Member
Registered: 2024-05-06
Posts: 397  

Re: debug firefox-esr microfone sound

Ralph, haven't you noticed that Debian/Devuan has already both dmix and dsnoop enabled by default?

Debian Wiki:
Advanced features such as mixing should already be configured with sane defaults.
_https://wiki.debian.org/ALSA#Configuration

Try this command:

grep -r "defaults.pcm.dmix.rate" /usr/share/alsa/

Last edited by igorzwx (2025-11-15 12:38:35)

Offline

#6 2025-11-15 22:13:58

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,522  

Re: debug firefox-esr microfone sound

Yes I noticed you mentioned that some while ago (and has verified on my system).

I still needed the setup on that (daedalus) system, so thought to mention it. Baybe it rather was the S16_LE setting for the microphone that made the difference, or the 48k sampling (?) I'm not sure.

Offline

#7 2025-11-15 22:40:16

igorzwx
Member
Registered: 2024-05-06
Posts: 397  

Re: debug firefox-esr microfone sound

Do you need a fully functional ALSA software mixer? For example:

$ cat ~/.asoundrc
# ALSA library configuration file managed by arateconf.
#
# MANUAL CHANGES TO THIS FILE WILL BE OVERWRITTEN!
#
# Manual changes to the ALSA library configuration should be implemented
# by editing the ~/.asoundrc file, not by editing this file.

#=====================================================
# Configuration for system
#-----------------------------------------------------

# Perform dmixer
pcm.dmixer_system
{
	type			dmix
	ipc_key			1024
	ipc_perm		0666

	hint
	{
		show		off
		description	"Direct mixing of multiple audio streams (system)"
	}

	slave
	{
		pcm		"hw:system,0"

		rate		48000
		channels	2
		format		S16_LE

		period_size	1920
		buffer_size	7680
	}
}

# Perform dsnooper
pcm.dsnooper_system
{
	type			dsnoop
	ipc_key			1025
	ipc_perm		0666

	hint
	{
		show		off
		description	"Recording from the same device for several applications simultaneously (system)"
	}

	slave
	{
		pcm		"hw:system,0"

		rate		48000
		format		S16_LE

		period_size	1920
		buffer_size	7680
	}
}

# Perform duplex
pcm.duplex_system
{
	type			asym
	playback.pcm		"dmixer_system"
	capture.pcm		"dsnooper_system"

	hint
	{
		show		off
		description	"Full duplex for simultaneous playback and recording (system)"
	}
}

# Perform convert
pcm.convert_system
{
	type			rate
	converter		fftrate

	hint
	{
		show		off
		description	"Sample rate converter (system)"
	}

	slave
	{
		pcm	"duplex_system"
		rate	48000
		format	S16_LE
	}
}

# Perform plug device
pcm.primary_system
{
	type			plug
	slave.pcm		"convert_system"
	hint.description	"Default device (system)"
}

#=====================================================
# Configuration for PCH
#-----------------------------------------------------

# Perform dmixer
pcm.dmixer_PCH
{
	type			dmix
	ipc_key			1026
	ipc_perm		0666

	hint
	{
		show		off
		description	"Direct mixing of multiple audio streams (PCH)"
	}

	slave
	{
		pcm		"hw:PCH,0"

		rate		192000
		channels	2
		format		S32_LE

		period_size	7680
		buffer_size	30720
	}
}

# Perform dsnooper
pcm.dsnooper_PCH
{
	type			dsnoop
	ipc_key			1027
	ipc_perm		0666

	hint
	{
		show		off
		description	"Recording from the same device for several applications simultaneously (PCH)"
	}

	slave
	{
		pcm		"hw:PCH,0"

		rate		192000
		format		S32_LE

		period_size	7680
		buffer_size	30720
	}
}

# Perform duplex
pcm.duplex_PCH
{
	type			asym
	playback.pcm		"dmixer_PCH"
	capture.pcm		"dsnooper_PCH"

	hint
	{
		show		off
		description	"Full duplex for simultaneous playback and recording (PCH)"
	}
}

# Perform convert
pcm.convert_PCH
{
	type			rate
	converter		fftrate

	hint
	{
		show		off
		description	"Sample rate converter (PCH)"
	}

	slave
	{
		pcm	"duplex_PCH"
		rate	192000
		format	S32_LE
	}
}

#=====================================================
# Configuration for default audio device
#-----------------------------------------------------

# Perform plug device
pcm.!default
{
	type			plug
	slave.pcm		"convert_PCH"
	hint.description	"Default device"
}
$ cat /proc/asound/cards
 0 [system         ]: USB-Audio - iMic USB audio system
                      Griffin Technology, Inc iMic USB audio system at usb-0000:00:1a.0-1.3.4, full s
 1 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xf7e10000 irq 31

Firefox has cubeb inside

libcubeb - Cross-platform Audio I/O Library
_https://github.com/mozilla/cubeb

All backends are still buggy, except for the backend for CoreAudio (macOS).
A standalone cubeb is easy to compile with CMake and ninja. You can debug ALSA backend.

Zoom app works with ALSA, provided that you have a fully functional software mixer.
But Discord should be used with apulse

apulse discord

Last edited by igorzwx (2025-11-15 23:02:32)

Offline

#8 2025-11-15 23:53:54

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,522  

Re: debug firefox-esr microfone sound

That's a great .asoundrc example. Though you could have omitted "primary_system" tree which most likely will confuse the casual reader smile

I suggest the OP should only consider the part following # Configuration for PCH.

You, the reader, may however note the similarities between the "default" tree and the "primary_system" tree (which targets the USB sound card), and pay attention to the differences in their sample rates and bit sizes (48k, 16 bits versus 192k, 32 bits). In both cases rate conversions are handled by fftrate which @igorzwx introduced us to last year.

See e.g, https://dev1galaxy.org/viewtopic.php?id=7142 or search fftrate on the forum. We are still longing for a debian packaging of this.

Offline

#9 Yesterday 05:43:26

stultumanto
Member
Registered: 2023-12-12
Posts: 105  

Re: debug firefox-esr microfone sound

If anyone else has been looking for the documentation for the .asoundrc format, I found it at the official ALSA wiki. It was kind of buried in a half-broken list of links on the Documentation page. If that link ever goes down, there's also an archive here. It would be nice if .asoundrc actually had a man page, like xorg.conf, and many other system configuration files.

Offline

#10 Today 10:25:12

bai4Iej2need
Member
From: Ortenau
Registered: 2021-04-25
Posts: 140  

Re: debug firefox-esr microfone sound

@rrq

my current /etc/asound.conf is :

defaults.pcm.!card PCH
defaults.ctl.!card PCH

Is the here https://dev1galaxy.org/viewtopic.php?pid=59668#p59668 proposed solution an addition to that setting ?

thx


The devil, you know, is better than the angel, you don't know. by a British Citizen, I don't know too good.
One generation abandons the enterprises of another like stranded vessels. By Henry David Thoreau, WALDEN, Economy. Line 236 (Gutenberg text Version)
broken by design :
https://bugs.debian.org/cgi-bin/bugrepo … bug=958390

Offline

#11 Today 11:14:58

igorzwx
Member
Registered: 2024-05-06
Posts: 397  

Re: debug firefox-esr microfone sound

Set defaults in ~/.asoundrc:

$ cat ~/.asoundrc 
defaults.pcm.!card PCH
defaults.ctl.!card PCH

and run

apulse firefox
$ apt-cache search apulse
apulse - PulseAudio emulation for ALSA

Debug (logging):

with apulse

MOZ_LOG="cubeb:5" apulse firefox 2>&1 about:support

without apulse

MOZ_LOG="cubeb:5" firefox 2>&1 about:support

Last edited by igorzwx (Today 11:59:32)

Offline

#12 Today 12:46:26

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,522  

Re: debug firefox-esr microfone sound

@bai4Iej2need yes it would be in addition. Your settings defines the CARD "variable" and it thus applies separately and together.

Though, as @igorzwx noted, the default setup might already have dsnoop and dmix.

Offline

#13 Today 12:53:30

igorzwx
Member
Registered: 2024-05-06
Posts: 397  

Re: debug firefox-esr microfone sound

Full duplex is also enabled by default with asym  in /usr/share/alsa/cards/HDA-Intel.conf

MOZ_LOG="cubeb:5" should show

        Type:	input
	State:	enabled

DMIX IS ENABLED by default.

Remove your ALSA config, play audio from two sources at once, and you’ll hear the default dmix quietly doing its job. When using multiple sound cards, setting defaults.pcm.!card and defaults.ctl.!card in ~/.asoundrc ensures ALSA directs audio and control to the correct device. Without this, removing your config may cause ALSA to default to a different card — potentially making sound "disappear." Use the card’s name (e.g., PCH) or index to lock the default.

Last edited by igorzwx (Today 13:27:19)

Offline

#14 Today 15:28:23

igorzwx
Member
Registered: 2024-05-06
Posts: 397  

Re: debug firefox-esr microfone sound

Firefox with apulse

Firefox pulse-rust → apulse → ALSA   Input is ENABLED  Roundtrip latency 162.86ms (18.90)
$ MOZ_LOG="cubeb:5" apulse firefox 2>&1 about:support
...
	Type:	output
	State:	enabled
...
	Type:	input
	State:	enabled
	Maximum channels:	2
	Format:	S16LE S16BE F32LE F32BE (0x3030) (default: S16LE)
	Rate:	[1, 384000] (default: 44100)
	L

about:support

Name 	Firefox
Version 	140.5.0esr
Build ID 	20251106203603
...
Audio Backend	pulse-rust
Max Channels	2
Preferred Sample Rate	44100
Roundtrip latency (standard deviation)	162.86ms (18.90)

Firefox with ALSA without apulse

Firefox → ALSA   NOTHING about Input   Roundtrip latency ?
$ MOZ_LOG="cubeb:5" firefox 2>&1 about:support
...
	Type:	output
	State:	enabled
	Maximum channels:	10000
	Format:	S16LE (0x10) (default: S16LE)
	Rate:	[48000, 48000] (default: 48000)
	Latency: lo 0 frames, hi 0 frames

# NOTHING about Input

about:support

Name 	Firefox
Version 	140.5.0esr
Build ID 	20251106203603
...
Audio Backend	alsa
Max Channels	10000
Preferred Sample Rate	48000
Roundtrip latency (standard deviation)	NaNms (NaN)

Défault ALSA config, only one soundcard iMic USB

You can file a bug to Firefox (CUBEB's ALSA backend)

Last edited by igorzwx (Today 15:37:44)

Offline

Board footer