You are not logged in.

#1 2022-05-21 16:34:50

shuaiouke
Member
Registered: 2022-05-21
Posts: 3

[Pulseaudio] Add a combine-sink which depends on a bluetooth device?

So I wanted to make a device which outputs to my bluetooth headphone so I can record in OBS and listen to music without it being recorded, so I used module-combine-sink, but the unfortunate part is that the module fails to load since i have to specify which module is its slave on creation, but bluetooth devices aren't there on startup, is there a way to say "on device X connect, add/enable this sink"? Thanks a lot.

Offline

#2 2022-05-23 16:06:57

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 16,406

Re: [Pulseaudio] Add a combine-sink which depends on a bluetooth device?

You can write a script for e.g. udev and then run the relevant pacmd/pactl command, but what you should also be able to do is load module-combine sink without a slave which will make it a sink that will automatically combine everything.

FWIW if your main usecase is what you described you are probably going to have less hassle if you define a virtual sink that you put applications you want to have recorded on to so you can listen to music without necessarily having to use a distinct bluetooth sink, see e.g. https://bbs.archlinux.org/viewtopic.php … 5#p1897765 for an example

Offline

#3 2022-05-23 16:26:43

progandy
Member
Registered: 2012-05-17
Posts: 4,965

Re: [Pulseaudio] Add a combine-sink which depends on a bluetooth device?

is there a way to say "on device X connect, add/enable this sink"?

I think wireplumber scripts should be able to do that as well, I have not written any, though.
Why did I read pipewire instead of pulseaudio?...

Last edited by progandy (2022-05-23 16:28:31)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2022-06-10 05:01:17

shuaiouke
Member
Registered: 2022-05-21
Posts: 3

Re: [Pulseaudio] Add a combine-sink which depends on a bluetooth device?

V1del wrote:

You can write a script for e.g. udev and then run the relevant pacmd/pactl command, but what you should also be able to do is load module-combine sink without a slave which will make it a sink that will automatically combine everything.

FWIW if your main usecase is what you described you are probably going to have less hassle if you define a virtual sink that you put applications you want to have recorded on to so you can listen to music without necessarily having to use a distinct bluetooth sink, see e.g. https://bbs.archlinux.org/viewtopic.php … 5#p1897765 for an example

Yeah this is the goal, I will have two sinks:
1. Bluetooth headphone
2. Record sink
And I output applications to the record sink, which I choose to record in obs, and music to the headphone, but I still want to hear the game sound so I would want the record sink to be a loopback as well.

Offline

#5 2022-06-10 10:26:37

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 16,406

Re: [Pulseaudio] Add a combine-sink which depends on a bluetooth device?

Yes which what I posted will/should accomplish. Your master_sink= should be the identifier of your BT headset in this case. This will create a virtual sink that functions as a loopback for purposes of OBS and still allow you to listen to your stuff.

Last edited by V1del (2022-06-10 10:27:01)

Offline

#6 2022-06-10 15:49:06

shuaiouke
Member
Registered: 2022-05-21
Posts: 3

Re: [Pulseaudio] Add a combine-sink which depends on a bluetooth device?

V1del wrote:

Yes which what I posted will/should accomplish. Your master_sink= should be the identifier of your BT headset in this case. This will create a virtual sink that functions as a loopback for purposes of OBS and still allow you to listen to your stuff.

Yes, but I can't set a master sink which doesn't exist, which is the case when pulseaudio starts because my Bluetooth headphone isn't connected yet, that's why I want it to only be added when I connect my headphone and removed when it's disconnected.

Last edited by shuaiouke (2022-06-10 20:18:14)

Offline

Board footer

Powered by FluxBB