Discussion:
[pulseaudio-discuss] Bi-directional Bluetooth A2DP
Pali Rohár
2018-07-28 19:34:19 UTC
Permalink
Hi!

Some Bluetooth A2DP codecs like aptX Low Latency or FastStream provides
"backchannel" support for voice data. And it really in A2DP profile.

It can be very useful as there is no need to switch between A2DP and HSP
modes.

Now I was able to get FastStream codec (rebranded SBC) working in
PulseAudio. And in "btmon" I see that my headset started sending
backchannel voice data in SBC codec. I decoded that dump and it is
really SBC codec, voice is in very good quality, better then in
HSP profile. I hope that bluez can send them to pulseaudio via file
descriptor.

Question is, how to handle this configuration in pulseaudio? Should it
be a new profile for bluetooth devices which would provides both sink
and source? Because now A2DP is one-direction profile, not
bi-directional.
--
Pali Rohár
***@gmail.com
Luiz Augusto von Dentz
2018-08-08 07:00:28 UTC
Permalink
Hi Pali,
Post by Pali Rohár
Hi!
Some Bluetooth A2DP codecs like aptX Low Latency or FastStream provides
"backchannel" support for voice data. And it really in A2DP profile.
It can be very useful as there is no need to switch between A2DP and HSP
modes.
Now I was able to get FastStream codec (rebranded SBC) working in
PulseAudio. And in "btmon" I see that my headset started sending
backchannel voice data in SBC codec. I decoded that dump and it is
really SBC codec, voice is in very good quality, better then in
HSP profile. I hope that bluez can send them to pulseaudio via file
descriptor.
The fd sent to PA is a socket which is already bi-directional.
Post by Pali Rohár
Question is, how to handle this configuration in pulseaudio? Should it
be a new profile for bluetooth devices which would provides both sink
and source? Because now A2DP is one-direction profile, not
bi-directional.
While A2DP only configures a single direction we can assume
bi-directional depending on the endpoint, so in theory all you have to
do is register an endpoint for FastStream and create both sink and
source when it is connected. That said note that A2DP uses L2CAP on
top of ACL link which is asynchronous so it may not be as low latency
as SCO, but I guess being able to chat while listening to stereo audio
is quite convenient in some situations (e.g. when gaming).
--
Luiz Augusto von Dentz
Pali Rohár
2018-08-09 11:59:41 UTC
Permalink
Post by Luiz Augusto von Dentz
Hi Pali,
Post by Pali Rohár
Hi!
Some Bluetooth A2DP codecs like aptX Low Latency or FastStream provides
"backchannel" support for voice data. And it really in A2DP profile.
It can be very useful as there is no need to switch between A2DP and HSP
modes.
Now I was able to get FastStream codec (rebranded SBC) working in
PulseAudio. And in "btmon" I see that my headset started sending
backchannel voice data in SBC codec. I decoded that dump and it is
really SBC codec, voice is in very good quality, better then in
HSP profile. I hope that bluez can send them to pulseaudio via file
descriptor.
The fd sent to PA is a socket which is already bi-directional.
Ok.
Post by Luiz Augusto von Dentz
Post by Pali Rohár
Question is, how to handle this configuration in pulseaudio? Should it
be a new profile for bluetooth devices which would provides both sink
and source? Because now A2DP is one-direction profile, not
bi-directional.
While A2DP only configures a single direction we can assume
bi-directional depending on the endpoint, so in theory all you have to
do is register an endpoint for FastStream and create both sink and
source when it is connected. That said note that A2DP uses L2CAP on
top of ACL link which is asynchronous so it may not be as low latency
as SCO, but I guess being able to chat while listening to stereo audio
is quite convenient in some situations (e.g. when gaming).
I mean how to export this configuration from pulseaudio. If it should be
a new profile on pulseaudio card, or something different.

After correct bluez endpoint registration I was able to send data to
headset which correctly played it -- this is working.
--
Pali Rohár
***@gmail.com
Luiz Augusto von Dentz
2018-08-10 07:28:11 UTC
Permalink
Hi Pali,
Post by Pali Rohár
Post by Luiz Augusto von Dentz
Hi Pali,
Post by Pali Rohár
Hi!
Some Bluetooth A2DP codecs like aptX Low Latency or FastStream provides
"backchannel" support for voice data. And it really in A2DP profile.
It can be very useful as there is no need to switch between A2DP and HSP
modes.
Now I was able to get FastStream codec (rebranded SBC) working in
PulseAudio. And in "btmon" I see that my headset started sending
backchannel voice data in SBC codec. I decoded that dump and it is
really SBC codec, voice is in very good quality, better then in
HSP profile. I hope that bluez can send them to pulseaudio via file
descriptor.
The fd sent to PA is a socket which is already bi-directional.
Ok.
Post by Luiz Augusto von Dentz
Post by Pali Rohár
Question is, how to handle this configuration in pulseaudio? Should it
be a new profile for bluetooth devices which would provides both sink
and source? Because now A2DP is one-direction profile, not
bi-directional.
While A2DP only configures a single direction we can assume
bi-directional depending on the endpoint, so in theory all you have to
do is register an endpoint for FastStream and create both sink and
source when it is connected. That said note that A2DP uses L2CAP on
top of ACL link which is asynchronous so it may not be as low latency
as SCO, but I guess being able to chat while listening to stereo audio
is quite convenient in some situations (e.g. when gaming).
I mean how to export this configuration from pulseaudio. If it should be
a new profile on pulseaudio card, or something different.
After correct bluez endpoint registration I was able to send data to
headset which correctly played it -- this is working.
If it is working with A2DP then leave as A2DP as profile, the only
difference perhaps it to add that is bi-directional and any case you
should be able to create a source A2DP to the same device so Im not
sure what a new profile would add here? Except perhaps if you want
different policies when using FastStream? We could perhaps add some
field to the sink/source to tell exactly what codec is in use, that
perhaps would be required if we add support for switching them so
there would be multiple options to A2DP, one for each matching codec.
Post by Pali Rohár
--
Pali Rohár
_______________________________________________
pulseaudio-discuss mailing list
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
--
Luiz Augusto von Dentz
Loading...