Hook-based volume setter scripts run concurrently and potentially out-of-order
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 52/100
Línea de trabajo
Start by tracing volume handling in the daemon from the hook-based volume setter, then reproduce the issue by rapidly changing the volume with the slider. Check how concurrent hook calls are scheduled and ordered. Done means each requested volume, especially the final value, invokes the hook reliably and in the correct order.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
It seems the hook-based volume setting command is sometimes not run.
In my setup, I run sendspin in a systemd unit via uvx:
uvx [email protected] daemon --audio-device=mydevice --hook-set-volume /usr/local/bin/set-alsa-volume.sh --name "myname" --id myid --disable-mpris --port 12345
My set-alsa-volume.sh script looks like this:
#!/bin/sh
exec systemd-cat -t "sendspin-triggered-amixer" amixer -D "$ALSA_DEVICE" sset "$ALSA_MIXER_CTL" "$1"%
(Note: The systemd-cat command ensures the output of the amixer command is sent to the journal of the sendspin systemd unit.)
Here's an example I managed to log where an expected call of the script does not occur:
Aug 04 14:36:10 server uvx[3235267]: INFO:sendspin.daemon.daemon:Server set player volume: 43%
Aug 04 14:36:10 server sendspin-triggered-amixer[294409]: Simple mixer control 'Master',0
Aug 04 14:36:10 server sendspin-triggered-amixer[294409]: Capabilities: volume cswitch
Aug 04 14:36:10 server sendspin-triggered-amixer[294409]: Playback channels: Front Left - Front Right
Aug 04 14:36:10 server sendspin-triggered-amixer[294409]: Capture channels: Front Left - Front Right
Aug 04 14:36:10 server sendspin-triggered-amixer[294409]: Limits: -50 - 100
Aug 04 14:36:10 server sendspin-triggered-amixer[294409]: Front Left: 14 [43%] [-25.80dB] Capture [on]
Aug 04 14:36:10 server sendspin-triggered-amixer[294409]: Front Right: 14 [43%] [-25.80dB] Capture [on]
Aug 04 14:36:11 server uvx[3235267]: INFO:sendspin.daemon.daemon:Server set player volume: 46%
Aug 04 14:36:11 server sendspin-triggered-amixer[294411]: Simple mixer control 'Master',0
Aug 04 14:36:11 server sendspin-triggered-amixer[294411]: Capabilities: volume cswitch
Aug 04 14:36:11 server sendspin-triggered-amixer[294411]: Playback channels: Front Left - Front Right
Aug 04 14:36:11 server sendspin-triggered-amixer[294411]: Capture channels: Front Left - Front Right
Aug 04 14:36:11 server sendspin-triggered-amixer[294411]: Limits: -50 - 100
Aug 04 14:36:11 server sendspin-triggered-amixer[294411]: Front Left: 19 [46%] [-24.30dB] Capture [on]
Aug 04 14:36:11 server sendspin-triggered-amixer[294411]: Front Right: 19 [46%] [-24.30dB] Capture [on]
Aug 04 14:36:14 server uvx[3235267]: INFO:sendspin.daemon.daemon:Server set player volume: 78%
Aug 04 14:36:14 server sendspin-triggered-amixer[294526]: Simple mixer control 'Master',0
Aug 04 14:36:14 server sendspin-triggered-amixer[294526]: Capabilities: volume cswitch
Aug 04 14:36:14 server sendspin-triggered-amixer[294526]: Playback channels: Front Left - Front Right
Aug 04 14:36:14 server sendspin-triggered-amixer[294526]: Capture channels: Front Left - Front Right
Aug 04 14:36:14 server sendspin-triggered-amixer[294526]: Limits: -50 - 100
Aug 04 14:36:14 server sendspin-triggered-amixer[294526]: Front Left: 67 [78%] [-9.90dB] Capture [on]
Aug 04 14:36:14 server sendspin-triggered-amixer[294526]: Front Right: 67 [78%] [-9.90dB] Capture [on]
Aug 04 14:36:16 server uvx[3235267]: INFO:sendspin.daemon.daemon:Server set player volume: 68%
<expected call of set-alsa-volume.sh does not occur here>
The example was produced by quickly changing the volume many times in the Music-Assistant web UI using the volume slider. The last setting (68%) does not result in a corresponding call of the volume setter hook.
Could the problem be a race condition between some internal state that represents the current volume and some check that decides whether to call the script?
EDIT: I've changed the title of the issue to better reflect the findings in my additional comment below.
- Lenguaje dominante
- Python
- Estrellas
- 193
- Forks
- 37
- Merge medio
- 11 d 19 h
- PR fusionados (30 d)
- 2
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Sendspin/sendspin-python-cli
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Sendspin/sendspin-python-cli#280 · 1 comentario · 1 reacción ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Sendspin/sendspin-python-cli#278 · 2 comentarios · 5 reacciones ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Sendspin/sendspin-python-cli#257 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Sendspin/sendspin-python-cli#256 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Sendspin/sendspin-python-cli#113 · 10 comentarios ·
Todos los issues de Sendspin/sendspin-python-cli
Issues similares
-
adr
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
kristofdegrave/homeassistant-smart-charging#1607 ·
Los mantenedores suelen responder en 1 día
-
namespace operations
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
EclipseFdn/open-vsx.org#13665 ·
Los mantenedores suelen responder en 1 día
-
doc good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
collective/icalendar#1865 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
canonical/opentelemetry-collector-operator#409 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
mozilla/addons-release-tests#1243 ·
Los mantenedores suelen responder en 1 día