Open py5 opened 6 years ago
I, for example, use scripts to switch between headphones (HDMI) and speakers (internal audio)
What does that even mean? Switch what?
I'm using pactl set-card-profile
to switch between two card profiles, pci-builtin and usb-headphones.
Every time I call this script, pnmixer's volume up/volume down functionality stops working for the new card.
This persists, waiting for 10 secs doesn't help. I need to press on "Reload Sound" to fix it.
Although behaves properly when I switch back to the old card.
@hasufell , I mean this, via shell script or command line...
# Set output to HDMI (headphones)
pacmd set-card-profile 0 output:hdmi-stereo+input:analog-stereo
# Set output to Analog (speakers)
pacmd set-card-profile 0 output:analog-stereo+input:analog-stereo
When I switch between those two card profiles, pnmixer doesn't detects the change, and I need reload it manually, or via script with...
killall pnmixer && pnmixer
If there was an option to reload it, for example a "--reload" parameter, or if the change of the audio output was auto-detected, it would be great!
^ Your code above seems more than enough for me! This is a PulseAudio compatibility problem, you should probably tag it with "pulseaudio"...
@stratosjack , the point is that I know that pulseudio support "needs to be implemented from scratch and will likely not happen", and the "Reload Sound" menu entry functionality is already implemented and works. That's why I'd just like to have this as an option from CL/script instead of clicking.
If there was an option to reload it, for example a "--reload" parameter
I don't really know what that means. You want to spawn a second pnmixer instance? Otherwise you are asking for a non-trivial dbus interface.
That's why I'd just like to have this as an option from CL/script instead of clicking.
This is too vague to be implementable. How would it work?
@hasufell
Forgive my ignorance, I'm not good at C++ or Kernel coding, but
my opinion is that audio_should_reload()
on soundcard change.
But then again, this is a pa event, didn't say it is trivial.
I don't think its a feature here, rather more like a pa bug.
Well, as stated above, there are only two possibilities:
Maybe we could also hijack unix signaly, but they are asynchronous too and need some odd hacks to make work with gtk+ via pipes or something, see http://askra.de/software/gtk-signals/x2992.html if you want to give that a shot. Then you could do something like kill -SIGUSR1 <pnmixer-pid>
.
Hi, pnmixer is great, but it'd be even better if it were possible reload sound from scripts and terminal commands. Many Openbox/Tint2 users use scripts to control it's features, including audio. I, for example, use scripts to switch between headphones (HDMI) and speakers (internal audio), and have to kill and restart PNMixer every time I do that.