The officially official Devuan Forum!

You are not logged in.

#1 2024-02-24 16:10:45

Iggy64
Member
Registered: 2022-04-23
Posts: 29  

Firefox-esr Audio through ALSA Alone

I am running the PeppermintOS derivative of Devuan with excellent results.  I have one lingering question concerning audio output.

I typically run all my machines using straight-ALSA audio.  None of these machines have multiple cards, nor do I run more than audio stream at any time.
So I typically do not enable PulseAudio (or any other intermediary server), as it provides nothing extra that I need.

WIth my Devuan-based system, running on bare ALSA, I have no audio output. from firefox-esr.  I am aware that Mozilla has dropped direct support for ALSA in FIrefox.  However, on Debian-based systems, I find that firefox-esr DOES allow output directly through ALSA.  Reportedly, the current Debian version of firefox-esr is compiled with --enable-alsa. 

The Devuan firefox-esr, however, does not produce audio unless I first enable PulseAudio.  That is no big deal, but I would prefer to avoid adding that extra process for just the occasional YouTube video.

I have read here conflicting reports on whether the Devuan version is compiled with --enable-alsa.  Regardless, it's not working for me.

I would welcome any suggestions on how to get direct ALSA output from firefox-esr (Devuan).  For example:

* Does the Devuan version actually use --enable-alsa?  If so, I must have some sort of conflict in my OS. What might that be?

* Can I somehow use the Debian version on my Devuan system, without borking my OS?

* Is there a way to use apulse, in  combination with ~/.asoundrc, to get audio from firefox-esr, to avoid having to enable PulseAudio?

Sure, I can just go ahead and enable Pulse.  But I have a penchant for keeping things simple, with less layers of overkill.

Thanks, in advance, for any help with this.

Offline

#2 2024-02-24 16:36:32

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,486  

Re: Firefox-esr Audio through ALSA Alone

There is no devuan version of firefox-esr. We're using the debian version along with the debian version of about 99% of everything. We only fork around a hundred packages. You should be able to get rid of pulseaudio and have sound in firefox. If you've changed any config files related to audio, you might want to check your settings and run alsamixer to make sure your sound isn't muted. This should work out of the box.

If you do need to use apulse, it's just 'apulse firefox'. No need for asoundrc. The only time I need to use apulse is if tor-browser uses audio and then I try to use audio in firefox-esr.

Offline

#3 2024-02-24 17:29:10

The-Amnesiac-Philosopher
Member
Registered: 2023-08-24
Posts: 431  

Re: Firefox-esr Audio through ALSA Alone

1. Install apulse

sudo apt install apulse

2. Open your file manager as root, got to /usr/share/applications and open the Firefox application with your text editor.
    Find the line Exec=

3. Insert apulse after the = sign in that line; such as Exec=apulse firefox...blah blah blah.

4. Save the file and close it. Then, enjoy sound on stuff n'stuff... smile

Offline

#4 2024-02-24 17:52:38

Iggy64
Member
Registered: 2022-04-23
Posts: 29  

Re: Firefox-esr Audio through ALSA Alone

Many thanks to fsmithred for that info on the Devuan repos.  I have the exact same deb version of firefox-esr on a deb-based machine, and audio is just fine with PulseAudio turned off.  So --enable-alsa is clearly included.

On my PeppermintOS-Devuan machine, I get no sound from firefox-esr without PulseAudio.  The Audacious music player works just fine directly with ALSA, with no need for PulseAudio.  So ALSA sound is configured properly.  Something is interfering with audio from firefox-esr (in the absence of PulseAudio).

I checked to see if PeppermintOS had included a ~..asoundrc or /etc/asound.config file, but neither exists.  So there is no complication from  there.

Thanks also to The Amnesiac Philosopher for your kind suggestion.

I have already tried using apulse, both from the command line and by altering the desktop launcher.  Neither approach is successful.

Hence, I remain stymied.

