Hi Pali, On Sun, Jul 8, 2018 at 11:02 PM, Pali Rohár <pali.rohar at gmail.com> wrote: > On Sunday 08 July 2018 22:55:28 Luiz Augusto von Dentz wrote: >> Hi Pali, >> >> On Sat, Jul 7, 2018 at 2:08 PM, Pali Rohár <pali.rohar at gmail.com> wrote: >> > On Friday 06 July 2018 11:16:09 Pali Rohár wrote: >> >> Known problems: >> >> >> >> For every A2DP codec it is needed to register endpoint to the bluez daemon. >> >> This is working fine, but I do not know how and why bluez daemon choose >> >> endpoint (and so codec) for new connection. And I have not figured out how >> >> to tell bluez daemon to switch A2DP codec from SBC to aptX and vice-versa. >> >> It looks like that bluez daemon chooses endpoint (and so codec) at >> >> connection time randomly :-( >> > >> > Any idea how to tell bluez which endpoint should use? Or how to change >> > one active bluez endpoint to another for switching bluez codec? >> >> >> It is the order PA register the endpoints, if you want apt-x take >> priority register it first. > > Do you mean to call functions in this order? > > register_endpoint(y, path, A2DP_SOURCE_APTX_ENDPOINT, ...); > register_endpoint(y, path, A2DP_SOURCE_SBC_ENDPOINT, ...); > > No, it does not work. Still codec is somehow selected randomly. > Sometimes aptX, sometimes SBC. I tested it with one same device. https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/profiles/audio/a2dp.c#n1866 It is definitely not random in our end, note that this only works if you initiate the connection, if the remote initiates it then it is up to them to select which may explain why it is not always the same priority. > -- > Pali Rohár > pali.rohar at gmail.com > > _______________________________________________ > pulseaudio-discuss mailing list > pulseaudio-discuss at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss > -- Luiz Augusto von Dentz