Fixing pulseaudio/equalizer for normal user (spot etc)

Moderator: Forum moderators

Post Reply
User avatar
wiak
Posts: 4249
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 70 times
Been thanked: 1259 times
Contact:

Fixing pulseaudio/equalizer for normal user (spot etc)

Post 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).

Last edited by wiak on Fri Dec 23, 2022 6:42 am, edited 3 times in total.

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

User avatar
rockedge
Site Admin
Posts: 6817
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2968 times
Been thanked: 2791 times
Contact:

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

Post 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

User avatar
fredx181
Posts: 3250
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 408 times
Been thanked: 1412 times
Contact:

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

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

Last edited by fredx181 on Thu Dec 22, 2022 4:58 pm, edited 9 times in total.
User avatar
rockedge
Site Admin
Posts: 6817
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2968 times
Been thanked: 2791 times
Contact:

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

Post by rockedge »

Or click on the script in /root/Startup

User avatar
Sofiya
Posts: 2378
Joined: Tue Dec 07, 2021 9:49 pm
Has thanked: 1505 times
Been thanked: 1619 times

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

Post 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

KL-Linux
KL LINUX Simple fast free

Post Reply

Return to “KL-Dev_Work”