Skip to content

fix: (re)read pipewire nodes if empty#2

Merged
Katacc merged 2 commits into
Katacc:mainfrom
nohn:fix/refresh-id-if-empty
Dec 22, 2025
Merged

fix: (re)read pipewire nodes if empty#2
Katacc merged 2 commits into
Katacc:mainfrom
nohn:fix/refresh-id-if-empty

Conversation

@nohn
Copy link
Copy Markdown
Contributor

@nohn nohn commented Dec 22, 2025

pw-dump was only executed on pw-mixer start. so pipewire nodes had be active pw-mixer start to be recognized.

so

  1. start pw-mixer
  2. start google chrome

resulted in the fader for google chrome not working

this pr fixes this by re-reading the config if idX.isEmpty()

pw-dump was only executed on pw-mixer start. so pipewire nodes had be
active pw-mixer start to be recognized.

so

1. start pw-mixer
2. start google chrome

resulted in the fader for google chrome not working

this pr fixes this by re-reading the config if idX.isEmpty()
@nohn
Copy link
Copy Markdown
Contributor Author

nohn commented Dec 22, 2025

Not nice about this PR: It tries to re-read the config on each MIDI message, so if a MIDI fader is moved from 0 to 127 while the id being empty, config is re-read 127 times

@nohn
Copy link
Copy Markdown
Contributor Author

nohn commented Dec 22, 2025

As a side note: Source comments say, such an update happens every 100 MIDI messages, but I couldn't find an implementation of this. Instead of trying to fix that, I implemented this PR which IMHO is a more efficient approach.

@Katacc
Copy link
Copy Markdown
Owner

Katacc commented Dec 22, 2025

I removed the automatic pw-dump at some release and added a keybind for CYCLE key to trigger manual pw-dump to avoid high latency on changing volumes. Ill look at this implementation when I got time

@nohn
Copy link
Copy Markdown
Contributor Author

nohn commented Dec 22, 2025

To clarify: This is not about deliberate changes to the config, for that the manual reload via cycle button is a perfect solution. This is about the pipewire node.name not being present in certain (not so uncommon) conditions, so fetching the ID fails:

Variant 1:

  1. A software configured in pw-mixer (for example scrcpy) hasn't been started yet: $ pw-dump | grep node.name | grep -i scrcpy =>
  2. As a consequence, id for the configured fader is empty

Variant 2:

  1. A software (I guess it's not all software behaving like this, but for example Google Chrome or Microsoft Edge do) is not currently playing audio when pw-mixer started:
user@host:~ $ pw-dump | grep node.name | grep -i chrome
user@host:~ $ pw-dump | grep application.name | grep -i chrome
        "application.name": "Google Chrome input",

vs

user@host:~ $ $ pw-dump | grep node.name | grep -i chrome
        "node.name": "Google Chrome",
user@host:~ $ pw-dump | grep application.name | grep -i chrome
        "application.name": "Google Chrome input",
        "application.name": "Google Chrome",
        "application.name": "Google Chrome",
  1. As a consequence, id for the configured fader is empty

Without my PR it's like this:
Screencast from 2025-12-22 16-35-55.webm
And yes, this can be fixed by pressing the "cycle" button.

With my PR it's like this:
Screencast from 2025-12-22 16-37-52_opt.webm

@Katacc Katacc merged commit 6f62df4 into Katacc:main Dec 22, 2025
1 check passed
@nohn nohn deleted the fix/refresh-id-if-empty branch December 27, 2025 20:10
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.

2 participants