Page 1 of 1

Fixing pulseaudio/equalizer for normal user (spot etc)

Posted: Mon Dec 19, 2022 11:59 pm
by wiak

Note well that I started with pristine KLV-airedale install and also did not use w_changes=RAM2 in case there were any issues with that (had some strange effects in earlier test with RAM2, but maybe just errors on my part, but better safe than sorry).

1. I booted pristine KLV, opened root terminal and entered:

Code: Select all

ps aux | grep pulse

and noted runit has pulseaudio service running. From Void Linux Pulse docs page, it seems that is not recommended: https://docs.voidlinux.org/config/media/pulseaudio.html

I thus entered command:

Code: Select all

rm /var/service/pulseaudio

and rebooted

2. After connecting to Internet, I opened root terminal and entered:

Code: Select all

xbps-install -Sy pulseaudio-equalizer-ladspa

to install it.

3. Opened root terminal and entered:

Code: Select all

usermod -a -G pulse-access spot  # this line already done in KLV rc4.1+

followed by:

Code: Select all

sudo -u spot  # in KLA and Zorin I needed to use: sudo -u spot -s
pulseaudio --daemonize=yes --exit-idle-time=-1
pulseaudio-equalizer-gtk &
firefox &

4. Visited youtube.com in that firefox spot instance and played a video.

Started Applications > Multimedia > PulseAudio Volume Control
and in Output tag made sure Speaker was active and volume set high enough.

5. Changed sliders in pulseaudio equalizer and switched enable ON and it worked.

I suggest you permanently delete runit pulseaudio service @rockedge. It appears to not only be needed, but caused extra pulseaudio service to run that interferes with above. Per Void Linux docs, xdg automatically starts pulseaudio for root user root desktop use, and per normal user pulseaudio process per above experiment seems best (though actually logging in to desktop as user spot would be an alternative and I think xdg will auto-start pulseaudio for normal user in that case too).


Re: Fixing pulseaudio/equalizer for normal user (spot etc)

Posted: Thu Dec 22, 2022 12:09 pm
by rockedge

The adjustments to the audio system configuration to setup pulseaudio are detailed here -> viewtopic.php?p=76203&sid=71dc97b7398e9 ... 909#p76203

New rearrangement of the pulseaudio setup in the system is now included in KLV-Airedale-rc4.1


Re: Fixing pulseaudio/equalizer for normal user (spot etc)

Posted: Thu Dec 22, 2022 12:49 pm
by fredx181

Now tested rc4.1 and all seems well arranged now for pulseaudio. :thumbup:
And the how-to from @wiak above works, although very inconvenient if you want to use the equalizer with different applications, e.g. I like to just click on a sound file from filemanager and open with Parole or ..., then the equalizer doesn't work
So.. here's a dirty hack :oops: for a user to make the equalizer run as root:
Open /usr/bin/pulseaudio-equalizer with texteditor, find the line (probably 10) where it checks for running as root and comment it out, so becomes:

Code: Select all

# Don't execute the script with elevated privileges
#[[ $EUID = 0 ]] && { echo "This script must not be run as root!"; exit 1; }

Or even better, to prevent that it will be overwritten with an upgrade, copy the script to /usr/local/bin and comment out that line in there.
As /usr/local/bin has priority in PATH, it will exec when running the equalizer from the Menu (and not overwritten by an upgrade), works !
(so pulseaudio is smart by preventing us to run as root, I always like to try being smarter :D )
=======================================================================================================================================
EDIT: On rc4.1 @wiak's how-to should be different I think (running equalizer and firefox as user spot), works for me if I kill pulseaudio first (as it's running from ~/Startup as root already, not from runit service.

Code: Select all

sudo -u spot
pulseaudio-equalizer-gtk &
firefox &

But after that, to be able to run pulseaudio as root, need to do pulseaudio --start from root terminal[/s]

EDIT2: Sorry, what I said in above EDIT doesn't seem to work (after second time testing), I guess it still needs the pulseaudio --daemonize=yes --exit-idle-time=-1 instead of pulseaudio --kill as in @wiak's how-to.
EDIT3, OK, Tested again, it's just that pulseaudio --daemonize=yes --exit-idle-time=-1 can be left out since pulse isn't started as a service on rc4.1 .


Re: Fixing pulseaudio/equalizer for normal user (spot etc)

Posted: Thu Dec 22, 2022 4:08 pm
by rockedge

Or click on the script in /root/Startup


Re: Fixing pulseaudio/equalizer for normal user (spot etc)

Posted: Thu Dec 22, 2022 4:42 pm
by Sofiya
fredx181 wrote: Thu Dec 22, 2022 12:49 pm

EDIT2: Sorry, what I said in above EDIT doesn't seem to work (after second time testing), I guess it still needs the pulseaudio --daemonize=yes --exit-idle-time=-1 instead of pulseaudio --kill as in @wiak's how-to.

as an option

Code: Select all

#!/bin/bash

if [ -e /usr/bin/pulseaudio ]; then
    sh -c "pulseaudio --kill > /dev/null 2>&1; pulseaudio --start --log-target=syslog"
    sleep 5
    pulseaudio-equalizer enable
fi