I will push this issue to the PeppermintOS forum, to see if there is a custom script or whatever that ties firefox-esr to PulseAudio. 

I'm glad I asked here first, though, as I really wanted to know how the firefox-esr package is compiled, and I got that answer and more.

I am very grateful for the kind responses!

Offline

#5 2024-02-24 18:20:31

aluma
Member
Registered: 2022-10-26
Posts: 646  

Re: Firefox-esr Audio through ALSA Alone

I had the same problem on Daedalus.

There are two solutions: jack audio server, or pipeware. Both work for me, it's a matter of taste.

Recently (this year smile) there was a discussion on the forum.

Offline

#6 2024-02-24 19:09:51

Iggy64
Member
Registered: 2022-04-23
Posts: 29  

Re: Firefox-esr Audio through ALSA Alone

Thanks, aluma.  I appreciate the added perspective.

Early on, I replaced PulseAudio (which came in default install) with PipeWire.  And yes, firefox-esr does produce audio when PipeWire is enabled.  Of course, pipewire-pulse is also automatically running in that situation, so no surprise in getting audio from firefox-esr.

I typically run with PipeWire disabled, in order to keep things simple and because I really have no need for its broad AV capabilities.  It's nice to know it's there should I ever need it, but I have always gotten be with good old ALSA on all my machines, over decades of time.  And I AM a music performer (acoustical) and avid listener, but one stream at a time.

Right now, I need to turn on PipeWIre if I am going to listen to a YouTube video on one of my Devuan-based PCs.  I guess I could just leave it on, but it just bugs me to do so, as I like to keep things as simple as possible.  (This is why I use the runit init.) 

Another solution, of course, is to dump Firefox; but that would hurt.  I have fine tuned it over the years, and some of its features really click with my work flow.

I'm betting I'll find a way to get firefox-esr working without PipeWire/PulseAudio.  I'll check back in here when I find that way.

Offline

#7 2024-02-26 02:10:13

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

Re: Firefox-esr Audio through ALSA Alone

Weird, I have Devuan and firefox-esr on four different systems now, and all of them work fine with bare ALSA. One thing I've noticed, though, is that the ALSA mixer on a new installation always starts out with deranged settings that give me no sound. Channels are muted, or set to zero, or multiple combinations thereof. On a new system, before I try to use audio, I add my user to the audio group, open alsamixer, max out everything, and make sure all switches are un-muted.

Offline

#8 2024-02-26 04:22:53

JWM-Kit
Member
Registered: 2020-06-29
Posts: 139  
Website

Re: Firefox-esr Audio through ALSA Alone

The-Amnesiac-Philosopher wrote:

2. Open your file manager as root, got to /usr/share/applications and open the Firefox application with your text editor.
    Find the line Exec=

3. Insert apulse after the = sign in that line; such as Exec=apulse firefox

Wouldn't the .desktop file can be overwritten with updates or reinstall? Doing it this way should prevent this and does not require root permission.

- copy the file firefox.desktop (or firefox-esr.desktop) to $HOME/.local/share/applications/
- open the newly copied desktop file into your text editor and add apulse to the start of the EXEC= line.

Offline

#9 2024-02-26 21:40:08

Iggy64
Member
Registered: 2022-04-23
Posts: 29  

Re: Firefox-esr Audio through ALSA Alone

I am the OP in this thread.  Thanks, again, to all have so kindly responded.  All of these replies have helped me learn more about Devuan, Firefox, and LInux audio.

I believe I have hit upon a satisfactory resolution of my problem with firefox-esr audio in PeppermintOS Devuan.

After much experimentation, and examining the performance of firefox-esr in various distros, I determined that firefox-esr requires an ALSA preamp in order to produce hearable sound.

This in turn requires installing libasound2-plugin-equal (equalizer and preamp) as well as alsa-utils. You then need to configure these via an /etc/asound.conf file. Not highly skilled in creating such a file myself, I took a flyer and copied one verbatim from one of my antiX machines. It worked fine (although I had to reboot a few times and play with the ALSA settings a little bit to get the preamp control to show up).

