Re: [pulseaudio-discuss] [PATCH v3 4/4] Add A2DP LDAC codec source support

2019-01-14 Thread Pali Rohár
On Monday 14 January 2019 12:34:02 Huang-Huang Bao wrote:
> My bad, noticed before, but I forgot it when adding copyrights.
> 
> On 1/13/19 10:14 AM, Pali Rohár wrote:
> > On Saturday 29 December 2018 23:48:08 Huang-Huang Bao wrote:
> >> diff --git a/src/modules/bluetooth/a2dp/a2dp_ldac.c 
> >> b/src/modules/bluetooth/a2dp/a2dp_ldac.c
> >> new file mode 100644
> >> index 0..8095d2435
> >> --- /dev/null
> >> +++ b/src/modules/bluetooth/a2dp/a2dp_ldac.c
> >> @@ -0,0 +1,605 @@
> >> +/***
> >> +  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 
> >> +
> >> +#ifdef HAVE_CONFIG_H
> >> +
> >> +#include 
> >> +
> >> +#endif
> >> +
> >> +#include 
> >> +#include 
> >> +
> >> +#include 
> >> +#include 
> > This looks like an another license problem. This Sony's LDAC encoder
> > library is licensed under Apache License Version 2.0 which is not
> > compatible with above LGPL 2.1.
> >
> > IIRC Apache License Version 2.0 can be used in GPLv3 projects, so
> > without relicensing pulseaudio to (L)GPLv3 this looks like a problem.
> >
> Could we relicense bluez modules or AAC/LDAC staffs to LGPLv3?

I guess this is possible only in case whole pulseaudio server is
relicensed to GPLv3 as all those code is running in pulseaudio server.
And this would be problematic... :-(

-- 
Pali Rohár
pali.ro...@gmail.com
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v3 4/4] Add A2DP LDAC codec source support

2019-01-13 Thread Huang-Huang Bao
My bad, noticed before, but I forgot it when adding copyrights.

On 1/13/19 10:14 AM, Pali Rohár wrote:
> On Saturday 29 December 2018 23:48:08 Huang-Huang Bao wrote:
>> diff --git a/src/modules/bluetooth/a2dp/a2dp_ldac.c 
>> b/src/modules/bluetooth/a2dp/a2dp_ldac.c
>> new file mode 100644
>> index 0..8095d2435
>> --- /dev/null
>> +++ b/src/modules/bluetooth/a2dp/a2dp_ldac.c
>> @@ -0,0 +1,605 @@
>> +/***
>> +  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 
>> +
>> +#ifdef HAVE_CONFIG_H
>> +
>> +#include 
>> +
>> +#endif
>> +
>> +#include 
>> +#include 
>> +
>> +#include 
>> +#include 
> This looks like an another license problem. This Sony's LDAC encoder
> library is licensed under Apache License Version 2.0 which is not
> compatible with above LGPL 2.1.
>
> IIRC Apache License Version 2.0 can be used in GPLv3 projects, so
> without relicensing pulseaudio to (L)GPLv3 this looks like a problem.
>
Could we relicense bluez modules or AAC/LDAC staffs to LGPLv3?

>
> ___
> pulseaudio-discuss mailing list
> pulseaudio-discuss@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


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


Re: [pulseaudio-discuss] [PATCH v3 4/4] Add A2DP LDAC codec source support

2019-01-12 Thread Pali Rohár
On Saturday 29 December 2018 23:48:08 Huang-Huang Bao wrote:
> diff --git a/src/modules/bluetooth/a2dp/a2dp_ldac.c 
> b/src/modules/bluetooth/a2dp/a2dp_ldac.c
> new file mode 100644
> index 0..8095d2435
> --- /dev/null
> +++ b/src/modules/bluetooth/a2dp/a2dp_ldac.c
> @@ -0,0 +1,605 @@
> +/***
> +  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 
> +
> +#ifdef HAVE_CONFIG_H
> +
> +#include 
> +
> +#endif
> +
> +#include 
> +#include 
> +
> +#include 
> +#include 

This looks like an another license problem. This Sony's LDAC encoder
library is licensed under Apache License Version 2.0 which is not
compatible with above LGPL 2.1.

IIRC Apache License Version 2.0 can be used in GPLv3 projects, so
without relicensing pulseaudio to (L)GPLv3 this looks like a problem.

-- 
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


[pulseaudio-discuss] [PATCH v3 4/4] Add A2DP LDAC codec source support

2018-12-29 Thread Huang-Huang Bao
Require https://github.com/EHfive/ldacBT

Optional (build with --disable-bluez5-ldac-codec)

LDAC User Configurations
   KEY VALUEDESC  
DEFAULT
   ldac_eqmid  hq   High Quality (encoder)auto
   sq   Standard Quality (encoder)
   mq   Mobile use Quality (encoder)
   auto/abr Adaptive Bit Rate (encoder)

   ldac_fmts16  16-bit signed LE (encoder)auto
   s24  24-bit signed LE (encoder)
   s32  32-bit signed LE (encoder)
   f32  32-bit float  LE (encoder)
   auto
---
 configure.ac   |  16 +
 src/Makefile.am|   8 +
 src/modules/bluetooth/a2dp/a2dp-api.h  |   6 +
 src/modules/bluetooth/a2dp/a2dp_ldac.c | 605 +
 src/modules/bluetooth/a2dp/a2dp_util.c |  29 ++
 5 files changed, 664 insertions(+)
 create mode 100644 src/modules/bluetooth/a2dp/a2dp_ldac.c

diff --git a/configure.ac b/configure.ac
index 586077e5b..eccf9c3d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1107,6 +1107,20 @@ AC_SUBST(HAVE_FF_APTX)
 AM_CONDITIONAL([HAVE_FF_APTX], [test "x$HAVE_FF_APTX" = x1])
 AS_IF([test "x$HAVE_FF_APTX" = "x1"], AC_DEFINE([HAVE_FF_APTX], 1, [Bluez 5 
A2DP aptX, aptX HD codecs enabled]))
 
+## LDAC source ##
+AC_ARG_ENABLE([bluez5-ldac-codec],
+AS_HELP_STRING([--disable-bluez5-ldac-codec],[Disable optional A2DP LDAC 
codec encoding support (Bluez 5)]))
+AS_IF([test "x$HAVE_BLUEZ_5" = "x1" && test "x$enable_bluez5_ldac_codec" != 
"xno"],
+[PKG_CHECK_MODULES(LDACBT_ENC, [ ldacBT-enc ], HAVE_LDACBT_ENC=1, 
HAVE_LDACBT_ENC=0)],
+HAVE_LDACBT_ENC=0)
+AS_IF([test "x$HAVE_BLUEZ_5" = "x1" && test "x$enable_bluez5_ldac_codec" != 
"xno"],
+[PKG_CHECK_MODULES(LDACBT_ABR, [ ldacBT-abr ], HAVE_LDACBT_ABR=1, 
HAVE_LDACBT_ABR=0)],
+HAVE_LDACBT_ABR=0)
+AS_IF([test "x$HAVE_LDACBT_ENC" = "x1" && test "x$HAVE_LDACBT_ABR" = "x1"], 
HAVE_LDACBT=1, HAVE_LDACBT=0)
+AC_SUBST(HAVE_LDACBT)
+AM_CONDITIONAL([HAVE_LDACBT], [test "x$HAVE_LDACBT" = x1])
+AS_IF([test "x$HAVE_LDACBT" = "x1"], AC_DEFINE([HAVE_LDACBT], 1, [Bluez 5 A2DP 
LDAC codec encoding support enabled]))
+
 ## Bluetooth Headset profiles backend ##
 
 AC_ARG_ENABLE([bluez5-ofono-headset],
@@ -1613,6 +1627,7 @@ AS_IF([test "x$HAVE_SYSTEMD_JOURNAL" = "x1"], 
ENABLE_SYSTEMD_JOURNAL=yes, ENABLE
 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_FF_APTX" = "x1"], ENABLE_BLUEZ_5_APTX_CODEC=yes, 
ENABLE_BLUEZ_5_APTX_CODEC=no)
+AS_IF([test "x$HAVE_LDACBT" = "x1"], ENABLE_BLUEZ_5_LDAC_CODEC=yes, 
ENABLE_BLUEZ_5_LDAC_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)
@@ -1673,6 +1688,7 @@ echo "
   Enable BlueZ 5:  ${ENABLE_BLUEZ_5}
 Enable A2DP AAC codec: ${ENABLE_BLUEZ_5_AAC_CODEC}
 Enable A2DP aptX(HD):  ${ENABLE_BLUEZ_5_APTX_CODEC}
+Enable A2DP LDAC source:   ${ENABLE_BLUEZ_5_LDAC_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 5bb43c3a6..51a620a81 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2136,6 +2136,10 @@ if HAVE_FF_APTX
 libbluez5_util_la_SOURCES += \
modules/bluetooth/a2dp/a2dp_aptx.c
 endif
+if HAVE_LDACBT
+libbluez5_util_la_SOURCES += \
+   modules/bluetooth/a2dp/a2dp_ldac.c
+endif
 if HAVE_BLUEZ_5_OFONO_HEADSET
 libbluez5_util_la_SOURCES += \
modules/bluetooth/backend-ofono.c
@@ -2156,6 +2160,10 @@ if HAVE_FF_APTX
 libbluez5_util_la_LIBADD += $(FF_AVCODEC_LIBS) $(FF_AVUTIL_LIBS)
 libbluez5_util_la_CFLAGS += $(FF_AVCODEC_CFLAGS) $(FF_AVUTIL_CFLAGS)
 endif
+if HAVE_LDACBT
+libbluez5_util_la_LIBADD += $(LDACBT_ENC_LIBS) $(LDACBT_ABR_LIBS)
+libbluez5_util_la_CFLAGS += $(LDACBT_ENC_CFLAGS) $(LDACBT_ABR_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 59ec21a8b..155127c4f 100644
--- a/src/modules/bluetooth/a2dp/a2dp-api.h
+++ b/src/modules/bluetooth/a2dp/a2dp-api.h
@@ -44,6 +44,9 @@ extern const pa_a2dp_codec_t pa_a2dp_aac;
 extern const pa_a2dp_codec_t pa_a2dp_aptx;
 extern const