On Mon, Nov 20, 2023 at 01:58:34PM +0800, 赵成义 wrote:
> Hi Sean,
> 
> 
> Thanks for your reply.
> 
> Yes, at first, unplugging theheadphones should switch to the speaker channel 
> of 
> 
> the same ALSA card,  but then the client sends 
> "command_set_default_sink_or_source" 
> 
> to switth to USB Speaker, so the following switching sequence occurs.
> headphone -> speaker-> 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
>  -> 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 -> 
> 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 -> 
> alsa_output.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00.analog-stereo

OK, so your custom client application is deliberately changing the
default sink? Note that just changing the default sink will not move
existing sink input streams. You will need to do that yourself, for
example with the pa_context_move_sink_input_by_index function.

--Sean

Reply via email to