When I added about 11% preamp to my ALSA config, firefox-esr began outputting audio at levels comparable to my music players.  (This is the same preamp level that is set by default in antiX.)

So I am running my Peppermint Devuan spin on ALSA, with music players and (now) FIrefox running very well. 

Meanwhile, I have learned much from the discussion in this thread, and I am enthused that Devuan is developing such an active and cordial community.

Offline

#10 2024-02-27 15:06:37

JWM-Kit
Member
Registered: 2020-06-29
Posts: 139  
Website

Re: Firefox-esr Audio through ALSA Alone

@Iggy64 Great work!

I wonder if this has something to do with why Firefox is silent with sndio when using alsa-sndio? Firefox creates a sndio stream and you can control it. It's just silent. I'll have to test if I can use libasound's pre-amp with it.

Thanks for reporting back with your findings. I believe you've provided some useful information.

Offline

#11 2024-02-28 05:39:19

Iggy64
Member
Registered: 2022-04-23
Posts: 29  

Re: Firefox-esr Audio through ALSA Alone

@JWM-Kit Thanks for the nice feedback.  I hope you will let us know your results, if you run that test.  The more we learn, the better we can understand how these audio systems work and how to optimize our use of them.

Offline

#12 2024-02-28 09:06:44

aluma
Member
Registered: 2022-10-26
Posts: 646  

Re: Firefox-esr Audio through ALSA Alone

In my case libasound2-plugin-equal does not work.
It's not the volume, but the lack of I/O devices for Firefox.
This is with pipeware installed, if you remove it and leave only alsa, then the columns are empty and no equalizer will help.
However, there is no sound only in Firefox.
28.jpg

Offline

#13 2024-02-28 21:31:21

Iggy64
Member
Registered: 2022-04-23
Posts: 29  

Re: Firefox-esr Audio through ALSA Alone

@aluma -- Thanks for that info.  As you can probably guess, I am no expert at Linux audio.  I got my Peppermint Devuan audio running on ALSA by trial and error, and perhaps a little bit of knowledge.

The default full install of Peppermint Devuan Daedalus xfce came with PulseAudio installed and enabled.  Early on, I replaced PulseAudio with PipeWire, to make it consistent with my other distro of choice -- antiX.  Of course, PipeWire contains a version (hopefully improved) of PulseAudio in the form of pipewire-pulse.  WIth PipeWire enabled, I had audio from my music players and from Firefox. 

On any distros I have used, I have generally turned off PulseAudio (and now PipeWire) because I don't need any of the multistream mixing features and whatnot.  I listen to one thing at a time.  And I have always found pure ALSA to be the least troublesome, without the other layers piled on top of it.

So, in Peppermint Daedalus I turned off PipeWire, but left it installed in case I might need it as a future dependency or find a truly good use for it.  I try to keep unnecessary running processes to a minimum.

As expected, my music players worked wonderfully piped directly through ALSA.  However, there was no detectable sound from Firefox.  I was puzzled, as antiX is running on Debian packages, and -- in my install -- had PipeWire disabled by default.  Yet Firefox produced sound just fine in antiX. 

Looking into this, I discovered that antiX had the ALSA equalizer/preamp plugin installed by default.  So I added that to my Daedalus.  Still no sound from Firefox.
I dug further into antiX and discovered the predefined /etc/asound.conf file which configured the ALSA preamp/equalizer plugin. 

So I simply copied over this asound.conf file into Daedalus, but didn't immediately get any sound from FIrefox. Unlike in antiX, I did NOT have a preamp slider in QasMixer.  I could find no configurator in QasMixer to enable the preamp slider.  (The equalizer, however, was immediately available.)  I tried opening and closing the equalizer a few times, rebooting a couple of times, and somehow the preamp slider simply appeared (I don't know how, but I hope to find out).

