Skip to content

amixer: handle simple mixer event errors#1

Draft
orange-dot wants to merge 1 commit intomasterfrom
fix-amixer-sevents-errors
Draft

amixer: handle simple mixer event errors#1
orange-dot wants to merge 1 commit intomasterfrom
fix-amixer-sevents-errors

Conversation

@orange-dot
Copy link
Copy Markdown
Owner

Summary

  • replace the amixer sevents assertion after snd_mixer_handle_events() with normal error reporting
  • keep listening after transient simple mixer event errors
  • remove the now-unused <assert.h> include

Validation

  • git diff --check
  • manual build of amixer/amixer.c + alsamixer/volume_mapping.c against system libasound using temporary generated headers in /tmp
  • /tmp/alsa-utils-327-build/amixer scontrols
  • timeout 3s stdbuf -oL -eL /tmp/alsa-utils-327-build/amixer sevents (expected timeout exit 124, no abort)
  • timeout 3s stdbuf -oL -eL /tmp/alsa-utils-327-build/amixer events (expected timeout exit 124, unchanged raw event path)
  • PipeWire early-startup repro: patched amixer sevents printed ERR: No such file or directory (-2) and did not abort

Fixes: alsa-project#327

snd_mixer_handle_events() can return negative runtime errors while
amixer sevents is monitoring simple mixer events. This was reproduced
during early PipeWire startup, where the handler returned -ENOENT after
snd_mixer_wait() reported a ready event.

The raw control event monitor already reports analogous
snd_hctl_handle_events() errors instead of aborting. Handle simple mixer
event errors the same way so sevents reports the error and keeps
listening instead of hitting an assertion failure.

Fixes: alsa-project#327

Signed-off-by: Bojan Janjatović <bojan.janjatovic@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

amixer: amixer.c:1706: sevents: Assertion res >= 0 failed.

1 participant