re-set xfce4-pulseaudio-plugin default after HDMI monitor standby
Context: Debian/testing on a ASRock B450 with Ryzen 2200G, HDMI monitor.
I can set the default audio sink either via /etc/pulse/default.pa or manually with this command:
pacmd set-default-sink alsa_output.pci-0000_38_00.1.hdmi-stereo-extra1
However, once the monitor enters standby mode, the default gets reset to the internal HDaudio card and the volume applet is no longer tracking the HDMI volume, rather the internal audio card feeding the headphone and back panel jacks. I assume this happens because the HDMI "card" gets unplugged but I'm not sure.
I also tried the suggestion in this other question but it didn't work. Most questions seems to be about setting pulseaudio defaults but this doesn't work: the audio is still routed correctly to the HDMI monitor, it's just the applet which is tracking the wrong volume. If I reset the default card with the command above, it goes back to showing the proper volume until the next standby.
How do I fix this? Basically, I need to run "pacmd set-default-sink" right after the hdmi sink becomes available again.
New info on sinks
- before standby: card 0 is hdmi, card 1 is internal; card 0 is default and available, card 1 is also available but not default
(link to details: https://paste.scratchbook.ch/view/83c0e9a5) - during standby: hdmi becomes unavailable, internal card is marked default
(link to details: https://paste.scratchbook.ch/view/9e9ae422) - after standby: hdmi is again available, internal card is still default
(link to details: https://paste.scratchbook.ch/view/9be5801a)
After interrupting standby, I started a new player and I can confirm the music comes from the hdmi monitor, yet the applet shows a crossed-out speaker.
debian xfce pulseaudio hdmi
|
show 1 more comment
Context: Debian/testing on a ASRock B450 with Ryzen 2200G, HDMI monitor.
I can set the default audio sink either via /etc/pulse/default.pa or manually with this command:
pacmd set-default-sink alsa_output.pci-0000_38_00.1.hdmi-stereo-extra1
However, once the monitor enters standby mode, the default gets reset to the internal HDaudio card and the volume applet is no longer tracking the HDMI volume, rather the internal audio card feeding the headphone and back panel jacks. I assume this happens because the HDMI "card" gets unplugged but I'm not sure.
I also tried the suggestion in this other question but it didn't work. Most questions seems to be about setting pulseaudio defaults but this doesn't work: the audio is still routed correctly to the HDMI monitor, it's just the applet which is tracking the wrong volume. If I reset the default card with the command above, it goes back to showing the proper volume until the next standby.
How do I fix this? Basically, I need to run "pacmd set-default-sink" right after the hdmi sink becomes available again.
New info on sinks
- before standby: card 0 is hdmi, card 1 is internal; card 0 is default and available, card 1 is also available but not default
(link to details: https://paste.scratchbook.ch/view/83c0e9a5) - during standby: hdmi becomes unavailable, internal card is marked default
(link to details: https://paste.scratchbook.ch/view/9e9ae422) - after standby: hdmi is again available, internal card is still default
(link to details: https://paste.scratchbook.ch/view/9be5801a)
After interrupting standby, I started a new player and I can confirm the music comes from the hdmi monitor, yet the applet shows a crossed-out speaker.
debian xfce pulseaudio hdmi
It probably happens because Pulseaudio receives a signal that the HDMI sink is no longer available. First step would be to have a look withpacmd list-sinks
at the state of the HDMI sync in normal/standby mode, and the difference.
– dirkt
Dec 17 at 9:12
@dirkt I added the info you asked; turns out my initial assumption was correct, thanks for the tip.
– Andrea Borgia
Dec 18 at 20:36
Hm, not sure what the issue with the crossed-out speaker is; I'd have to see thepacmd
output. In theory, it should be possible to hook into Pulseaudio and reset the default sink to HDMI as soon as it becomes available again (basically a "permanent preferred default sink list"), but I'm not sure how to configure that; possibly one has to dig into the source code and change it a bit. Not sure what to recommend here. Can you program in C?
– dirkt
Dec 19 at 6:47
@dirkt how do I send you the pacmd output? In a S-E approved way, of course. I can program in C but I'm too rusty to be useful, so I'll send an email to the developers pointing to this thread and / or file a bug report. I'd rather try and solve it with udev / hotplug (or whatever it's called these days) if at all possible.
– Andrea Borgia
Dec 23 at 9:44
Dopacmd list-sinks
before, during and after standby, put output in a pastebin etc., edit question with link, ping me in comments. If I see something, I can quote the relevant part in an answer, so it's not lost when the pastebin expires. Bug reports should contain all necessary info in whatever way the devs require (e.g. attachments). I very much doubt udev/hotplug is relevant; even if it was, you'd have a race-condition, because the pulseaudio demon also reacts on those (or actions triggered by those).
– dirkt
Dec 23 at 9:51
|
show 1 more comment
Context: Debian/testing on a ASRock B450 with Ryzen 2200G, HDMI monitor.
I can set the default audio sink either via /etc/pulse/default.pa or manually with this command:
pacmd set-default-sink alsa_output.pci-0000_38_00.1.hdmi-stereo-extra1
However, once the monitor enters standby mode, the default gets reset to the internal HDaudio card and the volume applet is no longer tracking the HDMI volume, rather the internal audio card feeding the headphone and back panel jacks. I assume this happens because the HDMI "card" gets unplugged but I'm not sure.
I also tried the suggestion in this other question but it didn't work. Most questions seems to be about setting pulseaudio defaults but this doesn't work: the audio is still routed correctly to the HDMI monitor, it's just the applet which is tracking the wrong volume. If I reset the default card with the command above, it goes back to showing the proper volume until the next standby.
How do I fix this? Basically, I need to run "pacmd set-default-sink" right after the hdmi sink becomes available again.
New info on sinks
- before standby: card 0 is hdmi, card 1 is internal; card 0 is default and available, card 1 is also available but not default
(link to details: https://paste.scratchbook.ch/view/83c0e9a5) - during standby: hdmi becomes unavailable, internal card is marked default
(link to details: https://paste.scratchbook.ch/view/9e9ae422) - after standby: hdmi is again available, internal card is still default
(link to details: https://paste.scratchbook.ch/view/9be5801a)
After interrupting standby, I started a new player and I can confirm the music comes from the hdmi monitor, yet the applet shows a crossed-out speaker.
debian xfce pulseaudio hdmi
Context: Debian/testing on a ASRock B450 with Ryzen 2200G, HDMI monitor.
I can set the default audio sink either via /etc/pulse/default.pa or manually with this command:
pacmd set-default-sink alsa_output.pci-0000_38_00.1.hdmi-stereo-extra1
However, once the monitor enters standby mode, the default gets reset to the internal HDaudio card and the volume applet is no longer tracking the HDMI volume, rather the internal audio card feeding the headphone and back panel jacks. I assume this happens because the HDMI "card" gets unplugged but I'm not sure.
I also tried the suggestion in this other question but it didn't work. Most questions seems to be about setting pulseaudio defaults but this doesn't work: the audio is still routed correctly to the HDMI monitor, it's just the applet which is tracking the wrong volume. If I reset the default card with the command above, it goes back to showing the proper volume until the next standby.
How do I fix this? Basically, I need to run "pacmd set-default-sink" right after the hdmi sink becomes available again.
New info on sinks
- before standby: card 0 is hdmi, card 1 is internal; card 0 is default and available, card 1 is also available but not default
(link to details: https://paste.scratchbook.ch/view/83c0e9a5) - during standby: hdmi becomes unavailable, internal card is marked default
(link to details: https://paste.scratchbook.ch/view/9e9ae422) - after standby: hdmi is again available, internal card is still default
(link to details: https://paste.scratchbook.ch/view/9be5801a)
After interrupting standby, I started a new player and I can confirm the music comes from the hdmi monitor, yet the applet shows a crossed-out speaker.
debian xfce pulseaudio hdmi
debian xfce pulseaudio hdmi
edited Dec 23 at 11:52
asked Dec 16 at 13:52
Andrea Borgia
337
337
It probably happens because Pulseaudio receives a signal that the HDMI sink is no longer available. First step would be to have a look withpacmd list-sinks
at the state of the HDMI sync in normal/standby mode, and the difference.
– dirkt
Dec 17 at 9:12
@dirkt I added the info you asked; turns out my initial assumption was correct, thanks for the tip.
– Andrea Borgia
Dec 18 at 20:36
Hm, not sure what the issue with the crossed-out speaker is; I'd have to see thepacmd
output. In theory, it should be possible to hook into Pulseaudio and reset the default sink to HDMI as soon as it becomes available again (basically a "permanent preferred default sink list"), but I'm not sure how to configure that; possibly one has to dig into the source code and change it a bit. Not sure what to recommend here. Can you program in C?
– dirkt
Dec 19 at 6:47
@dirkt how do I send you the pacmd output? In a S-E approved way, of course. I can program in C but I'm too rusty to be useful, so I'll send an email to the developers pointing to this thread and / or file a bug report. I'd rather try and solve it with udev / hotplug (or whatever it's called these days) if at all possible.
– Andrea Borgia
Dec 23 at 9:44
Dopacmd list-sinks
before, during and after standby, put output in a pastebin etc., edit question with link, ping me in comments. If I see something, I can quote the relevant part in an answer, so it's not lost when the pastebin expires. Bug reports should contain all necessary info in whatever way the devs require (e.g. attachments). I very much doubt udev/hotplug is relevant; even if it was, you'd have a race-condition, because the pulseaudio demon also reacts on those (or actions triggered by those).
– dirkt
Dec 23 at 9:51
|
show 1 more comment
It probably happens because Pulseaudio receives a signal that the HDMI sink is no longer available. First step would be to have a look withpacmd list-sinks
at the state of the HDMI sync in normal/standby mode, and the difference.
– dirkt
Dec 17 at 9:12
@dirkt I added the info you asked; turns out my initial assumption was correct, thanks for the tip.
– Andrea Borgia
Dec 18 at 20:36
Hm, not sure what the issue with the crossed-out speaker is; I'd have to see thepacmd
output. In theory, it should be possible to hook into Pulseaudio and reset the default sink to HDMI as soon as it becomes available again (basically a "permanent preferred default sink list"), but I'm not sure how to configure that; possibly one has to dig into the source code and change it a bit. Not sure what to recommend here. Can you program in C?
– dirkt
Dec 19 at 6:47
@dirkt how do I send you the pacmd output? In a S-E approved way, of course. I can program in C but I'm too rusty to be useful, so I'll send an email to the developers pointing to this thread and / or file a bug report. I'd rather try and solve it with udev / hotplug (or whatever it's called these days) if at all possible.
– Andrea Borgia
Dec 23 at 9:44
Dopacmd list-sinks
before, during and after standby, put output in a pastebin etc., edit question with link, ping me in comments. If I see something, I can quote the relevant part in an answer, so it's not lost when the pastebin expires. Bug reports should contain all necessary info in whatever way the devs require (e.g. attachments). I very much doubt udev/hotplug is relevant; even if it was, you'd have a race-condition, because the pulseaudio demon also reacts on those (or actions triggered by those).
– dirkt
Dec 23 at 9:51
It probably happens because Pulseaudio receives a signal that the HDMI sink is no longer available. First step would be to have a look with
pacmd list-sinks
at the state of the HDMI sync in normal/standby mode, and the difference.– dirkt
Dec 17 at 9:12
It probably happens because Pulseaudio receives a signal that the HDMI sink is no longer available. First step would be to have a look with
pacmd list-sinks
at the state of the HDMI sync in normal/standby mode, and the difference.– dirkt
Dec 17 at 9:12
@dirkt I added the info you asked; turns out my initial assumption was correct, thanks for the tip.
– Andrea Borgia
Dec 18 at 20:36
@dirkt I added the info you asked; turns out my initial assumption was correct, thanks for the tip.
– Andrea Borgia
Dec 18 at 20:36
Hm, not sure what the issue with the crossed-out speaker is; I'd have to see the
pacmd
output. In theory, it should be possible to hook into Pulseaudio and reset the default sink to HDMI as soon as it becomes available again (basically a "permanent preferred default sink list"), but I'm not sure how to configure that; possibly one has to dig into the source code and change it a bit. Not sure what to recommend here. Can you program in C?– dirkt
Dec 19 at 6:47
Hm, not sure what the issue with the crossed-out speaker is; I'd have to see the
pacmd
output. In theory, it should be possible to hook into Pulseaudio and reset the default sink to HDMI as soon as it becomes available again (basically a "permanent preferred default sink list"), but I'm not sure how to configure that; possibly one has to dig into the source code and change it a bit. Not sure what to recommend here. Can you program in C?– dirkt
Dec 19 at 6:47
@dirkt how do I send you the pacmd output? In a S-E approved way, of course. I can program in C but I'm too rusty to be useful, so I'll send an email to the developers pointing to this thread and / or file a bug report. I'd rather try and solve it with udev / hotplug (or whatever it's called these days) if at all possible.
– Andrea Borgia
Dec 23 at 9:44
@dirkt how do I send you the pacmd output? In a S-E approved way, of course. I can program in C but I'm too rusty to be useful, so I'll send an email to the developers pointing to this thread and / or file a bug report. I'd rather try and solve it with udev / hotplug (or whatever it's called these days) if at all possible.
– Andrea Borgia
Dec 23 at 9:44
Do
pacmd list-sinks
before, during and after standby, put output in a pastebin etc., edit question with link, ping me in comments. If I see something, I can quote the relevant part in an answer, so it's not lost when the pastebin expires. Bug reports should contain all necessary info in whatever way the devs require (e.g. attachments). I very much doubt udev/hotplug is relevant; even if it was, you'd have a race-condition, because the pulseaudio demon also reacts on those (or actions triggered by those).– dirkt
Dec 23 at 9:51
Do
pacmd list-sinks
before, during and after standby, put output in a pastebin etc., edit question with link, ping me in comments. If I see something, I can quote the relevant part in an answer, so it's not lost when the pastebin expires. Bug reports should contain all necessary info in whatever way the devs require (e.g. attachments). I very much doubt udev/hotplug is relevant; even if it was, you'd have a race-condition, because the pulseaudio demon also reacts on those (or actions triggered by those).– dirkt
Dec 23 at 9:51
|
show 1 more comment
1 Answer
1
active
oldest
votes
Ok, what happens is the following:
Each port of a sink has an "available" state, and putting the HDMI monitor into standby puts the port state into "not available".
The default sink can also be thought as fallback sink: It's the sink that gets used of Pulseaudio can't assign a valid sink to an application using the stream cache (where it remembers which stream used which sink). So it can't keep the default sink pointing to something that can't be used for this purpose, which is why the default sink switches to whatever other sink is available.
And when the monitor comes back from standby, the default sink stays, and doesn't switch back (there's no "preferred" default sink).
The simplest way to deal with this would be to write a simple Pulseaudio application that subscribes to configuration changes (see here for an example), and whenever your HDMI sink becomes available again, sets it as default.
Another option may be to use pactl subscribe
, parse the output, and do the same in a shell script.
1
I'll see what I can do withpactl subscribe
, the output looks chatty without being informative. I'll follow up with the solution once I have something that works.
– Andrea Borgia
Dec 23 at 16:13
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f489302%2fre-set-xfce4-pulseaudio-plugin-default-after-hdmi-monitor-standby%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Ok, what happens is the following:
Each port of a sink has an "available" state, and putting the HDMI monitor into standby puts the port state into "not available".
The default sink can also be thought as fallback sink: It's the sink that gets used of Pulseaudio can't assign a valid sink to an application using the stream cache (where it remembers which stream used which sink). So it can't keep the default sink pointing to something that can't be used for this purpose, which is why the default sink switches to whatever other sink is available.
And when the monitor comes back from standby, the default sink stays, and doesn't switch back (there's no "preferred" default sink).
The simplest way to deal with this would be to write a simple Pulseaudio application that subscribes to configuration changes (see here for an example), and whenever your HDMI sink becomes available again, sets it as default.
Another option may be to use pactl subscribe
, parse the output, and do the same in a shell script.
1
I'll see what I can do withpactl subscribe
, the output looks chatty without being informative. I'll follow up with the solution once I have something that works.
– Andrea Borgia
Dec 23 at 16:13
add a comment |
Ok, what happens is the following:
Each port of a sink has an "available" state, and putting the HDMI monitor into standby puts the port state into "not available".
The default sink can also be thought as fallback sink: It's the sink that gets used of Pulseaudio can't assign a valid sink to an application using the stream cache (where it remembers which stream used which sink). So it can't keep the default sink pointing to something that can't be used for this purpose, which is why the default sink switches to whatever other sink is available.
And when the monitor comes back from standby, the default sink stays, and doesn't switch back (there's no "preferred" default sink).
The simplest way to deal with this would be to write a simple Pulseaudio application that subscribes to configuration changes (see here for an example), and whenever your HDMI sink becomes available again, sets it as default.
Another option may be to use pactl subscribe
, parse the output, and do the same in a shell script.
1
I'll see what I can do withpactl subscribe
, the output looks chatty without being informative. I'll follow up with the solution once I have something that works.
– Andrea Borgia
Dec 23 at 16:13
add a comment |
Ok, what happens is the following:
Each port of a sink has an "available" state, and putting the HDMI monitor into standby puts the port state into "not available".
The default sink can also be thought as fallback sink: It's the sink that gets used of Pulseaudio can't assign a valid sink to an application using the stream cache (where it remembers which stream used which sink). So it can't keep the default sink pointing to something that can't be used for this purpose, which is why the default sink switches to whatever other sink is available.
And when the monitor comes back from standby, the default sink stays, and doesn't switch back (there's no "preferred" default sink).
The simplest way to deal with this would be to write a simple Pulseaudio application that subscribes to configuration changes (see here for an example), and whenever your HDMI sink becomes available again, sets it as default.
Another option may be to use pactl subscribe
, parse the output, and do the same in a shell script.
Ok, what happens is the following:
Each port of a sink has an "available" state, and putting the HDMI monitor into standby puts the port state into "not available".
The default sink can also be thought as fallback sink: It's the sink that gets used of Pulseaudio can't assign a valid sink to an application using the stream cache (where it remembers which stream used which sink). So it can't keep the default sink pointing to something that can't be used for this purpose, which is why the default sink switches to whatever other sink is available.
And when the monitor comes back from standby, the default sink stays, and doesn't switch back (there's no "preferred" default sink).
The simplest way to deal with this would be to write a simple Pulseaudio application that subscribes to configuration changes (see here for an example), and whenever your HDMI sink becomes available again, sets it as default.
Another option may be to use pactl subscribe
, parse the output, and do the same in a shell script.
answered Dec 23 at 15:16
dirkt
16.6k21335
16.6k21335
1
I'll see what I can do withpactl subscribe
, the output looks chatty without being informative. I'll follow up with the solution once I have something that works.
– Andrea Borgia
Dec 23 at 16:13
add a comment |
1
I'll see what I can do withpactl subscribe
, the output looks chatty without being informative. I'll follow up with the solution once I have something that works.
– Andrea Borgia
Dec 23 at 16:13
1
1
I'll see what I can do with
pactl subscribe
, the output looks chatty without being informative. I'll follow up with the solution once I have something that works.– Andrea Borgia
Dec 23 at 16:13
I'll see what I can do with
pactl subscribe
, the output looks chatty without being informative. I'll follow up with the solution once I have something that works.– Andrea Borgia
Dec 23 at 16:13
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f489302%2fre-set-xfce4-pulseaudio-plugin-default-after-hdmi-monitor-standby%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It probably happens because Pulseaudio receives a signal that the HDMI sink is no longer available. First step would be to have a look with
pacmd list-sinks
at the state of the HDMI sync in normal/standby mode, and the difference.– dirkt
Dec 17 at 9:12
@dirkt I added the info you asked; turns out my initial assumption was correct, thanks for the tip.
– Andrea Borgia
Dec 18 at 20:36
Hm, not sure what the issue with the crossed-out speaker is; I'd have to see the
pacmd
output. In theory, it should be possible to hook into Pulseaudio and reset the default sink to HDMI as soon as it becomes available again (basically a "permanent preferred default sink list"), but I'm not sure how to configure that; possibly one has to dig into the source code and change it a bit. Not sure what to recommend here. Can you program in C?– dirkt
Dec 19 at 6:47
@dirkt how do I send you the pacmd output? In a S-E approved way, of course. I can program in C but I'm too rusty to be useful, so I'll send an email to the developers pointing to this thread and / or file a bug report. I'd rather try and solve it with udev / hotplug (or whatever it's called these days) if at all possible.
– Andrea Borgia
Dec 23 at 9:44
Do
pacmd list-sinks
before, during and after standby, put output in a pastebin etc., edit question with link, ping me in comments. If I see something, I can quote the relevant part in an answer, so it's not lost when the pastebin expires. Bug reports should contain all necessary info in whatever way the devs require (e.g. attachments). I very much doubt udev/hotplug is relevant; even if it was, you'd have a race-condition, because the pulseaudio demon also reacts on those (or actions triggered by those).– dirkt
Dec 23 at 9:51