Alex Deymo | 20 Jun 2013 02:56

[BUG] HCI_RESET and Num_HCI_Command_Packets limit

Hello,

I'm experiencing a problem that wedges the bluetooth adapter from time
to time. The repro case can be hit with this scenario:

run bluetoothd
while hciconfig hci0 up && hciconfig hci0 down; do echo -n .; done

In few iterations you will have a timeout while trying to bring up the
interface. This is just a repro case, the real scenario just happens
from time to time if you for instance restart bluetoothd at the right
(or wrong!) moment.

The problem is the following:
Setting up the interface, the host will send several HCI commands to
set things like the device class or the local name. If it happens that
the hciconfig makes the host send a HCI_Reset command after another
command was sent but before the corresponding event was received, then
the adapter is blocked for a while. Recovery it from that situation is
kind of random. A few attempts of hcidump hci0 up may or not work....
but the problem was before.

In the hci trace you see below, the last HCI Event received has a
value of Num_HCI_Command_Packets of 1, which according to the Core
spec (Vol2, part E, sec 7.7.14) means that we can only send 1 HCI
command until we receive the next event; but the trace shows that we
sent 2: Write Local Name and a Reset. So the host here doesn't follow
the spec... am I right?

Even worse, after the HCI_Reset the host shall not send additional HCI
(Continue reading)

Jesse Sung | 19 Jun 2013 17:28
Favicon

[PATCH 1/5] Bluetooth: Support for loading broadcom patchram firmware

From: Wen-chien Jesse Sung <jesse.sung@...>

There is an user space firmware loading tool which can be found at
http://marc.info/?l=linux-bluetooth&m=132039175324993&w=2

The supported firmware is in hcd format, which is a collection of
hci commands. The download process would be:
1. reset command
2. download command
3. firmware image in hcd file
4. reset command

/sys/kernel/debug/usb/devices before loading firmware:
T:  Bus=01 Lev=02 Prnt=02 Port=04 Cnt=02 Dev#=  4 Spd=12   MxCh= 0
D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0a5c ProdID=21d3 Rev= 1.12
S:  Manufacturer=Broadcom Corp
S:  Product=BCM43142A0
S:  SerialNumber=3859F9D6199A
C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
(Continue reading)

| 19 Jun 2013 04:06
Picon

I am newbie, question : how to check bluetooth version on my android phone

here is the hciconfig output: bluez 4.93 in phone

hciconfig hci0 version
hci0:   Type: BR/EDR  Bus: UART
        BD Address: 00:A0:C6:29:94:B4  ACL MTU: 1024:5  SCO MTU: 60:8
        HCI Version: 4.0 (0x6)  Revision: 0x0
        LMP Version: 4.0 (0x6)  Subversion: 0xc
        Manufacturer: Qualcomm (29)

does this enough to get version? and via LMP Version, seems it is Bluetooth Core
Specification 4.0.

but as I know Google officially announced LE feature is not supported
yet, see it:
http://www.theverge.com/2013/5/15/4334882/google-adopts-bluetooth-smart-hints-android-update-within-two-months
Lucas De Marchi | 18 Jun 2013 22:13

[PATCH BlueZ 1/5] build-sys: Don't build gdbus several times

We are currently compiling gdbus 3 times: one for tests, one for
bluetoothd and another for obexd.