Once I had the slider, I found that applying about 11% preamp produced audio from Firefox that matched levels from my music players.  This turns out to be the same level of preamp that antiX has applied by default.

I don't know whether any of this rehash is of any value to you, but I thought I'd provide it just in case it might.  I don't pretend to be an expert in this area.

If you get a working preamp control in ALSA and adding preamp does not produce sound in Firefox, then indeed you have a different issue to address, or you can simply let PipeWire/Pulse process that sound for you.

Offline

#14 2024-02-28 23:31:03

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 644  

Re: Firefox-esr Audio through ALSA Alone

my box is running with out pulseaudio as such, I do have pipewire-pulse installed and the system wants to remove everything if I try to remove pipewire-pulse... dependencies.

But I've chimed in because no one has mentioned wireplumber.

It does behave like pulse as a sound/media server, so may not be apparent if you're only running one stream at a time.

I also still use ~.xsessionrc to load the sound apps when the system starts at login to plasma/kde.

I purged my system of anything related to pulse except pipewire-pulse, and I think libpulseaudio.so

And also removed the startup scrip.

here is a copy of some notes I've kept (copied from these forums), including the ~.xsessionrc start script from this forum as well.

Those who are familiar with setting their sound card with alsa will have no problem removing pulse...and yes, I've removed it with no issues on actual installations. Just run these commands...

apt-get remove --purge pulseaudio*

apt-get remove --purge pavucontrol*

apt-get autoremove

After that, set your soundcard with alsa (if needed), reboot, and bam! Sound without pulsification! tongue big_smile
######################################################################################################################
rm -rf /usr/share/kpackage/kcms/kcm_pulseaudio /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-16.1.so /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstpulseaudio.so /usr/lib/x86_64-linux-gnu/avkys/libAudioDevice_pulseaudio.so /usr/lib/x86_64-linux-gnu/pulseaudio
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

https://dev1galaxy.org/viewtopic.php?id=2934

apt-get install aumix menu alsa-lib alsa-plugins alsa-utils
$ alsamixer
unmute channels with letter m

Ensure alsa-utils is installed.

login to terminal as root, set sound card and volumes:
=>alsamixer
F6 sound card, select "whataver appears other than default"
set master, speaker, headphone to 100% (or whatever)
exit
=>alsactl store

You may want to install a nice panel volume app: volumeicon-alsa
You may want to install a nice mixer: qasmixer

You can purge pulseaudio packages, but libpulse0* packages are required, do not remove these.   
The dependencies of Pulse with the desktop are due to installing the desktop meta-packages.  
Thus when you try to purge Pulse, it appears that it wants to remove "the desktop".  
Not going to say or recommend purging Pulse (but I do with no problems).  

When installing desktop with --no-install-recommends, you can more control what gets installed (no Pulse).   

Dont know about Firefox requirements.

I have run LXQT, XFCE, KDE successfully without Pulse (no Firefox).

EDIT: i just found another elegant mpv player that does quite the same as above similarly for firefox quantum!

https://github.com/woodruffw/ff2mpv

You can see what packages depend on a package via rdepends:

apt rdepends gstreamer1.0-pulseaudio

And you can "try-out" a purge of a package by use of the -s option, to see what would be removed along with it:

apt -s purge  gstreamer1.0-pulseaudio

apt policy pulseaudio

# check available outputs
aplay -l

ALthough it took a little while to find the answer for HDMI devices showing up before the one you wish to use, the answer is a one liner.
http://forums.debian.net/viewtopic.php?t=110572#p525601

The method I use is

E485:~$ cat /etc/modprobe.d/alsa.conf                                         
options snd-hda-intel index=1
E485:~$

It's also possible to use ~/.asoundrc to set the default card, antiX has a tool that will do this to switch cards in their PA-free desktop.

See also https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture#Alternative_method

So yeah, ALSA by itself can be a tricky little devil. Which is why PA is so omnipresent.

