I'm seeing this assertion error if I run amixer sevents very soon after pipewire daemon startup:
$ amixer sevents
Ready to listen...
Poll ok: 0
amixer: amixer.c:1706: sevents: Assertion `res >= 0` failed.
Aborted (core dump)
Background: I'm trying to mute the speaker during an automated Ubuntu 26.04 LTS desktop installation process. I don't know what the best approach is, but what I settled on is to write a curting early-command that creates a /home/ubuntu/.config/systemd/user/mute-sound.service that runs a little shell script during GUI sesison startup, with an After=pipewire.socket, so that amixer can talk to the default sound card (which is 'pipewire'). This happens a bit too early (amixer prints amixer: Unable to find simple control 'Master',0), so I've added a wait loop that looks like this:
stdbuf -oL amixer sevents | while IFS= read -r line; do case "$line" in "event add: 'Master',0") amixer set Master mute; exit;; esac; done
and, well, this one gets me the above-mentioned assertion error.
Adding a sleep 1 before I invoke amixer sevents makes the assertion go away and then the muting works (but the exit doesn't terminate the bash pipeline and leaves amixer sevents running forever, or until the end of the autoinstall session, which is not a problem for me).
I'm testing all of this inside a Hyper-V virtual machine, for reasons.
I'm seeing this assertion error if I run
amixer seventsvery soon after pipewire daemon startup:Background: I'm trying to mute the speaker during an automated Ubuntu 26.04 LTS desktop installation process. I don't know what the best approach is, but what I settled on is to write a curting early-command that creates a /home/ubuntu/.config/systemd/user/mute-sound.service that runs a little shell script during GUI sesison startup, with an After=pipewire.socket, so that amixer can talk to the default sound card (which is 'pipewire'). This happens a bit too early (amixer prints
amixer: Unable to find simple control 'Master',0), so I've added a wait loop that looks like this:and, well, this one gets me the above-mentioned assertion error.
Adding a
sleep 1before I invokeamixer seventsmakes the assertion go away and then the muting works (but the exit doesn't terminate the bash pipeline and leaves amixer sevents running forever, or until the end of the autoinstall session, which is not a problem for me).I'm testing all of this inside a Hyper-V virtual machine, for reasons.