2011-12-30 19:26:08

by Anderson Lizardo

[permalink] [raw]
Subject: [PATCH BlueZ 1/4] Remove PulseAudio plugin leftover

The .c file and the configure check were not being used anywhere.
---
acinclude.m4 | 6 ------
audio/module-bluetooth-sink.c | 39 ---------------------------------------
2 files changed, 0 insertions(+), 45 deletions(-)
delete mode 100644 audio/module-bluetooth-sink.c

diff --git a/acinclude.m4 b/acinclude.m4
index 753b994..e86823a 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -124,12 +124,6 @@ AC_DEFUN([AC_PATH_GSTREAMER], [
AC_SUBST(GSTREAMER_PLUGINSDIR)
])

-AC_DEFUN([AC_PATH_PULSE], [
- PKG_CHECK_MODULES(PULSE, libpulse, pulse_found=yes, pulse_found=no)
- AC_SUBST(PULSE_CFLAGS)
- AC_SUBST(PULSE_LIBS)
-])
-
AC_DEFUN([AC_PATH_ALSA], [
PKG_CHECK_MODULES(ALSA, alsa, alsa_found=yes, alsa_found=no)
AC_CHECK_LIB(rt, clock_gettime, ALSA_LIBS="$ALSA_LIBS -lrt", alsa_found=no)
diff --git a/audio/module-bluetooth-sink.c b/audio/module-bluetooth-sink.c
deleted file mode 100644
index a0117c0..0000000
--- a/audio/module-bluetooth-sink.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * BlueZ - Bluetooth protocol stack for Linux
- *
- * Copyright (C) 2004-2010 Marcel Holtmann <[email protected]>
- *
- *
- * This library 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.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#if 0
-#include <pulsecore/module.h>
-
-PA_MODULE_AUTHOR("Marcel Holtmann <[email protected]>")
-PA_MODULE_DESCRIPTION("Bluetooth sink")
-PA_MODULE_VERSION(VERSION)
-
-int pa__init(pa_core *core, pa_module *module)
-{
- return 0;
-}
-#endif
--
1.7.0.4



2011-12-31 12:22:24

by Anderson Lizardo

[permalink] [raw]
Subject: Re: [PATCH BlueZ 3/4] Enable input/sixpair build (but no installation)

Hi Antonio,

On Fri, Dec 30, 2011 at 5:47 PM, Antonio Ospite
<[email protected]> wrote:
> I'd say the .c file can be removed if you want to, when I have time I am
> going to resend the playstation-peripheral plugin and the prerequisite
> patches to have it as an _external_ plugin, I hope to do that next
> week.

Given that you are still actively working on this plugin, I will ask
Johan to ignore this patch. This way, you can still remove it on your
patch series.

Best Regards/Happy New Year,
--
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil

2011-12-30 23:47:27

by Bastien Nocera

[permalink] [raw]
Subject: Re: [PATCH BlueZ 3/4] Enable input/sixpair build (but no installation)

Em Fri, 2011-12-30 às 22:47 +0100, Antonio Ospite escreveu:
> On Fri, 30 Dec 2011 15:26:10 -0400
> Anderson Lizardo <[email protected]> wrote:
>
> > "sixpair" is a standalone tool to manage PS3 controllers. It was the
> > only tool not being built by default.
> >
> > To build it, it is necessary to check for libusb-1.0 (besides the
> > existing libusb 0.1 check). The check is optional, and sixpair will not
> > be built if libusb-1.0 headers are not installed.
> > ---
> >
> > I personally never used this tool. So I'm not sure if the best approach is to
> > completely remove it instead. If that's the case, let me know so I send a patch
> > removing the .c file instead.
> >
>
> Hi Anderson,
>
> I'd say the .c file can be removed if you want to, when I have time I am
> going to resend the playstation-peripheral plugin and the prerequisite
> patches to have it as an _external_ plugin, I hope to do that next
> week.
>
> In my previous submissions of the playstation-peripheral plugin I was
> removing this .c file just before adding the new plugin, and I am going
> to "revert" this patch anyways, so you can choose to drop this patch
> and let me remove the .c file when I add the plugin, or remove it right
> now. I think there isn't much of a gain enabling the build of the
> sixpair.c currently in BlueZ.
>
> I am adding Bastien on CC as he was the author of the sixpair currently
> in BlueZ, Bastien what do you think?

Don't care. Been shipping a working-but-not-perfect version of a sixpair
plugin in the Fedora bluez package for at least 2 years. I'd be very
happy to drop that patch in favour of a supported version.

Cheers


2011-12-30 21:47:53

by Antonio Ospite

[permalink] [raw]
Subject: Re: [PATCH BlueZ 3/4] Enable input/sixpair build (but no installation)

On Fri, 30 Dec 2011 15:26:10 -0400
Anderson Lizardo <[email protected]> wrote:

> "sixpair" is a standalone tool to manage PS3 controllers. It was the
> only tool not being built by default.
>
> To build it, it is necessary to check for libusb-1.0 (besides the
> existing libusb 0.1 check). The check is optional, and sixpair will not
> be built if libusb-1.0 headers are not installed.
> ---
>
> I personally never used this tool. So I'm not sure if the best approach is to
> completely remove it instead. If that's the case, let me know so I send a patch
> removing the .c file instead.
>

Hi Anderson,

I'd say the .c file can be removed if you want to, when I have time I am
going to resend the playstation-peripheral plugin and the prerequisite
patches to have it as an _external_ plugin, I hope to do that next
week.

In my previous submissions of the playstation-peripheral plugin I was
removing this .c file just before adding the new plugin, and I am going
to "revert" this patch anyways, so you can choose to drop this patch
and let me remove the .c file when I add the plugin, or remove it right
now. I think there isn't much of a gain enabling the build of the
sixpair.c currently in BlueZ.

I am adding Bastien on CC as he was the author of the sixpair currently
in BlueZ, Bastien what do you think?

Thanks,
Antonio

> .gitignore | 1 +
> Makefile.tools | 10 ++++++++++
> acinclude.m4 | 5 +++++
> 3 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/.gitignore b/.gitignore
> index badd1a0..0c5ef15 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -46,6 +46,7 @@ sbc/sbcinfo
> sbc/sbctester
>
> attrib/gatttool
> +input/sixpair
> tracer/hcitrace
> tools/avctrl
> tools/avinfo
> diff --git a/Makefile.tools b/Makefile.tools
> index eea1a9b..400ed1b 100644
> --- a/Makefile.tools
> +++ b/Makefile.tools
> @@ -63,6 +63,16 @@ attrib_gatttool_SOURCES = attrib/gatttool.c attrib/att.c attrib/gatt.c \
> attrib_gatttool_LDADD = lib/libbluetooth-private.la @GLIB_LIBS@ @READLINE_LIBS@
> endif
>
> +if SIXPAIR
> +noinst_PROGRAMS += input/sixpair
> +
> +input_sixpair_CFLAGS = $(AM_CFLAGS) @USB10_CFLAGS@
> +input_sixpair_SOURCES = input/sixpair.c src/storage.c src/storage.h \
> + src/textfile.c src/textfile.h src/glib-helper.c \
> + src/glib-helper.h
> +input_sixpair_LDADD = lib/libbluetooth-private.la @GLIB_LIBS@ @USB10_LIBS@
> +endif
> +
> dist_man_MANS += tools/rfcomm.1 tools/l2ping.8 \
> tools/hciattach.8 tools/hciconfig.8 \
> tools/hcitool.1 tools/sdptool.1 tools/ciptool.1
> diff --git a/acinclude.m4 b/acinclude.m4
> index 4c72fee..f2a4845 100644
> --- a/acinclude.m4
> +++ b/acinclude.m4
> @@ -141,6 +141,10 @@ AC_DEFUN([AC_PATH_USB], [
> AC_CHECK_LIB(usb, usb_interrupt_read, dummy=yes,
> AC_DEFINE(NEED_USB_INTERRUPT_READ, 1,
> [Define to 1 if you need the usb_interrupt_read() function.]))
> +
> + PKG_CHECK_MODULES(USB10, libusb-1.0, usb10_found=yes, usb10_found=no)
> + AC_SUBST(USB10_CFLAGS)
> + AC_SUBST(USB10_LIBS)
> ])
>
> AC_DEFUN([AC_PATH_UDEV], [
> @@ -427,6 +431,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
> AM_CONDITIONAL(PCMCIA, test "${pcmcia_enable}" = "yes")
> AM_CONDITIONAL(HID2HCI, test "${hid2hci_enable}" = "yes" && test "${usb_found}" = "yes" && test "${udev_found}" = "yes")
> AM_CONDITIONAL(DFUTOOL, test "${dfutool_enable}" = "yes" && test "${usb_found}" = "yes")
> + AM_CONDITIONAL(SIXPAIR, test "${usb10_found}" = "yes")
> AM_CONDITIONAL(DATAFILES, test "${datafiles_enable}" = "yes")
> AM_CONDITIONAL(MAEMO6PLUGIN, test "${maemo6_enable}" = "yes")
> AM_CONDITIONAL(DBUSOOBPLUGIN, test "${dbusoob_enable}" = "yes")
> --

--
Antonio Ospite
http://ao2.it

A: Because it messes up the order in which people normally read text.
See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?


Attachments:
(No filename) (3.76 kB)
(No filename) (198.00 B)
Download all attachments

2011-12-30 20:05:35

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH BlueZ 4/4] Add missing options to bootstrap-configure

Hi Anderson,

> With these options, all BlueZ C files are compiled with
> "./bootstrap-configure". The only exception is --enable-hal, which
> conflicts with the "formfactor" plugin.

actually since HAL is deprecated since a long time now, lets just go
ahead and remove that plugin as well.

Regards

Marcel



2011-12-30 19:26:11

by Anderson Lizardo

[permalink] [raw]
Subject: [PATCH BlueZ 4/4] Add missing options to bootstrap-configure

With these options, all BlueZ C files are compiled with
"./bootstrap-configure". The only exception is --enable-hal, which
conflicts with the "formfactor" plugin.
---
bootstrap-configure | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/bootstrap-configure b/bootstrap-configure
index 89ea156..bdb9234 100755
--- a/bootstrap-configure
+++ b/bootstrap-configure
@@ -32,6 +32,9 @@ fi
--enable-dund \
--enable-test \
--enable-cups \
+ --enable-dbusoob \
+ --enable-maemo6 \
+ --enable-pnat \
--enable-sap \
--enable-thermometer \
--enable-wiimote \
--
1.7.0.4


2011-12-30 19:26:10

by Anderson Lizardo

[permalink] [raw]
Subject: [PATCH BlueZ 3/4] Enable input/sixpair build (but no installation)

"sixpair" is a standalone tool to manage PS3 controllers. It was the
only tool not being built by default.

To build it, it is necessary to check for libusb-1.0 (besides the
existing libusb 0.1 check). The check is optional, and sixpair will not
be built if libusb-1.0 headers are not installed.
---

I personally never used this tool. So I'm not sure if the best approach is to
completely remove it instead. If that's the case, let me know so I send a patch
removing the .c file instead.

.gitignore | 1 +
Makefile.tools | 10 ++++++++++
acinclude.m4 | 5 +++++
3 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index badd1a0..0c5ef15 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,6 +46,7 @@ sbc/sbcinfo
sbc/sbctester

attrib/gatttool
+input/sixpair
tracer/hcitrace
tools/avctrl
tools/avinfo
diff --git a/Makefile.tools b/Makefile.tools
index eea1a9b..400ed1b 100644
--- a/Makefile.tools
+++ b/Makefile.tools
@@ -63,6 +63,16 @@ attrib_gatttool_SOURCES = attrib/gatttool.c attrib/att.c attrib/gatt.c \
attrib_gatttool_LDADD = lib/libbluetooth-private.la @GLIB_LIBS@ @READLINE_LIBS@
endif

+if SIXPAIR
+noinst_PROGRAMS += input/sixpair
+
+input_sixpair_CFLAGS = $(AM_CFLAGS) @USB10_CFLAGS@
+input_sixpair_SOURCES = input/sixpair.c src/storage.c src/storage.h \
+ src/textfile.c src/textfile.h src/glib-helper.c \
+ src/glib-helper.h
+input_sixpair_LDADD = lib/libbluetooth-private.la @GLIB_LIBS@ @USB10_LIBS@
+endif
+
dist_man_MANS += tools/rfcomm.1 tools/l2ping.8 \
tools/hciattach.8 tools/hciconfig.8 \
tools/hcitool.1 tools/sdptool.1 tools/ciptool.1
diff --git a/acinclude.m4 b/acinclude.m4
index 4c72fee..f2a4845 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -141,6 +141,10 @@ AC_DEFUN([AC_PATH_USB], [
AC_CHECK_LIB(usb, usb_interrupt_read, dummy=yes,
AC_DEFINE(NEED_USB_INTERRUPT_READ, 1,
[Define to 1 if you need the usb_interrupt_read() function.]))
+
+ PKG_CHECK_MODULES(USB10, libusb-1.0, usb10_found=yes, usb10_found=no)
+ AC_SUBST(USB10_CFLAGS)
+ AC_SUBST(USB10_LIBS)
])

AC_DEFUN([AC_PATH_UDEV], [
@@ -427,6 +431,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
AM_CONDITIONAL(PCMCIA, test "${pcmcia_enable}" = "yes")
AM_CONDITIONAL(HID2HCI, test "${hid2hci_enable}" = "yes" && test "${usb_found}" = "yes" && test "${udev_found}" = "yes")
AM_CONDITIONAL(DFUTOOL, test "${dfutool_enable}" = "yes" && test "${usb_found}" = "yes")
+ AM_CONDITIONAL(SIXPAIR, test "${usb10_found}" = "yes")
AM_CONDITIONAL(DATAFILES, test "${datafiles_enable}" = "yes")
AM_CONDITIONAL(MAEMO6PLUGIN, test "${maemo6_enable}" = "yes")
AM_CONDITIONAL(DBUSOOBPLUGIN, test "${dbusoob_enable}" = "yes")
--
1.7.0.4


2011-12-30 19:26:09

by Anderson Lizardo

[permalink] [raw]
Subject: [PATCH BlueZ 2/4] Remove unused/broken "echo" RFCOMM plugin

It was disabled for quite some time (since 2009), and does not even
compile anymore if enabled:

plugins/echo.c: In function 'session_event':
plugins/echo.c:53: error: implicit declaration of function
'g_io_channel_read'
plugins/echo.c:57: error: implicit declaration of function
'g_io_channel_write'
---
Makefile.am | 5 --
acinclude.m4 | 1 -
plugins/echo.c | 167 --------------------------------------------------------
3 files changed, 0 insertions(+), 173 deletions(-)
delete mode 100644 plugins/echo.c

diff --git a/Makefile.am b/Makefile.am
index 8bc6cfe..102ee62 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -131,11 +131,6 @@ builtin_modules += pnat
builtin_sources += plugins/pnat.c
endif

-if ECHOPLUGIN
-builtin_modules += echo
-builtin_sources += plugins/echo.c
-endif
-
if AUDIOPLUGIN
builtin_modules += audio
builtin_sources += audio/main.c \
diff --git a/acinclude.m4 b/acinclude.m4
index e86823a..4c72fee 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -415,7 +415,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
AM_CONDITIONAL(HAL, test "${hal_enable}" = "yes")
AM_CONDITIONAL(READLINE, test "${readline_found}" = "yes")
AM_CONDITIONAL(GATT_EXAMPLE_PLUGIN, test "${gatt_example_enable}" = "yes")
- AM_CONDITIONAL(ECHOPLUGIN, test "no" = "yes")
AM_CONDITIONAL(PNATPLUGIN, test "${pnat_enable}" = "yes")
AM_CONDITIONAL(TRACER, test "${tracer_enable}" = "yes")
AM_CONDITIONAL(HIDD, test "${hidd_enable}" = "yes")
diff --git a/plugins/echo.c b/plugins/echo.c
deleted file mode 100644
index 23f6e49..0000000
--- a/plugins/echo.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- *
- * BlueZ - Bluetooth protocol stack for Linux
- *
- * Copyright (C) 2004-2010 Marcel Holtmann <[email protected]>
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <errno.h>
-#include <unistd.h>
-#include <sys/socket.h>
-
-#include <bluetooth/bluetooth.h>
-#include <bluetooth/rfcomm.h>
-
-#include <glib.h>
-
-#include <gdbus.h>
-
-#include "plugin.h"
-#include "adapter.h"
-#include "log.h"
-
-static gboolean session_event(GIOChannel *chan,
- GIOCondition cond, gpointer data)
-{
- unsigned char buf[672];
- gsize len, written;
- GIOError err;
-
- if (cond & (G_IO_HUP | G_IO_ERR | G_IO_NVAL))
- return FALSE;
-
- err = g_io_channel_read(chan, (gchar *) buf, sizeof(buf), &len);
- if (err == G_IO_ERROR_AGAIN)
- return TRUE;
-
- g_io_channel_write(chan, (const gchar *) buf, len, &written);
-
- return TRUE;
-}
-
-static gboolean connect_event(GIOChannel *chan,
- GIOCondition cond, gpointer data)
-{
- GIOChannel *io;
- struct sockaddr_rc addr;
- socklen_t optlen;
- char address[18];
- int sk, nsk;
-
- sk = g_io_channel_unix_get_fd(chan);
-
- memset(&addr, 0, sizeof(addr));
- optlen = sizeof(addr);
-
- nsk = accept(sk, (struct sockaddr *) &addr, &optlen);
- if (nsk < 0)
- return TRUE;
-
- io = g_io_channel_unix_new(nsk);
- g_io_channel_set_close_on_unref(io, TRUE);
-
- ba2str(&addr.rc_bdaddr, address);
-
- g_io_add_watch(io, G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
- session_event, NULL);
-
- return TRUE;
-}
-
-static GIOChannel *setup_rfcomm(uint8_t channel)
-{
- GIOChannel *io;
- struct sockaddr_rc addr;
- int sk;
-
- sk = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
- if (sk < 0)
- return NULL;
-
- memset(&addr, 0, sizeof(addr));
- addr.rc_family = AF_BLUETOOTH;
- bacpy(&addr.rc_bdaddr, BDADDR_ANY);
- addr.rc_channel = channel;
-
- if (bind(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
- close(sk);
- return NULL;
- }
-
- if (listen(sk, 10) < 0) {
- close(sk);
- return NULL;
- }
-
- io = g_io_channel_unix_new(sk);
- g_io_channel_set_close_on_unref(io, TRUE);
-
- g_io_add_watch(io, G_IO_IN, connect_event, NULL);
-
- return io;
-}
-
-static GIOChannel *chan = NULL;
-
-static int echo_probe(struct btd_adapter *adapter)
-{
- const char *path = adapter_get_path(adapter);
-
- DBG("path %s", path);
-
- chan = setup_rfcomm(23);
-
- return 0;
-}
-
-static void echo_remove(struct btd_adapter *adapter)
-{
- const char *path = adapter_get_path(adapter);
-
- DBG("path %s", path);
-
- g_io_channel_unref(chan);
-}
-
-static struct btd_adapter_driver echo_server = {
- .name = "echo-server",
- .probe = echo_probe,
- .remove = echo_remove,
-};
-
-static int echo_init(void)
-{
- DBG("Setup echo plugin");
-
- return btd_register_adapter_driver(&echo_server);
-}
-
-static void echo_exit(void)
-{
- DBG("Cleanup echo plugin");
-
- btd_unregister_adapter_driver(&echo_server);
-}
-
-BLUETOOTH_PLUGIN_DEFINE(echo, VERSION,
- BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, echo_init, echo_exit)
--
1.7.0.4


2012-01-09 12:53:30

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH BlueZ 1/4] Remove PulseAudio plugin leftover

Hi Lizardo,

On Fri, Dec 30, 2011, Anderson Lizardo wrote:
> The .c file and the configure check were not being used anywhere.
> ---
> acinclude.m4 | 6 ------
> audio/module-bluetooth-sink.c | 39 ---------------------------------------
> 2 files changed, 0 insertions(+), 45 deletions(-)
> delete mode 100644 audio/module-bluetooth-sink.c

Patches 1, 2 and 4 have been applied. Thanks.

Johan