openairplay / airplay2-receiver

AirPlay 2 Receiver - Python implementation
2.12k stars 131 forks source link

Fix amixer bad volume argument #76

Closed xxr3376 closed 1 year ago

xxr3376 commented 1 year ago

Original implementation call amixer set PCM 50%%, and get amixer: Invalid command! on Ubuntu 22.04.

Remove extra % and set volume of Master instead of PCM, this will make airplay2 works on any linux server.

Neustradamus commented 1 year ago

@systemcrash, @LewdNeko: What do you think?

systemcrash commented 1 year ago

I cannot comment without testing, but I think the subprocess call depends on the shell used, no? Which makes me suspect the reason for the %% is that some shells interpret this as a literal %.

Under what shell did you run this change?

xxr3376 commented 1 year ago

@systemcrash subprocess.run is called with shell=False(as default argument), I believe there's no relevance with the type of shell.

To answer your question: I'm using bash.

Yuke-hd commented 1 year ago

I'm also using bash. Can confirm this patch works for me

systemcrash commented 1 year ago

I will admit this. If it causes problems later, we may need another solution.