Re: [pulseaudio-discuss] [PATCH v3 2/4] Add A2DP AAC codec support

2019-01-12 Thread Pali Rohár
On Saturday 29 December 2018 23:48:06 Huang-Huang Bao wrote:
> diff --git a/src/modules/bluetooth/a2dp/a2dp_aac.c 
> b/src/modules/bluetooth/a2dp/a2dp_aac.c
> new file mode 100644
> index 0..a1d7bf1d2
> --- /dev/null
> +++ b/src/modules/bluetooth/a2dp/a2dp_aac.c
> @@ -0,0 +1,762 @@
> +/***
> +  This file is part of PulseAudio.
> +
> +  Copyright 2018 Huang-Huang Bao
> +
> +  PulseAudio is free software; you can redistribute it and/or modify
> +  it under the terms of the GNU Lesser General Public License as
> +  published by the Free Software Foundation; either version 2.1 of the
> +  License, or (at your option) any later version.
> +
> +  PulseAudio is distributed in the hope that it will be useful, but
> +  WITHOUT ANY WARRANTY; without even the implied warranty of
> +  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> +  General Public License for more details.
> +
> +  You should have received a copy of the GNU Lesser General Public
> +  License along with PulseAudio; if not, see .
> +***/
> +
> +#include 
> +#include 
> +
> +#include 
> +#include 

This looks like license problem... I do not think that fdk-aac is
compatible with above declared LGPL 2.1.

-- 
Pali Rohár
pali.ro...@gmail.com


signature.asc
Description: PGP signature
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v3 2/4] Add A2DP AAC codec support

2019-01-11 Thread Pali Rohár
On Friday 11 January 2019 15:32:44 Luiz Augusto von Dentz wrote:
> Hi Pali,
> 
> On Fri, Jan 11, 2019 at 2:49 PM Pali Rohár  wrote:
> >
> > On Friday 11 January 2019 14:23:21 Luiz Augusto von Dentz wrote:
> > > Im little worried about the maintainance of a2dp_util.c if we keedp
> > > the practice of #ifsef every codec, imo it would be much cleaner if we
> > > just have a mechanism to register the codecs, maybe we load them as
> > > separate plugins which then call a2dp_util.c to register their
> > > 'drivers', the plugin can check if the bluetooth plugin is loaded in
> > > order to register itself, doing that way we can also pass the
> > > parameter via default.pa.
> >
> > Hi! I'm already working on a new version of my previous patch series.
> > And your above point above tons of #ifdefs is being addresses.
> >
> > I though about it for a long time (heh :-) last version of my A2DP codec
> > patch series is from summer) and I think I have a good API where adding
> > new codec involves only adding new file (with all needed functions) plus
> > putting codec structure into one list.
> >
> > So... I will rework my previous patch series, will add support for codec
> > switching and then I send it to mailing list.
> 
> Are you changes compatibles with this changes or we have to competing 
> solutions?

These Huang-Huang Bao patches are competing to my solution which I
already sent in summer.

But I can take additional codec supports in this series and convert them
into my. So no functionality would be lost.

-- 
Pali Rohár
pali.ro...@gmail.com


signature.asc
Description: PGP signature
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v3 2/4] Add A2DP AAC codec support

2019-01-11 Thread Luiz Augusto von Dentz
Hi Pali,

On Fri, Jan 11, 2019 at 2:49 PM Pali Rohár  wrote:
>
> On Friday 11 January 2019 14:23:21 Luiz Augusto von Dentz wrote:
> > Im little worried about the maintainance of a2dp_util.c if we keedp
> > the practice of #ifsef every codec, imo it would be much cleaner if we
> > just have a mechanism to register the codecs, maybe we load them as
> > separate plugins which then call a2dp_util.c to register their
> > 'drivers', the plugin can check if the bluetooth plugin is loaded in
> > order to register itself, doing that way we can also pass the
> > parameter via default.pa.
>
> Hi! I'm already working on a new version of my previous patch series.
> And your above point above tons of #ifdefs is being addresses.
>
> I though about it for a long time (heh :-) last version of my A2DP codec
> patch series is from summer) and I think I have a good API where adding
> new codec involves only adding new file (with all needed functions) plus
> putting codec structure into one list.
>
> So... I will rework my previous patch series, will add support for codec
> switching and then I send it to mailing list.

