Comment 2 for bug 1047165

Revision history for this message
Marek Tyburec (marek-tyburec) wrote :

Hi,

thanks for your fast answer! I tried what you mentiened, but it has few issues.

When using with a bluetooth headset it successfully connects to my laptop, however it takes some time (eg 2 seconds) for computer to "realize" that it is a new sound device. Therefore the "pacmd set-default-sink 3" command is invalid, although it works few seconds later. Solution may be to use the timeout utility (I will try with custom script).

Secondly, it is not always sure which index will the device use. Therefore I would suggest:
When connected bluetooth-headset specified in app settings with name NAME, then:
Wait few seconds to make sure that system recognized new sound device and recheck "pacmd list sinks". There it should be possible to find device NAME and find out its index value. And finally use the command you mentioned.

Or the best solution would be to monitor sound devices (again maybe "pacmd list sinks") and when there is a new connected, then the above command should work.