Really good DE such as TDE and LXDE don't depend on PA.

/home/glenn/.xsessionrc...

# kill any existing pipewire instance to restore sound
pkill -u "$USER" -fx /usr/bin/pipewire-pulse 1>/dev/null 2>&1
pkill -u "$USER" -fx /usr/bin/wireplumber 1>/dev/null 2>&1
pkill -u "$USER" -fx /usr/bin/pipewire 1>/dev/null 2>&1

exec /usr/bin/pipewire &

# wait for pipewire to start before attempting to start related daemons
while [ "$(pgrep -f /usr/bin/pipewire)" = "" ] ; do
   sleep 1
done

exec /usr/bin/wireplumber &

exec /usr/bin/pipewire-pulse &

I hope this helps


pic from 1993, new guitar day.

Offline

#15 2024-02-29 00:58:48

Iggy64
Member
Registered: 2022-04-23
Posts: 29  

Re: Firefox-esr Audio through ALSA Alone

Thank you @GlenW.  It's interesting how all these parts and pieces relate to one another, and how they can be arranged in various ways to suit different needs.
Like so many of the other experiences shared in this thread, I will definitely log your observations into my database (I use CherryTree) on Linux audio.  Remembering these real-world experiences can be very valuable somewhere down the line when new situations arise.

I'm glad that the Devuan forum is such a friendly and  helpful place.

Offline

#16 2024-02-29 12:04:39

stopAI
Member
Registered: 2023-04-04
Posts: 186  

Re: Firefox-esr Audio through ALSA Alone

rm -rf /usr/share/kpackage/kcms/kcm_pulseaudiio /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-16.1.so /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstpulseaudio.so /usr/lib/x86_64-linux-gnu/avkys/libAudioDevice_pulseaudio.so /usr/lib/x86_64-linux-gnu/pulseaudio

Hello.

I don't really understand why you need to manually remove these directories with files, if the command

apt autoremove --purge

does it?

Offline

#17 2024-02-29 13:50:15

aluma
Member
Registered: 2022-10-26
Posts: 646  

Re: Firefox-esr Audio through ALSA Alone

@Iggy64

then indeed you have a different issue to address

I've already experimented. smile
In fact, maybe my reason is my Trinity DE.
https://dev1galaxy.org/viewtopic.php?id=6118

It just probably makes sense to check the availability of I/O in Firefox (about: support in the address bar)

Last edited by aluma (2024-02-29 13:55:42)

Offline

#18 2024-03-04 19:03:28

Lomax
Member
From: United Kingdom
Registered: 2018-02-06
Posts: 76  

Re: Firefox-esr Audio through ALSA Alone

Just to contribute another data point, for me Firefox 115.7.0 ESR audio "just works" in Devuan Daedalus with Pulseaudio removed and ALSA as the only sound subsystem. And a tip to anyone who misses having a GUI volume control & mixer: install QasMixer:

IKPoH9w.png


"I cannot lie to you about your chances, but you have my sympathies."

Offline

#19 2024-03-04 21:47:39

zephyr
Member
From: as where the crow flies native
Registered: 2016-12-01
Posts: 422  
Website

Re: Firefox-esr Audio through ALSA Alone

Qasmixer (0.23.0-1) is also in the Devuan daedalus repositories!

cheers

zephyr

Last edited by zephyr (2024-03-04 22:00:46)


CROWZ
easier to light a candle, yet curse the dark instead / experience life, or simply ...merely exist / ride the serpent / molon labe / III%ers / oath keepers

Offline

#20 2024-03-04 22:36:10

Lomax
Member
From: United Kingdom
Registered: 2018-02-06
Posts: 76  

Re: Firefox-esr Audio through ALSA Alone

Yes, sorry, I should have mentioned that it's in the Devuan repo!

