* [PATCH BlueZ 1/2] build: Fix --disable-optimization configure option
From: Anderson Lizardo @ 2013-01-08 15:46 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Anderson Lizardo
On commit cc9e4e7cae0379864ea06038d92bf7ecc192bba7, this flag was
mistakenly replaced with the behavior of the old --enable-fortify
option.
This patch restores the "-O0" flag when --disable-optimization is used.
Unfortunately, this is not enough to disable build optimization. By
default, autoconf adds -O2 to CFLAGS if the compiler is GCC. AM_CFLAGS
(where -O0 is added with --disable-optimization) is passed as argument
to GCC before autoconf CFLAGS, so it is not possible to override the
default -O2. One solution is to use:
CFLAGS= ./configure --disable-optimization
i.e. remove -O2 from CFLAGS, and let autoconf add -O0.
---
acinclude.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/acinclude.m4 b/acinclude.m4
index 4357c00..286340d 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -32,7 +32,7 @@ AC_DEFUN([MISC_FLAGS], [
AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
[disable code optimization through compiler]), [
if (test "${enableval}" = "no"); then
- misc_cflags="$misc_cflags -D_FORTIFY_SOURCE=2"
+ misc_cflags="$misc_cflags -O0"
fi
])
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
--
1.7.9.5
^ permalink raw reply related
* usb device removed from sysfs before input children devices
From: Karl Relton @ 2013-01-08 14:33 UTC (permalink / raw)
To: linux-usb, linux-bluetooth
On coming out of suspend my usb bluetooth adaptor is being reset by the
system.
In linux 3.7 the usb devices are being removed from the sysfs tree
first, and then the various 'child' devices (like my bluetooth mouse &
keyboard related devices) afterwards. This is causing the udev events
for the input devices to have 'orphaned' sysfs paths in the udev events.
This in turn means the Xorg evdev driver does not recognise the events,
and so doesn't see the removal of the input devices.
This has been picked by some downstream distributions, e.g. see this
thread by Google Chrome developers:
http://code.google.com/p/chromium-os/issues/detail?id=33813
Back on linux 3.2 this was not the case. The usb adaptor was reset, but
device removal was orderly: first the input devices (will full paths in
the udev events), then the usb devices walking up the tree.
To illustrate the issue, here is the output of 'udevadm monitor' in 3.7:
udevadm monitor
monitor will print the received events for:
KERNEL - the kernel uevent
KERNEL[2203.173080] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0/bluetooth/hci0/rfkill2 (rfkill)
KERNEL[2203.173148] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0/bluetooth/hci0 (bluetooth)
KERNEL[2203.173420] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0 (usb)
KERNEL[2203.173451] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.1 (usb)
KERNEL[2203.173475] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.2 (usb)
KERNEL[2203.173693] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2 (usb)
KERNEL[2213.152339] remove /hci0/hci0:46/input14/mouse2 (input)
KERNEL[2213.160374] remove /hci0/hci0:46/input14/event10 (input)
KERNEL[2213.168366] remove /hci0/hci0:46/input14 (input)
KERNEL[2213.169058] remove /hci0/hci0:46/0005:050D:0031.0005/hidraw/hidraw0 (hidraw)
KERNEL[2213.169198] remove /hci0/hci0:46/0005:050D:0031.0005 (hid)
KERNEL[2213.169242] remove /hci0/hci0:46 (bluetooth)
KERNEL[2218.176527] remove /hci0/hci0:49/input13/event11 (input)
KERNEL[2218.180403] remove /hci0/hci0:49/input13 (input)
KERNEL[2218.180481] remove /hci0/hci0:49/0005:05AC:0256.0004/hidraw/hidraw1 (hidraw)
KERNEL[2218.180538] remove /hci0/hci0:49/0005:05AC:0256.0004 (hid)
KERNEL[2218.182005] remove /hci0/hci0:49 (bluetooth)
See how the usb devices are moved first, and then the input/bluetooth related stuff
with path-heads removed (paths are now /hci0/... instead of /devices/...)
Here is the equiv sequence back in 3.2:
KERNEL[158.378301] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0/bluetooth/hci0/hci0:49/input11/mouse2 (input)
KERNEL[158.388283] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0/bluetooth/hci0/hci0:49/input11/event11 (input)
KERNEL[158.409885] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0/bluetooth/hci0/hci0:49/input11 (input)
KERNEL[158.411565] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0/bluetooth/hci0/hci0:49/0005:050D:0031.0002/hidraw/hidraw1 (hidraw)
KERNEL[158.411598] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0/bluetooth/hci0/hci0:49/0005:050D:0031.0002 (hid)
KERNEL[158.411621] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0/bluetooth/hci0/hci0:49 (bluetooth)
KERNEL[158.436894] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0/bluetooth/hci0/hci0:46/input10/event10 (input)
KERNEL[158.452211] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0/bluetooth/hci0/hci0:46/input10 (input)
KERNEL[158.452628] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0/bluetooth/hci0/hci0:46/0005:05AC:0256.0001/hidraw/hidraw0 (hidraw)
KERNEL[158.452662] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0/bluetooth/hci0/hci0:46/0005:05AC:0256.0001 (hid)
KERNEL[158.452752] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0/bluetooth/hci0/hci0:46 (bluetooth)
KERNEL[158.629847] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0/bluetooth/hci0/rfkill2 (rfkill)
KERNEL[158.629920] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0/bluetooth/hci0 (bluetooth)
KERNEL[158.635562] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0 (usb)
KERNEL[158.635701] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.1 (usb)
KERNEL[158.635807] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.2 (usb)
KERNEL[158.637238] remove /devices/pci0000:00/0000:00:1a.0/usb3/3-2 (usb)
The end result (for the user) is that even when the bluetooth
mouse/keyboard is re-added, Xorg ignores it - thinking it is some hoax
duplicate device. The keyboard/mouse is then non-operational.
Karl
^ permalink raw reply
* [PATCH hidp] Fix Kernel OOPS in hidp_session caused by orphaned sock structures
From: Karl Relton @ 2013-01-08 14:21 UTC (permalink / raw)
To: linux-bluetooth
This is a proposed fix to the kernel OOPS reported in
https://bugzilla.kernel.org/show_bug.cgi?id=50541
hidp_session() is crashing the kernel typically on a resume from
suspend. My analysis concluded that the sock structure pointed to by
ctrl_sk was being orphaned at some point parallel to the execution of
hidp_session (sometimes even while hidp_session is still in its main
loop). This mean that calls to sk_sleep(ctrl_sk) would return NULL,
leading to ..._wait() or ..._wakeup() calls crashing.
The proposed fix is to store the waitqueue_head structure needed for the
waiting/waking in a local variable. rcu_dereference_raw() [normally
called via sk_sleep()] is still used and required to protect access, but
we ensure we have the proper handle onto the structure rather than
losing it by the sock being orphaned.
Signed-off-by: Karl Relton <karllinuxtest.relton@ntlworld.com>
--- linux-3.7.0.orig/net/bluetooth/hidp/core.c 2013-01-08 13:04:35.945237334 +0000
+++ linux-3.7.0/net/bluetooth/hidp/core.c 2013-01-08 13:06:11.313240959 +0000
@@ -680,16 +680,19 @@ static int hidp_session(void *arg)
struct sock *intr_sk = session->intr_sock->sk;
struct sk_buff *skb;
wait_queue_t ctrl_wait, intr_wait;
+ struct socket_wq *ctrl_wq, *intr_wq;
BT_DBG("session %p", session);
__module_get(THIS_MODULE);
set_user_nice(current, -15);
+ ctrl_wq = ctrl_sk->sk_wq;
+ intr_wq = intr_sk->sk_wq;
init_waitqueue_entry(&ctrl_wait, current);
init_waitqueue_entry(&intr_wait, current);
- add_wait_queue(sk_sleep(ctrl_sk), &ctrl_wait);
- add_wait_queue(sk_sleep(intr_sk), &intr_wait);
+ add_wait_queue(&rcu_dereference_raw(ctrl_wq)->wait, &ctrl_wait);
+ add_wait_queue(&rcu_dereference_raw(intr_wq)->wait, &intr_wait);
session->waiting_for_startup = 0;
wake_up_interruptible(&session->startup_queue);
set_current_state(TASK_INTERRUPTIBLE);
@@ -722,8 +725,8 @@ static int hidp_session(void *arg)
set_current_state(TASK_INTERRUPTIBLE);
}
set_current_state(TASK_RUNNING);
- remove_wait_queue(sk_sleep(intr_sk), &intr_wait);
- remove_wait_queue(sk_sleep(ctrl_sk), &ctrl_wait);
+ remove_wait_queue(&rcu_dereference_raw(intr_wq)->wait, &intr_wait);
+ remove_wait_queue(&rcu_dereference_raw(ctrl_wq)->wait, &ctrl_wait);
clear_bit(HIDP_WAITING_FOR_SEND_ACK, &session->flags);
clear_bit(HIDP_WAITING_FOR_RETURN, &session->flags);
@@ -747,12 +750,15 @@ static int hidp_session(void *arg)
session->intr_sock->sk->sk_err = EUNATCH;
session->ctrl_sock->sk->sk_err = EUNATCH;
- hidp_schedule(session);
+ wake_up_interruptible(&rcu_dereference_raw(ctrl_wq)->wait);
+ wake_up_interruptible(&rcu_dereference_raw(intr_wq)->wait);
fput(session->intr_sock->file);
- wait_event_timeout(*(sk_sleep(ctrl_sk)),
- (ctrl_sk->sk_state == BT_CLOSED), msecs_to_jiffies(500));
+ /* By now ctrl_sk might have been orphaned already */
+ if (ctrl_wq == ctrl_sk->sk_wq)
+ wait_event_timeout(rcu_dereference_raw(ctrl_wq)->wait,
+ (ctrl_sk->sk_state == BT_CLOSED), msecs_to_jiffies(500));
fput(session->ctrl_sock->file);
^ permalink raw reply
* Re: [PATCH v0 0/2] Media API clarifications
From: Johan Hedberg @ 2013-01-08 11:57 UTC (permalink / raw)
To: Mikel Astiz; +Cc: linux-bluetooth, claudio.takahasi, Mikel Astiz
In-Reply-To: <1357638065-19156-1-git-send-email-mikel.astiz.oss@gmail.com>
Hi Mikel,
On Tue, Jan 08, 2013, Mikel Astiz wrote:
> The documentation of BlueZ 5.0 is lacking some details affecting the
> Media API, specially regarding the control of HFP/HSP volume.
>
> There is no known implementation of MediaTransport1 at this point so
> updating the documentation with two new optional properties could be
> in practice done without updating the interface suffix.
>
> Besides, the error codes returned by Acquire() and TryAcquire() are
> convenient to implement proper error logging in the client side.
>
> Mikel Astiz (2):
> media: Add HFP/HSP gains to transport API
> media: Clarify Acquire/TryAcquire error cases
>
> doc/media-api.txt | 32 +++++++++++++++++++++++++++++++-
> profiles/audio/transport.c | 2 +-
> 2 files changed, 32 insertions(+), 2 deletions(-)
Both patches have been applied. Thanks.
Johan
^ permalink raw reply
* [PATCH BlueZ 5/5] sdp-xml: Remove newline before EOF
From: Syam Sidhardhan @ 2013-01-08 11:37 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1357645069-30841-1-git-send-email-s.syam@samsung.com>
---
src/sdp-xml.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/sdp-xml.c b/src/sdp-xml.c
index 8cb1e2d..6492781 100644
--- a/src/sdp-xml.c
+++ b/src/sdp-xml.c
@@ -994,4 +994,3 @@ void convert_sdp_record_to_xml(sdp_record_t *rec,
appender(data, "</record>\n");
}
}
-
--
1.7.9.5
^ permalink raw reply related
* [PATCH BlueZ 4/5] audio: Remove unused struct audio_adapter
From: Syam Sidhardhan @ 2013-01-08 11:37 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1357645069-30841-1-git-send-email-s.syam@samsung.com>
---
profiles/audio/manager.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/profiles/audio/manager.c b/profiles/audio/manager.c
index dc20712..f0df8ed 100644
--- a/profiles/audio/manager.c
+++ b/profiles/audio/manager.c
@@ -67,12 +67,6 @@
#include "manager.h"
#include "sdpd.h"
-struct audio_adapter {
- struct btd_adapter *btd_adapter;
- gboolean powered;
- gint ref;
-};
-
static GKeyFile *config = NULL;
static GSList *devices = NULL;
--
1.7.9.5
^ permalink raw reply related
* [PATCH BlueZ 3/5] unit: Replace g_test_fail() with g_assert()
From: Syam Sidhardhan @ 2013-01-08 11:37 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1357645069-30841-1-git-send-email-s.syam@samsung.com>
g_test_fail() is introduced in Glib v2.30 and we are using
Glib v2.28 as the minimum requirement for the build.
This patch resolves the compilation error that happen with
Glib v2.28.
Error log:
CC unit/test-mgmt.o
unit/test-mgmt.c: In function ‘check_actions’:
unit/test-mgmt.c:100:2: error: implicit declaration of
function ‘g_test_fail’ [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors
make[1]: *** [unit/test-mgmt.o] Error 1
make: *** [all] Error 2
---
unit/test-mgmt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/unit/test-mgmt.c b/unit/test-mgmt.c
index 2d1a5d6..ea679e5 100644
--- a/unit/test-mgmt.c
+++ b/unit/test-mgmt.c
@@ -97,7 +97,7 @@ static void check_actions(struct context *context,
}
g_test_message("Command not handled\n");
- g_test_fail();
+ g_assert(0);
}
static gboolean server_handler(GIOChannel *channel, GIOCondition cond,
--
1.7.9.5
^ permalink raw reply related
* [PATCH BlueZ 2/5] health: Fix possible use after free
From: Syam Sidhardhan @ 2013-01-08 11:37 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1357645069-30841-1-git-send-email-s.syam@samsung.com>
A pointer to freed memory is dereferenced if we call function
channel_acquire_continue() with out any earlier reference.
---
profiles/health/hdp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/profiles/health/hdp.c b/profiles/health/hdp.c
index 823621e..82419b0 100644
--- a/profiles/health/hdp.c
+++ b/profiles/health/hdp.c
@@ -609,10 +609,10 @@ static DBusMessage *channel_acquire_continue(struct hdp_tmp_dc_data *data,
data, hdp_tmp_dc_data_destroy, &gerr))
return NULL;
- hdp_tmp_dc_data_unref(data);
reply = g_dbus_create_error(data->msg, ERROR_INTERFACE ".HealthError",
"Cannot reconnect: %s", gerr->message);
g_error_free(gerr);
+ hdp_tmp_dc_data_unref(data);
return reply;
}
--
1.7.9.5
^ permalink raw reply related
* [PATCH BlueZ 1/5] health: Fix pointer to local variable out-of-scope
From: Syam Sidhardhan @ 2013-01-08 11:37 UTC (permalink / raw)
To: linux-bluetooth
The address of the local variable is used outside the scope.
---
profiles/health/hdp_util.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/profiles/health/hdp_util.c b/profiles/health/hdp_util.c
index 5f81806..ed987e3 100644
--- a/profiles/health/hdp_util.c
+++ b/profiles/health/hdp_util.c
@@ -153,13 +153,12 @@ static gboolean parse_data_type(DBusMessageIter *iter, gpointer data,
{
struct hdp_application *app = data;
DBusMessageIter *value;
+ DBusMessageIter variant;
int ctype;
ctype = dbus_message_iter_get_arg_type(iter);
value = iter;
if (ctype == DBUS_TYPE_VARIANT) {
- DBusMessageIter variant;
-
/* Get value inside the variable */
dbus_message_iter_recurse(iter, &variant);
ctype = dbus_message_iter_get_arg_type(&variant);
@@ -181,13 +180,12 @@ static gboolean parse_role(DBusMessageIter *iter, gpointer data, GError **err)
{
struct hdp_application *app = data;
DBusMessageIter *string;
+ DBusMessageIter value;
int ctype;
const char *role;
ctype = dbus_message_iter_get_arg_type(iter);
if (ctype == DBUS_TYPE_VARIANT) {
- DBusMessageIter value;
-
/* Get value inside the variable */
dbus_message_iter_recurse(iter, &value);
ctype = dbus_message_iter_get_arg_type(&value);
@@ -222,13 +220,12 @@ static gboolean parse_desc(DBusMessageIter *iter, gpointer data, GError **err)
{
struct hdp_application *app = data;
DBusMessageIter *string;
+ DBusMessageIter variant;
int ctype;
const char *desc;
ctype = dbus_message_iter_get_arg_type(iter);
if (ctype == DBUS_TYPE_VARIANT) {
- DBusMessageIter variant;
-
/* Get value inside the variable */
dbus_message_iter_recurse(iter, &variant);
ctype = dbus_message_iter_get_arg_type(&variant);
@@ -253,14 +250,13 @@ static gboolean parse_chan_type(DBusMessageIter *iter, gpointer data,
{
struct hdp_application *app = data;
DBusMessageIter *value;
+ DBusMessageIter variant;
char *chan_type;
int ctype;
ctype = dbus_message_iter_get_arg_type(iter);
value = iter;
if (ctype == DBUS_TYPE_VARIANT) {
- DBusMessageIter variant;
-
/* Get value inside the variable */
dbus_message_iter_recurse(iter, &variant);
ctype = dbus_message_iter_get_arg_type(&variant);
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH BlueZ 1/5] lib: Add SDP_IS_TEXT_STR() macro for SDP_TEXT_STR* checking
From: Anderson Lizardo @ 2013-01-08 10:52 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: linux-bluetooth
In-Reply-To: <1357615542.1806.22.camel@aeonflux>
Hi Marcel,
On Mon, Jan 7, 2013 at 11:25 PM, Marcel Holtmann <marcel@holtmann.org> wrote:
>> #define SDP_IS_UUID(x) ((x) == SDP_UUID16 || (x) == SDP_UUID32 || (x) ==SDP_UUID128)
>> #define SDP_IS_SEQ(x) ((x) == SDP_SEQ8 || (x) == SDP_SEQ16 || (x) == SDP_SEQ32)
>> +#define SDP_IS_TEXT_STR(x) ((x) == SDP_TEXT_STR8 || (x) == SDP_TEXT_STR16 || \
>> + (x) == SDP_TEXT_STR32)
>
> can someone please explain to me why we are extending the library. I
> thought I made it clear that it is mostly end of life and we are not
> adding new features. However some people keep adding stuff.
This macro was added simply to be used for the next patches which
simplify/refactor core code. The fact the header is public API was not
the main reason to add it here.
Unless you suggest adding new stuff to another, internal-only header?
If so, please provide some example how to extend SDP library code that
is used by internal BlueZ code.
Best Regards,
--
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
^ permalink raw reply
* [PATCH v0 2/2] media: Clarify Acquire/TryAcquire error cases
From: Mikel Astiz @ 2013-01-08 9:41 UTC (permalink / raw)
To: linux-bluetooth; +Cc: claudio.takahasi, Mikel Astiz
In-Reply-To: <1357638065-19156-1-git-send-email-mikel.astiz.oss@gmail.com>
From: Mikel Astiz <mikel.astiz@bmw-carit.de>
Document the reported errors for Acquire() and TryAcquire(). For the
later, make sure a specific error in guaranteed for the typical scenario
of audio not streaming.
---
doc/media-api.txt | 10 +++++++++-
profiles/audio/transport.c | 2 +-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/doc/media-api.txt b/doc/media-api.txt
index cdde6ea..bb5ced0 100644
--- a/doc/media-api.txt
+++ b/doc/media-api.txt
@@ -321,12 +321,20 @@ Methods fd, uint16, uint16 Acquire()
Acquire transport file descriptor and the MTU for read
and write respectively.
+ Possible Errors: org.bluez.Error.NotAuthorized
+ org.bluez.Error.Failed
+
fd, uint16, uint16 TryAcquire()
Acquire transport file descriptor only if the transport
is in "pending" state at the time the message is
received by BlueZ. Otherwise no request will be sent
- to the remote device and the function will just fail.
+ to the remote device and the function will just fail
+ with org.bluez.Error.NotAvailable.
+
+ Possible Errors: org.bluez.Error.NotAuthorized
+ org.bluez.Error.Failed
+ org.bluez.Error.NotAvailable
void Release()
diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index 54461d8..58240ac 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -477,7 +477,7 @@ static DBusMessage *try_acquire(DBusConnection *conn, DBusMessage *msg,
return btd_error_not_authorized(msg);
if (transport->state != TRANSPORT_STATE_PENDING)
- return btd_error_failed(msg, "Transport not playing");
+ return btd_error_not_available(msg);
owner = media_owner_create(msg);
id = transport->resume(transport, owner);
--
1.7.11.7
^ permalink raw reply related
* [PATCH v0 1/2] media: Add HFP/HSP gains to transport API
From: Mikel Astiz @ 2013-01-08 9:41 UTC (permalink / raw)
To: linux-bluetooth; +Cc: claudio.takahasi, Mikel Astiz
In-Reply-To: <1357638065-19156-1-git-send-email-mikel.astiz.oss@gmail.com>
From: Mikel Astiz <mikel.astiz@bmw-carit.de>
Add two independent and HSP/HFP-specific properties to the media
transport representing the input and output audio volumes.
---
doc/media-api.txt | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/doc/media-api.txt b/doc/media-api.txt
index e2a72dc..cdde6ea 100644
--- a/doc/media-api.txt
+++ b/doc/media-api.txt
@@ -393,4 +393,26 @@ Properties object Device [readonly]
this property is only writeable when the transport was
acquired by the sender.
+ Note: the property will not be present for HSP/HFP
+ transports and MicrophoneGain/SpeakerGain should be
+ used instead.
+
Possible Values: 0-127
+
+ byte MicrophoneGain [readwrite]
+
+ Optional. Indicates volume level of the transport's
+ incoming audio stream for HSP/HFP transports. This
+ property is only writeable when the transport was
+ acquired by the sender.
+
+ Possible Values: 0-15
+
+ byte SpeakerGain [readwrite]
+
+ Optional. Indicates volume level of the transport's
+ outgoing audio stream for HSP/HFP transports. This
+ property is only writeable when the transport was
+ acquired by the sender.
+
+ Possible Values: 0-15
--
1.7.11.7
^ permalink raw reply related
* [PATCH v0 0/2] Media API clarifications
From: Mikel Astiz @ 2013-01-08 9:41 UTC (permalink / raw)
To: linux-bluetooth; +Cc: claudio.takahasi, Mikel Astiz
From: Mikel Astiz <mikel.astiz@bmw-carit.de>
The documentation of BlueZ 5.0 is lacking some details affecting the Media API, specially regarding the control of HFP/HSP volume.
There is no known implementation of MediaTransport1 at this point so updating the documentation with two new optional properties could be in practice done without updating the interface suffix.
Besides, the error codes returned by Acquire() and TryAcquire() are convenient to implement proper error logging in the client side.
Mikel Astiz (2):
media: Add HFP/HSP gains to transport API
media: Clarify Acquire/TryAcquire error cases
doc/media-api.txt | 32 +++++++++++++++++++++++++++++++-
profiles/audio/transport.c | 2 +-
2 files changed, 32 insertions(+), 2 deletions(-)
--
1.7.11.7
^ permalink raw reply
* Re: [PATCH BlueZ v1] audio: Replace g_hash_table_contains() with g_hash_table_lookup()
From: Marcel Holtmann @ 2013-01-08 6:32 UTC (permalink / raw)
To: Jaganath Kanakkassery; +Cc: linux-bluetooth
In-Reply-To: <1357622748-3051-1-git-send-email-jaganath.k@samsung.com>
Hi Jaganath,
> g_hash_table_contains() is supported only from GLib 2.32. If BlueZ has to
> build against GLib 2.28 this patch replaces g_hash_table_contains() to
> g_hash_table_lookup()
> ---
> profiles/audio/player.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
patch has been applied.
Regards
Marcel
^ permalink raw reply
* [PATCH BlueZ v1] audio: Replace g_hash_table_contains() with g_hash_table_lookup()
From: Jaganath Kanakkassery @ 2013-01-08 5:25 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Jaganath Kanakkassery
g_hash_table_contains() is supported only from GLib 2.32. If BlueZ has to
build against GLib 2.28 this patch replaces g_hash_table_contains() to
g_hash_table_lookup()
---
profiles/audio/player.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/profiles/audio/player.c b/profiles/audio/player.c
index 8748893..bffb506 100644
--- a/profiles/audio/player.c
+++ b/profiles/audio/player.c
@@ -172,8 +172,11 @@ static gboolean get_status(const GDBusPropertyTable *property,
static gboolean setting_exists(const GDBusPropertyTable *property, void *data)
{
struct media_player *mp = data;
+ const char *value;
+
+ value = g_hash_table_lookup(mp->settings, property->name);
- return g_hash_table_contains(mp->settings, property->name);
+ return value ? TRUE : FALSE;
}
static gboolean get_setting(const GDBusPropertyTable *property,
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH] Bluetooth: Fix incorrect strncpy() in hidp_setup_hid()
From: Marcel Holtmann @ 2013-01-08 3:29 UTC (permalink / raw)
To: Anderson Lizardo; +Cc: linux-bluetooth
In-Reply-To: <1357511333-5276-1-git-send-email-anderson.lizardo@openbossa.org>
Hi Anderson,
> The length parameter should be sizeof(req->name) - 1 because there is no
> guarantee that string provided by userspace will contain the trailing
> '\0'.
>
> Can be easily reproduced by manually setting req->name to 128 non-zero
> bytes prior to ioctl(HIDPCONNADD) and checking the device name setup on
> input subsystem:
>
> $ cat /sys/devices/pnp0/00\:04/tty/ttyS0/hci0/hci0\:1/input8/name
> AAAAAA[...]AAAAAAAAf0:af:f0:af:f0:af
>
> ("f0:af:f0:af:f0:af" is the device bluetooth address, taken from "phys"
> field in struct hid_device due to overflow.)
>
> Signed-off-by: Anderson Lizardo <anderson.lizardo@openbossa.org>
> ---
> net/bluetooth/hidp/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
this is a good catch. And this should also go to -stable and the current
kernels right away.
It is actually a security issue since it leaks kernel memory to
userspace.
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Regards
Marcel
^ permalink raw reply
* Re: usage of g_test_fail() which is introduced in Glib 2.30
From: Marcel Holtmann @ 2013-01-08 3:26 UTC (permalink / raw)
To: Syam Sidhardhan; +Cc: linux-bluetooth
In-Reply-To: <CAFBvHie6nCYJpR1VJWdg+ki=TiZcvpR7R43xGrox_Z5pf0pCiw@mail.gmail.com>
Hi Syam,
> In the latest Bluez snapshot I'm getting the g_test_fail compilation
> error. The problem
> happens because we use the Glib minimum version requirement
> as 2.28 and this API is introduced in GLib version 2.30.
> Do we need to use the g_test_fail() now with Glib 2.28?
> I guess we cannot replace it with a wrapper function.
>
>
> Possible Patch:
>
> From: Syam Sidhardhan <s.syam@samsung.com>
> Date: Mon, 7 Jan 2013 17:22:00 -0300
> Subject: [PATCH 1/1] unit: Remove g_test_fail()
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> g_test_fail() is introduced in Glib v2.30 and we are using
> Glib v2.28 as the minimum requirement for the build.
> This patch resolves the compilation error that happen with
> Glib version < 2.30.
>
> Error log:
> CC unit/test-mgmt.o
> unit/test-mgmt.c: In function ‘check_actions’:
> unit/test-mgmt.c:100:2: error: implicit declaration of
> function ‘g_test_fail’ [-Werror=implicit-function-declaration]
> cc1: all warnings being treated as errors
> make[1]: *** [unit/test-mgmt.o] Error 1
> make: *** [all] Error 2
> ---
> unit/test-mgmt.c | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/unit/test-mgmt.c b/unit/test-mgmt.c
> index 2d1a5d6..6b3689c 100644
> --- a/unit/test-mgmt.c
> +++ b/unit/test-mgmt.c
> @@ -97,7 +97,6 @@ static void check_actions(struct context *context,
> }
>
> g_test_message("Command not handled\n");
> - g_test_fail();
> }
lets just use g_assert to fail here.
I assumed g_test_fail lets you gracefully fail, but that is just bogus
as I learned the hard way. So no point in bothering here.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH BlueZ 1/5] lib: Add SDP_IS_TEXT_STR() macro for SDP_TEXT_STR* checking
From: Marcel Holtmann @ 2013-01-08 3:25 UTC (permalink / raw)
To: Anderson Lizardo; +Cc: linux-bluetooth
In-Reply-To: <1357559795-22090-1-git-send-email-anderson.lizardo@openbossa.org>
Hi Anderson,
> This new macro avoids constructs like "if (d->dtd < SDP_TEXT_STR8 ||
> d->dtd > SDP_TEXT_STR32)" which are harder to read.
> ---
> lib/sdp.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/lib/sdp.h b/lib/sdp.h
> index 4448805..42681a2 100644
> --- a/lib/sdp.h
> +++ b/lib/sdp.h
> @@ -440,6 +440,8 @@ typedef struct {
>
> #define SDP_IS_UUID(x) ((x) == SDP_UUID16 || (x) == SDP_UUID32 || (x) ==SDP_UUID128)
> #define SDP_IS_SEQ(x) ((x) == SDP_SEQ8 || (x) == SDP_SEQ16 || (x) == SDP_SEQ32)
> +#define SDP_IS_TEXT_STR(x) ((x) == SDP_TEXT_STR8 || (x) == SDP_TEXT_STR16 || \
> + (x) == SDP_TEXT_STR32)
can someone please explain to me why we are extending the library. I
thought I made it clear that it is mostly end of life and we are not
adding new features. However some people keep adding stuff.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH 1/2] audio: Replace g_hash_table_contains() with g_hash_table_lookup()
From: Marcel Holtmann @ 2013-01-08 3:24 UTC (permalink / raw)
To: Luiz Augusto von Dentz
Cc: Jaganath Kanakkassery, Ludek Finstrle,
linux-bluetooth@vger.kernel.org
In-Reply-To: <CABBYNZ+0H3t-jwbp_-iUeFw2NOqXuWmwBiw8xjqP5bx6D7gomQ@mail.gmail.com>
Hi Luiz,
<snip>
> > I think
> > return g_hash_table_lookup(mp->settings, property->name) ? TRUE : FALSE;
> > would be better?
>
> Shorter form is != NULL, so lets go with it, still haven't figure out
> why we didn't bring back glib-compat for such functions, when we
> finally upgrade it will take much more time to revert this one by one.
we could bring glib-compat back, but right now I do not want to
introduce more autoconf magic to do so.
I would require the latest GLib version (or at least a bit newer one) if
they wouldn't just start introducing new dependencies all the time.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH 1/2] audio: Replace g_hash_table_contains() with g_hash_table_lookup()
From: Marcel Holtmann @ 2013-01-08 3:22 UTC (permalink / raw)
To: Jaganath Kanakkassery; +Cc: linux-bluetooth
In-Reply-To: <1357562033-26230-1-git-send-email-jaganath.k@samsung.com>
Hi Jaganath,
> g_hash_table_contains() is supported only from GLib 2.32. If BlueZ has to
> build against GLib 2.28 this patch replaces g_hash_table_contains() to
> g_hash_table_lookup()
> ---
> profiles/audio/player.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/profiles/audio/player.c b/profiles/audio/player.c
> index 8748893..4198bdb 100644
> --- a/profiles/audio/player.c
> +++ b/profiles/audio/player.c
> @@ -172,8 +172,13 @@ static gboolean get_status(const GDBusPropertyTable *property,
> static gboolean setting_exists(const GDBusPropertyTable *property, void *data)
> {
> struct media_player *mp = data;
> + const char *value;
> +
> + value = g_hash_table_lookup(mp->settings, property->name);
return value ? TRUE : FALSE;
Regards
Marcel
^ permalink raw reply
* Re: [PATCH 2/2] shared: Fix build break
From: Marcel Holtmann @ 2013-01-08 3:20 UTC (permalink / raw)
To: Jaganath Kanakkassery; +Cc: linux-bluetooth
In-Reply-To: <1357562033-26230-2-git-send-email-jaganath.k@samsung.com>
Hi Jaganath,
> This patch fixes the below build error
>
> src/shared/mgmt.c: In function ‘mgmt_cancel_index’:
> src/shared/mgmt.c:559:30: error: cast to pointer from integer of
> different size [-Werror=int-to-pointer-cast]
> cc1: all warnings being treated as errors
> make[1]: *** [src/shared/bluetoothd-mgmt.o] Error 1
> make: *** [all] Error 2
> ---
> src/shared/mgmt.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/shared/mgmt.c b/src/shared/mgmt.c
> index 2297caf..c832a88 100644
> --- a/src/shared/mgmt.c
> +++ b/src/shared/mgmt.c
> @@ -553,10 +553,12 @@ bool mgmt_cancel(struct mgmt *mgmt, unsigned int id)
>
> bool mgmt_cancel_index(struct mgmt *mgmt, uint16_t index)
> {
> + guint id = index;
> +
I changed this into unsigned int instead when applying the patch.
Regards
Marcel
^ permalink raw reply
* New kernel APIs and actually testing them
From: Marcel Holtmann @ 2013-01-07 23:35 UTC (permalink / raw)
To: linux-bluetooth
Hi everyone,
our kernel APIs are not as good as they were years back. There are a
bunch of the management commands that are actually broken. And they have
been broken for years now. For example Set Device Class, Load Long Term
Keys, Confirm Name and maybe even others. Some commands are really
relaxing when it comes to accept certain input variables and turning
them into booleans. Which is also a bad idea.
This all has to stop. From now on, I do not want to see any kernel API
additions (management or socket) that we do not have a proper testing
tool for that can verify its correct behavior. Also adding new APIs
until we have verified the old ones is not something I like to do
either.
During the holidays I started a tool called mgmt-tester that allows
end-to-end testing of the management interface by using emulated HCI
controllers. You just need to load hci_vhci kernel module and run it.
There is a lot of extra work to do for actually ensuring that we are
sending the right HCI commands on different controller versions, but it
is possible to verify this since it is all emulated. Nobody needs the
latest hardware. Look into the emulator directory for my effort in
providing flexible support for simulating different behaviors.
This work of testing our APIs needs to be done NOW. So instead of
everybody trying to squeeze in the latest features, I rather see the
core being improved first and made rock solid.
I welcome every patch that tries to improve this situation.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH 2/2] Bluetooth: Fix ACL alive for long in case of non pariable devices
From: Syam Sidhardhan @ 2013-01-07 20:49 UTC (permalink / raw)
To: Syam Sidhardhan; +Cc: linux-bluetooth
In-Reply-To: <1356097469-24073-2-git-send-email-s.syam@samsung.com>
Hi,
On Fri, Dec 21, 2012 at 7:14 PM, Syam Sidhardhan <s.syam@samsung.com> wrote:
> For certain devices (ex: HID mouse), support for authentication,
> pairing and bonding is optional. For such devices, the ACL alive
> for too long after the l2cap disconnection.
>
> To avoid keep ACL alive for too long, set the ACL timeout back to
> HCI_DISCONN_TIMEOUT when l2cap is connected.
>
> commit id:a9ea3ed9b71cc3271dd59e76f65748adcaa76422 might have introduce
> this issue.
>
> Signed-off-by: Sang-Ki Park <sangki79.park@samsung.com>
> Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
> ---
> I'm not sure whether we need hci_conn_hold() and hci_conn_put() across
> while updating the disc_timeout. In certain other places in the code
> it's done. Ex: hci_auth_complete_evt(), hci_link_key_notify_evt() etc.
> Here I took that as the reference.
>
> net/bluetooth/l2cap_core.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index 82a3bdc..7a544c2 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -1360,7 +1360,6 @@ static void l2cap_le_conn_ready(struct l2cap_conn *conn)
> sk = chan->sk;
>
> hci_conn_hold(conn->hcon);
> - conn->hcon->disc_timeout = HCI_DISCONN_TIMEOUT;
>
> bacpy(&bt_sk(sk)->src, conn->src);
> bacpy(&bt_sk(sk)->dst, conn->dst);
> @@ -1380,6 +1379,10 @@ static void l2cap_conn_ready(struct l2cap_conn *conn)
>
> BT_DBG("conn %p", conn);
>
> + hci_conn_hold(conn->hcon);
> + conn->hcon->disc_timeout = HCI_DISCONN_TIMEOUT;
> + hci_conn_put(conn->hcon);
> +
> if (!hcon->out && hcon->type == LE_LINK)
> l2cap_le_conn_ready(conn);
>
> --
> 1.7.9.5
>
ping.
Thanks,
Syam.
^ permalink raw reply
* Re: [PATCH 2/2] Bluetooth: Update management interface revision
From: Syam Sidhardhan @ 2013-01-07 20:47 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: Syam Sidhardhan, linux-bluetooth
In-Reply-To: <1356630354.19248.58.camel@aeonflux>
Hi Marcel,
On Thu, Dec 27, 2012 at 11:15 PM, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Syam,
>
>> This enable us to introduce a check in user space to know
>> whether it's safe to pass non-16bit UUID's to kernel or not.
>> Currently the kernel support only 16bit UUID's in the EIR.
>>
>> Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
>> ---
>> net/bluetooth/mgmt.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> NAK. As I said before, I want the kernel to support 32-bit and 128-bit
> UUIDs. There is no point in doing a minimal fix. I want to see this
> fixed properly.
Ok, I'll send the 32-bit and 128-bit support patches soon.
Thanks,
Syam
^ permalink raw reply
* usage of g_test_fail() which is introduced in Glib 2.30
From: Syam Sidhardhan @ 2013-01-07 20:35 UTC (permalink / raw)
To: linux-bluetooth
Hi Marcel,
In the latest Bluez snapshot I'm getting the g_test_fail compilation
error. The problem
happens because we use the Glib minimum version requirement
as 2.28 and this API is introduced in GLib version 2.30.
Do we need to use the g_test_fail() now with Glib 2.28?
I guess we cannot replace it with a wrapper function.
Possible Patch:
From: Syam Sidhardhan <s.syam@samsung.com>
Date: Mon, 7 Jan 2013 17:22:00 -0300
Subject: [PATCH 1/1] unit: Remove g_test_fail()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
g_test_fail() is introduced in Glib v2.30 and we are using
Glib v2.28 as the minimum requirement for the build.
This patch resolves the compilation error that happen with
Glib version < 2.30.
Error log:
CC unit/test-mgmt.o
unit/test-mgmt.c: In function ‘check_actions’:
unit/test-mgmt.c:100:2: error: implicit declaration of
function ‘g_test_fail’ [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors
make[1]: *** [unit/test-mgmt.o] Error 1
make: *** [all] Error 2
---
unit/test-mgmt.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/unit/test-mgmt.c b/unit/test-mgmt.c
index 2d1a5d6..6b3689c 100644
--- a/unit/test-mgmt.c
+++ b/unit/test-mgmt.c
@@ -97,7 +97,6 @@ static void check_actions(struct context *context,
}
g_test_message("Command not handled\n");
- g_test_fail();
}
static gboolean server_handler(GIOChannel *channel, GIOCondition cond,
--
1.7.0.4
Regards,
Syam.
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox