#1021370 pipewire: build with bluez5-codec-aac=enabled

Package:
pipewire
Source:
pipewire
Description:
audio and video processing engine multimedia server
Submitter:
KeyofBlueS
Date:
2025-05-03 10:24:01 UTC
Severity:
normal
#1021370#5
Date:
2022-10-06 22:11:56 UTC
From:
To:
Dear Maintainer,

please build pipewire with aac codec support enabled. If this is not possible
due to legal\patent issues, please mention it somewhere in the readme and/or in
the description, maybe in the debian wiki too.
I've spent months to understand why my bluetooth (aac) devices wont pick this
codec, looking in config files, installing and removing packages ecc...
Now i've compiled and installed from sources and it's working, but as i said,
mention it somewhere can be usefull to other users, giving us some clues on
what's going on.

Thanks and best regards.

#1021370#12
Date:
2024-01-12 16:08:15 UTC
From:
To:
An alternative may be building a separate package for the contrib
repository section that contains just the aac codec plugin.

I have no experience with meson, so I have no idea if it is possible to
force it to ignore everything besides the specific plugin. As a proof of
concept I have tried the following Makefile. Perhaps more flags should
be added.

# - atomic_dep?
top_srcdir ?= .
top_builddir ?= $(top_srcdir)
builddir ?= $(top_srcdir)

spaversion = $(shell sed -n -e "s/^spaversion *= *'\(.*\)'$$/\1/p"
$(top_srcdir)/meson.build)
pkgname = libspa-$(spaversion)
plugindir = $(shell pkg-config --variable=plugindir $(pkgname))
installdir = $(plugindir)/bluez5
# toplevel default_options
plugin_CFLAGS += --std=gnu11 -fPIE
# toplevel cc_flags
plugin_CFLAGS += -D_GNU_SOURCE -DFASTPATH
# toplevel common_flags
plugin_CFLAGS += -fvisibility=hidden -fno-strict-aliasing
# AVX and SSE flags perhaps may be ignored since
# computations should be done inside the linked library
# bluez5 codec_args
plugin_CFLAGS += -DCODEC_PLUGIN
# spa pkgconfig
plugin_CFLAGS += $(shell pkg-config --cflags $(pkgname))
# required for shared library
plugin_CFLAGS += -fPIC
plugin_CFLAGS += $(shell pkg-config --cflags fdk-aac)
ALL_CFLAGS = $(plugin_CFLAGS) $(CFLAGS)
ALL_LDLIBS = $(LDLIBS) $(shell pkg-config --libs fdk-aac)

bluez5_dir = $(top_srcdir)/spa/plugins/bluez5
aac_codec = $(builddir)/libspa-codec-bluez5-aac.so
plugin_LIBRARIES += $(aac_codec)
plugin_OBJECTS += $(builddir)/a2dp-codec-aac.o $(builddir)/media-codecs.o

all: $(plugin_LIBRARIES)
clean:
	$(RM) $(plugin_LIBRARIES) $(plugin_OBJECTS)

# Not $(LD) due to $(LDFLAGS)
# ld: unrecognized option '-Wl,-z,relro'
$(aac_codec): $(plugin_OBJECTS)
	$(CC) -o $@ -shared $(LDFLAGS) $^ $(ALL_LDLIBS)

$(builddir)/%.o: $(bluez5_dir)/%.c
	$(CC) -o $@ $(CPPFLAGS) $(ALL_CFLAGS) -c $<

install: $(plugin_LIBRARIES)
	install -D --target-directory $(DESTDIR)$(installdir) $(plugin_LIBRARIES)

.PHONY: all clean install
--- 8< --- debian/rules --- 8< --- #!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_LDFLAGS_MAINT_APPEND = -Wl,-z,defs %: dh $@ # Custom Makefile instead of configure script override_dh_auto_configure: override_dh_makeshlibs:
#1021370#17
Date:
2024-01-12 19:17:14 UTC
From:
To:
I would prefer getting fdk-aac-free into Debian main. It has been in
the NEW queue for roughly 2 years.

Thank you,
Jeremy Bícha

#1021370#22
Date:
2024-01-13 02:21:43 UTC
From:
To:
I suggested a separate contrib package because after reading #981285 I
decided that there is a little chance that package can be moved to main.

"Changes" in
https://ftp-master.debian.org/new/fdk-aac-free_2.0.2-3.html
(I hope NEWS file advertises it as well) contains a better description
of intentions in comparison to the request to ftpmasters in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=981285#64

I was confused by
https://fedoraproject.org/wiki/Licensing/FDK-AAC
Maybe another message to ftpmasters could help. One that clearly states
the steps taking to resolve licensing issues.

It may be offered to add new set of binary packages, e.g.
libfdk-aac2-free having Provides: libfdk-aac2 and Conflicts:
libfdk-aac2. However duplication increases maintenance burden in the
case of security bugs.

So it is necessary to identify friction points related to fdk-aac-free.

#1021370#27
Date:
2024-02-09 23:49:04 UTC
From:
To:
please add aac support, even if it is via nonfree

Many headphones or speakers devices have that codec to have good quality.
Without them they are completely unusable.

Any workaround to compile that codec separately or is it necessary to
rebuild the entire pipewire?
thanks!

#1021370#32
Date:
2024-05-14 00:13:49 UTC
From:
To:
hi! I think I can sacrifice using nonfree instead of having my
headphones sound horrible.
=(

#1021370#37
Date:
2024-09-19 17:01:20 UTC
From:
To:
On Fri, 12 Jan 2024 23:08:15 +0700 Max Nikulin <manikulin@gmail.com> wrote:
to
of
should

This is how RPMFusion does aptx. Same works for aac:

https://pkgs.rpmfusion.org/cgit/free/pipewire-codec-aptx.git/tree/pipewire-codec-aptx.spec#n27

meson setup builddir --auto-features=disabled -D examples=disabled \
          -D bluez5=enabled -D bluez5-codec-aptx=enabled
meson compile -C builddir spa-codec-bluez5-aptx
codecs.o
$(plugin_LIBRARIES)

#1021370#42
Date:
2024-10-04 10:23:31 UTC
From:
To:
reconsider a contrib package for the AAC codec.

Pauli Virtanen pointed to commands that look promising:
<https://bugs.debian.org/1021370#37>

Fri, 9 Feb 2024 20:49:04 -0300 Fernando Toledo:

Mon, 13 May 2024 21:13:49 -0300 Fernando Toledo:

I do not mind to have a list of BT devices friendly to free software or
devices for that it is known that due to various tricks (restricted
bitpool range, terrible equalizer settings) quality of SBC codec is
unacceptable. Just complains that some devices unusable are hardly
constructive. Unfortunately maintenance of any list would be a burden
since there is no tool that may report all codecs and their settings for
a device.

#1021370#49
Date:
2025-04-19 01:35:10 UTC
From:
To:
anybody can help with step/commands to rebuild the actual packages
enabling aac again? is it possible?

I already use pipewire 1.2.7-1~bpo12+1 from backports

thanks!

#1021370#54
Date:
2025-05-03 10:20:34 UTC
From:
To:
Hi everyone,

I extracted the relevant AAC plugin code from pipewire and moved it
into a freestanding repository. This way one can simply compile and
install the plugin without rebuilding pipewire. You can find the
repository here: https://github.com/stephanlachnit/libspa-aac

If we can include this in contrib or non-free, that would be awesome,
but I don't enough about the patent issue to go ahead on my own.

Cheers,
Stephan