Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could somebody help adapt this for Pipewire? #16

Open
matthewhm opened this issue Aug 17, 2024 · 1 comment
Open

Could somebody help adapt this for Pipewire? #16

matthewhm opened this issue Aug 17, 2024 · 1 comment

Comments

@matthewhm
Copy link

I have found this script very useful. On upgrading to Linux Mint 22 this month which is using Pipewire, I get an error
No PulseAudio daemon running, or not running as session daemon then ERROR: Microphone (source) "alsa_input.pci-0000_00_0e.0.analog-stereo" was not found

which I think comes from the fact that the pacmd commands are not supported by Pipewire. I have tried replacing them with pactl commands using this chart https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Migrate-PulseAudio#pacmd but I am still getting ERROR: Microphone (source) "alsa_input.pci-0000_00_0e.0.analog-stereo" was not found, probably because the rest of the line needs to be adapted and I don't know how to do that.

If I comment out lines 19 to 27 then the script works perfectly without errors as before, but how would I adapt the script without commenting out? I am a beginner to using scripts so simple or step-by-step answers would be appreciated.

@toadjaune
Copy link
Owner

toadjaune commented Sep 17, 2024

Indeed, it looks like pacmd doesn't work with pipewire. It's probably possible to replace it directly with pactl to get similar functionality.

Lines 19 to 27 are only sanity checks though ; they aren't required, they're only used to inform the user if something is wrong with the device names. So, commenting them out as you did should be fine as a workaround.

If you want to attempt fixing them properly, in a portable way ; I'd attempt replacing the pacmd command with pactl, a quick search seems to indicate that the equivalent commands would be :

  • pactl list sinks short
  • pactl list sources short

Since the output format of those commands is slightly different, you'd need to adapt the grep filtering so that the test is considered valid only when the configured device actually exists, and errors out otherwise (as is currently the case). Considering the new format, I'd probably switch from grep to awk

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

No branches or pull requests

2 participants