You are not logged in.

#1 2024-04-24 04:23:37

Gabachin
Member
Registered: 2022-05-06
Posts: 92

Problem with Alsactl

II am running vanilla Arch/i3/sddm, with pipewire, pipewire-pulse and wireplumber. I installed Arch manually, with grub not systemd. I am trying to set a default volume that persists on reboot.

I tried to set amixer to the desired volume in my .xsession because from what I read, sddm sources it. This did not work for me.

The approach I am using now is, following this thread

1). create the file

 alsactl --file ~/.config/asound.state store

2). create a .desktop

  ~/.config/autostart/alsarestore.desktop

with content
3):

[Desktop Entry]
Type=Application
Terminal=false
Name=alsarestore
Exec=bash -c 'sleep 15 ; alsactl --file ~/.config/asound.state restore'

.

This works for exactly one reboot, but then fails. I think it is because the exec command in the .desktop file does not execute unless I use sudo:

─❯ alsactl --file ~/.config/asound.state restore
alsa-lib main.c:846:(execute_sequence) exec '/bin/rm -rf /var/lib/alsa/card0.conf.d' failed (exit code 1)
╭─    ~ ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── 21:57:10 
╰─❯ sudo alsactl --file ~/.config/asound.state restore
[sudo] password for paul: 
╭─    ~ ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── 21:57:16 
╰─❯ 

So rm is trying to run but fails. Which makes sense because to remove a file from /var requires sudo. Just to check, I see that my path

─❯ groups
lp input audio wheel adm paul
╭─    ~ ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── 21:55:17 
╰─❯ echo $PATH
/home/paul/.emacs.d/bin /home/paul/.local/bin /home/paul/Applications /usr/local/sbin /usr/local/bin /usr/bin /usr/lib/jvm/default/bin /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl

look ok.

As a side note, I first tried (again by consulting the wiki https://wiki.archlinux.org/title/Advanc … E_settings) to do this by using alsa-state.service, but I am getting

─❯ systemctl status alsa-restore.service
Unit alsa-restore.service could not be found.
thread 'main' panicked at library/std/src/io/stdio.rs:1030:9:
failed printing to stdout: Broken pipe (os error 32)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

and

❯ systemctl status alsa-store.service
Unit alsa-store.service could not be found.

I thought these services were automatic with alsa-utils (which I have installed.)

How can I get this working and more importantly, where does the problem lie?

Last edited by Gabachin (2024-04-24 05:06:53)

Offline

Board footer

Powered by FluxBB