------------------ Original ------------------
From: &nbsp;"Sean&nbsp;Greenslade"<s...@seangreenslade.com&gt;;
Date: &nbsp;Mon, Nov 20, 2023 11:10 AM
To: &nbsp;"pulseaudio-discuss"<pulseaudio-discuss@lists.freedesktop.org&gt;; 
Subject: &nbsp;Re: [pulseaudio-discuss] Switching output ports across sound 
cards will cause the Headphone to be silent.

&nbsp;
&gt; &gt; In the following scenario, switching output ports across sound cards 
will cause the Headphone to be silent.
&gt; &gt; (Tips: USB speakers or Bluetooth earphones use independent sound 
cards, and the device uses an onboard sound card.)
&gt; &gt;
&gt; &gt;
&gt; &gt; 1. headphone is unplugged, automatically change port: headphone 
-&amp;gt; speaker-&amp;gt; usb speaker (or Bluetooth earphone)
&gt; &gt; 2. headphone is plugged, automatically change port: usb speaker(or 
Bluetooth earphone) -&amp;gt; headphone
&gt; &gt;
&gt; &gt;
&gt; &gt; Step 1. When the headphone is unplugged, the port is automatically 
switched from the headphone to the speaker.&amp;nbsp;
&gt; &gt; The following configuration items in the analog-output-speaker.conf 
file will be applied, and then the port is&amp;nbsp;
&gt; &gt; switched to the USB speaker.
&gt; &gt; Close Headphone volume
&gt; &gt; [Element Headphone]
&gt; &gt; switch=off
&gt; &gt; volume=off
&gt; &gt;
&gt; &gt;
&gt; &gt; Step 2, when the headphone is plugged in, the port is automatically 
switched from the USB speaker to the headphone,&amp;nbsp;
&gt; &gt; and the following configuration items in the 
analog-output-headphone.conf file will be applied.
&gt; &gt; [Element Headphone]
&gt; &gt; required-any = any
&gt; &gt; switch = mute
&gt; &gt; volume=merge
&gt; &gt; override-map.1 = all
&gt; &gt; override-map.2 = all-left,all-right
&gt; &gt;
&gt; &gt;
&gt; &gt; As you can see through alsamixer, the volume of the Headphone has 
been restored, but the Headphone is silent.
&gt; &gt;
&gt; &gt;
&gt; &gt;
&gt; &gt; Could you please help slove this issue, thanks!
&gt;
&gt; Hi, Chengyi.
&gt;
&gt; Your question is somewhat unclear. The behavior you're describing is not
&gt; how pulseaudio operates by default, but the config file snippets you
&gt; provide are not modified from the defaults. By default, unplugging the
&gt; headphones should switch to the speaker channel of the same ALSA card.
&gt; Have you made any modifications to the various pulseaudo alsa-mixer
&gt; paths conf files? If so, please show what you have changed.
&gt;


Hi Sean,


Thanks for your reply.

Yes, at first, unplugging theheadphones should switch to the speaker channel of 

the same ALSA card,&nbsp; but then the client sends 
"command_set_default_sink_or_source" 

to switth to USB Speaker, so the following switching sequence occurs.
headphone -&gt; speaker-&gt; usb speaker (or Bluetooth earphone)

Part of the log is as follows:
----------------------------------
11月 20 13:40:10.686234 uos60-PC pulseaudio[8944]: I: [pulseaudio] sink.c: 
Changed port of sink 1 "alsa_output.pci-0000_00_1f.3.analog-stereo" to 
analog-output-speaker
11月 20 13:40:10.686234 uos60-PC pulseaudio[8944]: I: [pulseaudio] core.c: 
default_sink: 
alsa_output.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00.analog-stereo 
-&gt; alsa_output.pci-0000_00_1f.3.analog-stereo

...

11月 20 13:40:10.689190 uos60-PC pulseaudio[8944]: I: [pulseaudio] core.c: 
configured_default_sink: alsa_output.pci-0000_00_1f.3.analog-stereo -&gt; 
alsa_output.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00.analog-stereo
11月 20 13:40:10.689190 uos60-PC pulseaudio[8944]: I: [pulseaudio] core.c: 
default_sink: alsa_output.pci-0000_00_1f.3.analog-stereo -&gt; 
alsa_output.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00.analog-stereo



BR,


Chengyi

Reply via email to