It's a nice app, and only uses 43kb RAM. I have added it to my XFCE session autostart, but for some reason the --tray switch is ignored so I have to manually close it (to tray) after every log-in. The minimised icon appears in the "Status Tray Plugin", so make sure that's added to the XFCE panel, or you won't see it.

I've also added keyboard shortcuts for the volume control buttons on my Thinkpad, so that they work with ALSA:

Audio raise volume:

amixer -q set Master '5%+'

Audio lower volume:

amixer -q set Master '5%-'

Audio mute:

amixer -q set Master toggle

Last edited by Lomax (2024-03-04 22:39:19)


"I cannot lie to you about your chances, but you have my sympathies."

Offline

#21 2024-03-05 00:10:26

zephyr
Member
From: as where the crow flies native
Registered: 2016-12-01
Posts: 422  
Website

Re: Firefox-esr Audio through ALSA Alone

@ Lomax;  Certainly miss the old xfce4-mixer, Void Linux had it working until recently. Qasmixer is better than being forced using  pavucontrol to get sound with Alsa.

Thanks for the tips and for bringing Qasmixer back into view!

zephyr

Last edited by zephyr (2024-03-05 00:11:27)


CROWZ
easier to light a candle, yet curse the dark instead / experience life, or simply ...merely exist / ride the serpent / molon labe / III%ers / oath keepers

Offline

#22 2024-03-05 00:47:18

Lomax
Member
From: United Kingdom
Registered: 2018-02-06
Posts: 76  

Re: Firefox-esr Audio through ALSA Alone

That prompted me to take a look. After nearly a decade of silence there was a new release of xfce4-mixer last year (4.18), with a massive changelog. Not sure what that means in terms of being able to use it with Daedalus & ALSA, but perhaps we've been missing out!?


"I cannot lie to you about your chances, but you have my sympathies."

Offline

#23 2024-03-23 19:38:47

mweishaar
Member
Registered: 2018-11-11
Posts: 36  

Re: Firefox-esr Audio through ALSA Alone

@Lomax interesting. Althogh I am on Daedalus with XFCE 4.18.1 installed, and I don't see xfce4-mixer available to install.

Offline

#24 2024-05-06 21:27:57

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

Re: Firefox-esr Audio through ALSA Alone

fsmithred wrote:

If you do need to use apulse, it's just 'apulse firefox'. No need for asoundrc. The only time I need to use apulse is if tor-browser uses audio and then I try to use audio in firefox-esr.

I do not know, what is special about Devuan, but is was difficult to find a browser, which does not work with ALSA.
Firefox, Chromium, Epiphany, Chrome, Brave, Min - everything works without apulse.
Seamonkey does need apulse to work with ALSA.

What is more, Mate sound applet works with ALSA after removal of pulseaudio, but Xfce sound applet disappeared.
Mate Desktop, is, of course, very special. If you remove PulseAudio, it will install PipeWire.
If you remove them both, it will enable ALSA for Mate apps.

$ sudo apt-mark manual libpulse0 libpulse-mainloop-glib0 libpulsedsp 
$ sudo apt-mark hold pulseaudio* pipewire* 
$ sudo apt-get purge pulseaudio pulseaudio-utils pavucontrol pulseaudio-module-bluetooth pipewire pipewire-bin pipewire-pulse
$ fuser -av $(find /dev/snd -type c 2>/dev/null)
$ killall pulseaudio
$ fuser -av $(find /dev/snd -type c 2>/dev/null)

However, if you want to use mic with Firefox (with Discord) , you do need apulse and a special ~/.asoundrc with dmix, dsnoop, etc.

apulse relies on ALSA's dmix, dsnoop, and plug plugins to handle multiple sound sources and capture streams running at the same time. dmix plugin muxes multiple playback streams; dsnoop plugin allow multiple applications to capture from a single microphone; and plug plugin transparently converts audio between various sample formats, sample rates and channel numbers.
https://github.com/i-rinat/apulse

Last edited by igorzwx (2024-05-14 13:48:36)

Offline

Board footer