Are you changes compatibles with this changes or we have to competing solutions?
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v3 2/4] Add A2DP AAC codec support

2019-01-11 Thread Pali Rohár
On Friday 11 January 2019 14:23:21 Luiz Augusto von Dentz wrote:
> Im little worried about the maintainance of a2dp_util.c if we keedp
> the practice of #ifsef every codec, imo it would be much cleaner if we
> just have a mechanism to register the codecs, maybe we load them as
> separate plugins which then call a2dp_util.c to register their
> 'drivers', the plugin can check if the bluetooth plugin is loaded in
> order to register itself, doing that way we can also pass the
> parameter via default.pa.

Hi! I'm already working on a new version of my previous patch series.
And your above point above tons of #ifdefs is being addresses.

I though about it for a long time (heh :-) last version of my A2DP codec
patch series is from summer) and I think I have a good API where adding
new codec involves only adding new file (with all needed functions) plus
putting codec structure into one list.

So... I will rework my previous patch series, will add support for codec
switching and then I send it to mailing list.

Stay tuned...

-- 
Pali Rohár
pali.ro...@gmail.com


signature.asc
Description: PGP signature
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v3 2/4] Add A2DP AAC codec support

2019-01-11 Thread Luiz Augusto von Dentz
Hi,

On Sat, Dec 29, 2018 at 12:49 PM Huang-Huang Bao  wrote:
>
> Optional (build with --disable-bluez5-aac-codec)
>
> AAC User Configurations:
>KEY VALUEDESC  
> DEFAULT
>aac_bitrate_mode[1, 5]   Variable Bitrate (VBR) (encoder)  5
>0Constant Bitrate (CBR) (encoder)
>
>aac_fmt s16  16-bit signed LE (encoder)auto
>s32  32-bit signed LE (encoder)
>auto
>
>aac_afterburner  FDK-AAC afterburner feature (encoder) off
> ---
>  configure.ac   |  14 +-
>  src/Makefile.am|   8 +
>  src/modules/bluetooth/a2dp/a2dp-api.h  |  10 +-
>  src/modules/bluetooth/a2dp/a2dp_aac.c  | 762 +
>  src/modules/bluetooth/a2dp/a2dp_util.c |  33 ++
>  5 files changed, 825 insertions(+), 2 deletions(-)
>  create mode 100644 src/modules/bluetooth/a2dp/a2dp_aac.c
>
> diff --git a/configure.ac b/configure.ac
> index 2512d3c95..0f9d7fb6c 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1061,7 +1061,7 @@ 
> PA_MACHINE_ID_FALLBACK="${localstatedir}/lib/dbus/machine-id"
>  AX_DEFINE_DIR(PA_MACHINE_ID_FALLBACK, PA_MACHINE_ID_FALLBACK,
>   [Fallback machine-id file])
>
> - BlueZ support (optional, dependent on D-Bus and SBC) 
> + BlueZ support (optional, dependent on D-Bus and SBC and FDK-AAC) 
>
>  AC_ARG_ENABLE([bluez5],
>  AS_HELP_STRING([--disable-bluez5],[Disable optional BlueZ 5 support]))
> @@ -1083,6 +1083,16 @@ AS_IF([test "x$HAVE_BLUEZ_5" = "x1"], HAVE_BLUEZ=1, 
> HAVE_BLUEZ=0)
>  AC_SUBST(HAVE_BLUEZ)
>  AM_CONDITIONAL([HAVE_BLUEZ], [test "x$HAVE_BLUEZ" = x1])
>
> +## FDK-AAC ##
> +AC_ARG_ENABLE([bluez5-aac-codec],
> +AS_HELP_STRING([--disable-bluez5-aac-codec],[Disable optional A2DP AAC 
> codec support (Bluez 5)]))
> +AS_IF([test "x$HAVE_BLUEZ_5" = "x1" && test "x$enable_bluez5_aac_codec" != 
> "xno"],
> +[PKG_CHECK_MODULES(FDK_AAC, [ fdk-aac >= 0.1.5 ], HAVE_FDK_AAC=1, 
> HAVE_FDK_AAC=0)],
> +HAVE_FDK_AAC=0)
> +AC_SUBST(HAVE_FDK_AAC)
> +AM_CONDITIONAL([HAVE_FDK_AAC], [test "x$HAVE_FDK_AAC" = x1])
> +AS_IF([test "x$HAVE_FDK_AAC" = "x1"], AC_DEFINE([HAVE_FDK_AAC], 1, [Bluez 5 
> A2DP AAC codec enabled]))
> +
>  ## Bluetooth Headset profiles backend ##
>
>  AC_ARG_ENABLE([bluez5-ofono-headset],
> @@ -1587,6 +1597,7 @@ AS_IF([test "x$HAVE_SYSTEMD_DAEMON" = "x1"], 
> ENABLE_SYSTEMD_DAEMON=yes, ENABLE_S
>  AS_IF([test "x$HAVE_SYSTEMD_LOGIN" = "x1"], ENABLE_SYSTEMD_LOGIN=yes, 
> ENABLE_SYSTEMD_LOGIN=no)
>  AS_IF([test "x$HAVE_SYSTEMD_JOURNAL" = "x1"], ENABLE_SYSTEMD_JOURNAL=yes, 
> ENABLE_SYSTEMD_JOURNAL=no)
>  AS_IF([test "x$HAVE_BLUEZ_5" = "x1"], ENABLE_BLUEZ_5=yes, ENABLE_BLUEZ_5=no)
> +AS_IF([test "x$HAVE_FDK_AAC" = "x1"], ENABLE_BLUEZ_5_AAC_CODEC=yes, 
> ENABLE_BLUEZ_5_AAC_CODEC=no)
>  AS_IF([test "x$HAVE_BLUEZ_5_OFONO_HEADSET" = "x1"], 
> ENABLE_BLUEZ_5_OFONO_HEADSET=yes, ENABLE_BLUEZ_5_OFONO_HEADSET=no)
>  AS_IF([test "x$HAVE_BLUEZ_5_NATIVE_HEADSET" = "x1"], 
> ENABLE_BLUEZ_5_NATIVE_HEADSET=yes, ENABLE_BLUEZ_5_NATIVE_HEADSET=no)
>  AS_IF([test "x$HAVE_HAL_COMPAT" = "x1"], ENABLE_HAL_COMPAT=yes, 
> ENABLE_HAL_COMPAT=no)
> @@ -1645,6 +1656,7 @@ echo "
>  Enable LIRC:   ${ENABLE_LIRC}
>  Enable D-Bus:  ${ENABLE_DBUS}
>Enable BlueZ 5:  ${ENABLE_BLUEZ_5}
> +Enable A2DP AAC codec: ${ENABLE_BLUEZ_5_AAC_CODEC}
>  Enable ofono headsets: ${ENABLE_BLUEZ_5_OFONO_HEADSET}
>  Enable native headsets:${ENABLE_BLUEZ_5_NATIVE_HEADSET}
>  Enable udev:   ${ENABLE_UDEV}
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 521b9b684..c44a65f05 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -2128,6 +2128,10 @@ libbluez5_util_la_SOURCES = \
> modules/bluetooth/a2dp/a2dp-api.h \
> modules/bluetooth/a2dp/a2dp-codecs.h \
> modules/bluetooth/a2dp/rtp.h
> +if HAVE_FDK_AAC
> +libbluez5_util_la_SOURCES += \
> +   modules/bluetooth/a2dp/a2dp_aac.c
> +endif
>  if HAVE_BLUEZ_5_OFONO_HEADSET
>  libbluez5_util_la_SOURCES += \
> modules/bluetooth/backend-ofono.c
> @@ -2140,6 +2144,10 @@ endif
>  libbluez5_util_la_LDFLAGS = -avoid-version
>  libbluez5_util_la_LIBADD = $(MODULE_LIBADD) $(DBUS_LIBS) $(SBC_LIBS)
>  libbluez5_util_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) $(SBC_CFLAGS)
> +if HAVE_FDK_AAC
> +libbluez5_util_la_LIBADD += $(FDK_AAC_LIBS)
> +libbluez5_util_la_CFLAGS += $(FDK_AAC_CFLAGS)
> +endif
>
>  module_bluez5_discover_la_SOURCES = 
> modules/bluetooth/module-bluez5-discover.c
>  module_bluez5_discover_la_LDFLAGS = $(MODULE_LDFLAGS)
> diff --git a/src/modules/bluetooth/a2dp/a2dp-api.h 
> b/src/modules/bluetooth/a2dp/a2dp-api.h
> index 1492d29fd..1e601a9c5 100644
> --- a/src/modules/bluetooth/a2dp/a2dp-api.h
> +++