[pulseaudio-discuss] Bluetooth aptX codec

Pali Rohár pali.rohar at gmail.com
Mon Jun 18 07:35:21 UTC 2018


On Sunday 17 June 2018 23:48:42 Arun Raghavan wrote:
> On Sun, 17 Jun 2018, at 4:01 AM, Pali Rohár wrote:
> > Hi! As you may know lot of bluetooth headsets support not only SBC, but
> > also aptX codec. And new version of ffmpeg (4.0) has native aptX and
> > aptX HD encoder and decoder. AptX codec itself is proprietary, but
> > ffmpeg has clean-room implementation based on expired patent. What about
> > adding support for aptX via ffmpeg into pulseaudio?
> > 
> > -- 
> 
> I'd actually like to delete the SBC code and replace it with a generic GStreamer bin. That would allow us to be codec agnostic, and support any of the codecs that are supported by GStreamer (which includes those that ffmpeg provides).

This does not sound like a good idea. The only two relevant bluetooth
codecs for most people are SBC and aptX.

IIRC you cannot just choose arbitrary codec and use it in bluetooth, you
need to know how to put it into A2DP. Therefore for each bluetooth codec
you need to write some A2DP code or at least declarative definition. So
it would not work just adding dependency on gstreamer and let gstreamer
provide some encoded stream.

And also we cannot ensure or force at compile time that users would have
installed both gstreamer and ffmpeg at runtime to have working bluetooth support.

For me it looks like a overkill to add dependency on gstreamer to
pulseaudio, which would have some runtime dependency on ffmpeg to have
working bluetooth support. And it would work only with the last ffmpeg
version which is not widely available yet (and replacing system version
is not always trivial).

Anyway, I would try to write simple aptX library based on published
details and ffmpeg source code. And try to play with pulseaudio if I
would be able to start streaming aptX to bluetooth headset. This is at
least good starting point to prove that aptX codec is usable or not in
pulseaudio.

-- 
Pali Rohár
pali.rohar at gmail.com


More information about the pulseaudio-discuss mailing list