$ ls gdbus/*watch.o
gdbus/bluetoothd-watch.o  gdbus/obexd-watch.o  gdbus/watch.o

Instead of prepending $(gdbus_sources) to several _SOURCES variable, use
a convenience library.
---
 Makefile.am    | 16 +++++++++++-----
 Makefile.obexd |  4 ++--
 Makefile.tools | 25 ++++++++++++-------------
 3 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9d570fb..19782ce 100644
--- a/Makefile.am
+++ b/Makefile.am
 <at>  <at>  -112,6 +112,11  <at>  <at>  builtin_nodist =

 include Makefile.plugins

+noinst_LTLIBRARIES += gdbus/libgdbus.la
+gdbus_libgdbus_la_SOURCES = $(gdbus_sources)
+gdbus_libgdbus_la_LDFLAGS = $(AM_LDFLAGS)  <at> DBUS_LIBS <at>   <at> GLIB_LIBS <at> 
+gdbus_libgdbus_la_CFLAGS = $(AM_CFLAGS)  <at> DBUS_CFLAGS <at>   <at> GLIB_CFLAGS <at> 
+
 if MAINTAINER_MODE
 plugin_LTLIBRARIES += plugins/external-dummy.la
 plugins_external_dummy_la_SOURCES = plugins/external-dummy.c
(Continue reading)

Luiz Augusto von Dentz | 18 Jun 2013 10:09
Picon

[PATCH BlueZ 1/3] audio/media: Fix notifying settings changed incorrectly

From: Luiz Augusto von Dentz <luiz.von.dentz@...>

We should notify only the setting that has changed not all of them.
---
 profiles/audio/avrcp.c | 30 +++++++++++++-----------------
 profiles/audio/avrcp.h |  3 ++-
 profiles/audio/media.c |  7 +------
 3 files changed, 16 insertions(+), 24 deletions(-)

diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 730f061..f0554fe 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
 <at>  <at>  -612,13 +612,15  <at>  <at>  static int play_status_to_val(const char *status)
 	return -EINVAL;
 }

-void avrcp_player_event(struct avrcp_player *player, uint8_t id, void *data)
+void avrcp_player_event(struct avrcp_player *player, uint8_t id,
+							const void *data)
 {
 	uint8_t buf[AVRCP_HEADER_LENGTH + 9];
 	struct avrcp_header *pdu = (void *) buf;
 	uint16_t size;
 	GSList *l;
-	GList *settings;
+	int attr;
+	int val;

 	if (player->sessions == NULL)
(Continue reading)

Luiz Augusto von Dentz | 18 Jun 2013 10:08
Picon

[PATCH BlueZ] core: Fix crash when a duplicated record is found

From: Luiz Augusto von Dentz <luiz.von.dentz@...>

 Invalid read of size 8
    at 0x470101: update_bredr_services (device.c:2784)
    by 0x470591: browse_cb (device.c:2975)
    by 0x458B0E: search_completed_cb (sdp-client.c:186)
    by 0x47C154: sdp_process (sdp.c:4343)
    by 0x458954: search_process_cb (sdp-client.c:205)
    by 0x3F31A47A54: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
    by 0x3F31A47D87: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2)
    by 0x3F31A48181: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
    by 0x40A265: main (main.c:595)
  Address 0x0 is not stack'd, malloc'd or (recently) free'd
---
 src/device.c | 65 +++++++++++++++++++++++++++++++++++-------------------------
 1 file changed, 38 insertions(+), 27 deletions(-)

diff --git a/src/device.c b/src/device.c
index 0f75c60..c324764 100644
--- a/src/device.c
+++ b/src/device.c
 <at>  <at>  -2677,6 +2677,40  <at>  <at>  static int rec_cmp(const void *a, const void *b)
 	return r1->handle - r2->handle;
 }

+static int update_record(struct browse_req *req, const char *uuid,
+							sdp_record_t *rec)
+{
+	GSList *l;
+
(Continue reading)

Christian Fetzer | 17 Jun 2013 14:10
Picon

[PATCH 1/4] obexd: Fix handling error cases in setpath

From: Christian Fetzer <christian.fetzer@...>

This adds a setpath_op_complete callback, that unpacks the user data and
finally calls the user callback. The callback is now used for success and error
cases.

The previous implementation was using setpath_complete which did not
work for error cases, because it was called with incorrect user data.
This was leading to a crash, that can be reproduced by disconnecting PBAP
after trying to select a non existing phone book.

  0  setpath_complete (session=0x66bd90, transfer=0x0, err=0x69b370,
     user_data=0x69a810) at obexd/client/session.c:912
  1  0x000000000042d100 in obc_session_shutdown (session=0x66bd90)
     at obexd/client/session.c:537
  2  0x000000000040f227 in service_filter (connection=0x664b20,
     message=<optimized out>, user_data=0x66bed0) at gdbus/watch.c:486
  3  0x000000000040f49b in message_filter (connection=0x664b20,
     message=0x66ba30, user_data=<optimized out>) at gdbus/watch.c:554
  4  0x00007ffff72f40a6 in dbus_connection_dispatch ()
     from /usr/lib/libdbus-1.so.3
  5  0x000000000040e148 in message_dispatch (data=0x664b20)
     at gdbus/mainloop.c:76
  6  0x00007ffff702e9a3 in ?? () from /usr/lib/libglib-2.0.so.0
  7  0x00007ffff702de46 in g_main_context_dispatch ()
     from /usr/lib/libglib-2.0.so.0
  8  0x00007ffff702e198 in ?? () from /usr/lib/libglib-2.0.so.0
  9  0x00007ffff702e59a in g_main_loop_run () from
     /usr/lib/libglib-2.0.so.0
  10 0x000000000040dd72 in main (argc=1, argv=0x7fffffffddc8)
(Continue reading)

Christian Fetzer | 17 Jun 2013 10:35
Picon

[PATCH v2 0/6] MAP client: Add notification dispatching

From: Christian Fetzer <christian.fetzer@...>

Changelog:
v2:
  - Implement dispatching in map-event.c
  - Rename map_acquire_mns to map_register_event_handler
  - Pass obc_session directly instead of copying address
--

This patch set completes the two patch sets "Add Message Notification Service
(MNS) server" and "Read MASInstanceID for the current connection".

The notification dispatcher component dispatches event reports that are
received by the MNS server to the correct MAS client instance.

The message access part of every client instance registers a notification
handler function. The MNS will call the associated handler for all received
event reports.

For now, the handler will only print a log message for the received
notifications. This is the starting point where we can add the necessary
DBus API parts.

Christian Fetzer (6):
  obexd: Add function to get the destination from the obc_session
  obexd: Add MAP notification dispatching
  build: Add support for building MAP notification dispatcher
  obexd: Register notification handler in the MAP client
  obexd: Notify registered notification handlers in MNS
  obexd: Fix crash when retrieving multiple MAP event reports
(Continue reading)

Luiz Augusto von Dentz | 16 Jun 2013 19:01
Picon

[PATCH BlueZ 1/3] audio/media: Fix notifying settings changed incorrectly

From: Luiz Augusto von Dentz <luiz.von.dentz@...>

We should notify only the setting that has changed not all of them.
---
 profiles/audio/media.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index eb5ea81..69139a7 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
 <at>  <at>  -1480,7 +1480,7  <at>  <at>  static gboolean set_property(struct media_player *mp, const char *key,

 	g_hash_table_replace(mp->settings, g_strdup(key), g_strdup(value));

-	settings = list_settings(mp);
+	settings = g_list_prepend(NULL, (char *) key);

 	avrcp_player_event(mp->player, AVRCP_EVENT_SETTINGS_CHANGED, settings);

--

-- 
1.8.1.4

Luiz Augusto von Dentz | 14 Jun 2013 14:41
Picon

[PATCH v3 BlueZ 00/16] MediaFolder and MediaItem implementation

From: Luiz Augusto von Dentz <luiz.von.dentz@...>

v2: Fixes ChangeFolder not working for subfolders past /Filesystem
v3: Add Search implementation, fix not forwarding errors properly and add
patch to create current item if it doesn't exist.

This set of patches implements most of the functionality of MediaFolder and
MediaItem interfaces.

Some remarks:

- ChangeFolder can only change one level at time, this perhaps gonna be
  changed in the future but for now this matches the limitation of AVRCP
  itself.
- ListItems returns the items in the correct order but GetManagedObjects
  does the reverse order due to use of g_slist_prepend.
- PlayItem and AddToNowPlaying works fine with iPhone but with WP8 is not
  working probably because the UIDCounter changes more frequently
  which needs some new notifications that are currently not implemented.

This can be tested using tools/mpris-player which will browse the NowPlaying
list and show which item is currently being played, but the gnome extention
itself needs patching which can be found here:

https://github.com/Vudentz/gnome-shell-extensions-mediaplayer

Or use the command line tool: tools/bluetooth-player

Luiz Augusto von Dentz (16):
  audio/player: Split item creation
(Continue reading)

bugzilla | 14 Jun 2013 07:54

[Bug 59701] New: Bluetooth device is recognize, but doesn't work

https://bugzilla.kernel.org/show_bug.cgi?id=59701

           Summary: Bluetooth device is recognize, but doesn't work
           Product: Drivers
           Version: 2.5
    Kernel Version: 3.10-rc5
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Bluetooth
        AssignedTo: linux-bluetooth@...
        ReportedBy: jkp@...
        Regression: No

Transferred from https://bugzilla.kernel.org/show_bug.cgi?id=49201

Hardware: asus transformer book tx300 (4005)

Device is found, hciconfig shows bytes sent and received when searching for
other devices, but hcitool scan doesn't show devices. When I try to search for
the computer with a phone, byte count is not increased, so the sent & received
counters may not reflect actual radio traffic.

lsusb -v:

Bus 001 Device 003: ID 13d3:3402 IMC Networks 
Device Descriptor:
(Continue reading)


Gmane