You are not logged in.
Pages: 1
In my effort to reduce RAM footprint, i'm trying to eliminate services and daemons.
i believe pulse (or the pulse volume control) runs a daemon all the time. Other volume widgets i've tried do, eating 20-30MB RAM. Plus they pull in loads of deps when you install them. To me that's crazy. It's just a volume control.
So i wrote my own volume control. Instead of 20 or 30MB, it consumes exactly 0MB RAM when you're not using it. When you click the icon in the tray, the slider appears.
Alsa handles all my audio needs just fine, so i was able to uninstall pulse. This script does require yad, but yad doesn't run any daemons.
install yad and alsa-utils
determine your audio device. In my case, it's "Master":
amixer scontrols
ensure your audio device is unmuted with
amixer set Master 100 unmute
Put the script below in /usr/local/bin/set-volume.sh, make it executable, then make a launcher pointing to it.
Replace "Master" with the name of your audio device.
#!/bin/sh
VolCur=`amixer -M get Master,0 | sed -nr 's/.*\[([0-9]+)%.*/\1/p'`
yad --close-on-unfocus --scale --min-value 0 --max-value 100 --value $VolCur --print-partial --undecorated --width 300 --fixed --sticky --mouse --on-top --escape-ok --no-buttons --hide-value --timeout=4 --image=audio-volume-high --skip-taskbar --theme=Adwaita | while read VolNew
do amixer -M -q set Master,0 ${VolNew}%
done
Last edited by johnywhy (2019-09-14 18:02:54)
arch xfce x86_64
Offline
Hey, nice! I'll try it, replacing the command with a pulseaudio one¹ (as I won't remove it anyway), for my icewm session.
As for reducing unnecessary stuff, have a look at the Porteus distribution. I think it's mainly targeted to be a portable OS and they have years of experience with this.
¹ hope a layman like me can figure this port.
Last edited by kunzlata (2019-08-29 13:29:46)
Offline
Thx, I have tried Porteus. Had issues, but I don't recall the details.
I've tried lots of Linuxes. Arch is my fave. Minimal. Easier to get up and running than others.
If you're going to keep running pulse, then i'm not sure what benefit this slider will give you. Might be easier to just use their volume widget.
Cheers
Last edited by johnywhy (2019-08-29 21:07:44)
arch xfce x86_64
Offline
In my effort to reduce RAM footprint, i'm trying to eliminate services and daemons.
i believe pulse (or the pulse volume control) runs a daemon all the time. Other volume widgets i've tried do, eating 20-30MB RAM. Plus they pull in loads of deps when you install them. To me that's crazy. It's just a volume control.
So i wrote my own volume control. Instead of 20 or 30MB, it consumes exactly 0MB RAM when you're not using it. When you click the icon in the tray, the slider appears.
Alsa handles all my audio needs just fine, so i was able to uninstall pulse. This script does require yad, but yad doesn't run any daemons.
Put it in /usr/local/bin/set-volume.sh, make it executable, then make a launcher pointing to it.
#!/bin/sh VolCur=`amixer -M get Master | sed -nr 's/.*\[([0-9]+)%.*/\1/p'` yad --close-on-unfocus --scale --min-value 0 --max-value 100 --value $VolCur --print-partial --undecorated --width 300 --fixed --sticky --mouse --on-top --escape-ok --no-buttons --hide-value --timeout=4 --image=audio-volume-high --skip-taskbar --theme=Adwaita | while read VolNew do amixer -M -q set Master ${VolNew}% done
This deserves repeating. Admittedly, Pulse on my machine consumes about 1/2 a percent... but I agree with your thinking and experimentalism. Why should it be running at all if I am not actively using it?
I will try this out, as well.
Actually... I decided to just try it out while in the middle of this post. I installed yad with "sudo apt-get install yad", created the script, then the launcher, changed permissions.... and pop, instant volume control. Admittedly, the Pulseaudio plugin gives a lot more options. But I bet they are generally unnecessary.
I'll test it for about a week before i decide to uninstall pulse.
But works well.
EDIT - I spoke Too soon
It produces a visual sliding volume control... However, it always pops up set to minimum volume and has no effect on the actual volume coming out of my speakers.
Last edited by Aravisian (2019-08-29 18:03:53)
Offline
Maybe your audio device isn't Master.
What does this give you?
amixer -M get Master,0
Last edited by johnywhy (2019-08-29 18:10:06)
arch xfce x86_64
Offline
Maybe your audio device isn't Master.
What does this give you?
amixer -M get Master,0
amixer: Unable to find simple control 'Master',0
Offline
Please give results of:
amixer scontrols
Pulse on my machine consumes about 1/2 a percent... but I agree with your thinking and experimentalism.
Thx! Pulse is just one of the things i'm doing to reduce RAM and storage footprint. It all adds up
If it's only 1/2% for you, then maybe you have other much fatter stuff running (be sure to check when you don't have any user apps running).
This project isn't necessary for new PC's loaded with lots of RAM and storage, but i'm trying to achieve a lightweight desktop for older machines with very limited RAM and storage.
Last edited by johnywhy (2019-08-29 21:12:43)
arch xfce x86_64
Offline
Pages: 1
[ Generated in 0.014 seconds, 8 queries executed - Memory usage: 545.45 KiB (Peak: 546.29 KiB) ]