Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Hook-based volume setter scripts run concurrently and potentially out-of-order

オープン
#274 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
195
フォーク
39
平均マージ
10日 2時間
マージ済み PR(30日)
3

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Sendspin/sendspin-python-cli のほかの issue

Sendspin/sendspin-python-cli の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。