Bluetooth Changes for Linux 3.9

The 3.9 cycle in the Bluetooth subsystem was a way more calm than the previous ones. 49 non-merge patches were pushed upstream through bluetooth-next this time. The bulk of changes for this release comes from Johan Hedberg. Along with many fixes to the HCI Management code he also added support for 32 and 128 its UUID in the EIR data.

Other than that we only have fixes and clean ups from Andre Guedes, Andrei Emeltchenko, Gustavo Padovan, Rami Rosen and Szymon Janc.

One can always see all Bluetooth commits in the 3.9 with the following command line:

git shortlog –no-merges v3.8..v3.9-rc1 — net/bluetooth/ include/net/bluetooth/ drivers/bluetooth/

The 3.10 release is going to be a busy release for Bluetooth subsystem,so stay tuned!

The big changes of BlueZ 5

The BlueZ project recently made a new major release, BlueZ version 5. This release brings tons of new features and improvements, however it is also accompanied by a significant  API change that makes it non-backwards compatible. BlueZ has changed to use the standard D-Bus Properties and Object Manager infrastructure, simplifying the handling of D-Bus interfaces and notifications. In addition to matching to D-Bus standards, the API of some of our interfaces also had to change, either to support new features and use cases or to optimize the API usage.

Another sensible change is related to the kernel requirements of BlueZ 5.0. BlueZ developers have recently added the Bluetooth Management (MGMT) Interface to the Linux Kernel, which significantly improves the Bluetooth experience on Linux. Among other things, you now get fine control of the HCI commands and events we send and receive to/from the Bluetooth device. In the past, this control was split between userspace and the kernel, creating synchronization problems. Now, it is handled solely by the MGMT interface in an internal queue inside the kernel. This change makes the bluetoothd daemon wake up a lot less often, saving more CPU and power for your system. A nice side-effect of those changes is that we could also get rid of blocking operations in the bluetoothd daemon when talking with Bluetooth devices.

As the MGMT interface is the only one to support the new Bluetooth Low Energy devices, BlueZ developers decided to drop support for the old interface once MGMT was completed. As a result, you need to be running Linux Kernel 3.4 or newer to use BlueZ 5.

While BlueZ developers felt the API change was necessary for this new BlueZ release, they understand that API breaks are painful for everyone. Therefore, in BlueZ 5 they introduced the notion of API versioning. For example, let’s say that today BlueZ supports “org.bluez.Device1” and “org.bluez.AgentManager1” interfaces, among others. The “1“ would refer to version 1 of the API. If for some reason we need to upgrade the Device API a new interface, “org.bluez.Device2”, could be created while still supporting the “org.bluez.Device1” interface. The two interfaces will therefore be supported simultaneously, giving you time to port your software to the new API instead of seeing things breaking overnight.

To help you with the migration to BlueZ 5, we released an extensive guide introducing the new APIs.

If you need help to bring your product to the future of Bluetooth on Linux, Collabora is available to assist you with your adoption of BlueZ 5. We can also help you on any commercial support, development or training around BlueZ, come talk to us.

Bluetooth Changes for Linux 3.8

165 Bluetooth commits are present in the latest release of the Linux Kernel, the 3.8 one. The majority of the commits were related to the Bluetooth High Speed feature, they are from Andrei Emeltchenko and Mat Martineau, most of the
code needed for the High Speed is now in mainline, however this feature is still disabled and considered as experimental.

Another important set of patches is from Johan Hedberg to enable support for Low Energy single mode Bluetooth radios. Those are now well supported by the Linux Kernel.

A new printk modifier, %pMR, was introduced to help print Bluetooth devices addresses, which are stored in the little endian order. The modifier was actually introduced in 3.7, however we could only make the changes in the Bluetooth subsystem for 3.8. Then we were able to remove the old and racy batostr() function from the subsystem. This was work of Andrei Emeltchenko.

Also, the ongoing work of split the L2CAP code into the Core an Socket parts gained a few more improvements by Gustavo Padovan. More work is expected to come in the next releases.

The SCO socket interface gained support for the Defer Setup feature, which is already present in the L2CAP and RFCOMM sockets interface. Defer Setup allows the kernel to ask the userspace if it wants to accept an incoming connection or not. Sometimes we don’t even want connections to be established, so stopping them at the CONNECTING state is of great help.

Apart from that we added support for 5 new Bluetooth devices that do not report themselves correctly as Bluetooth devices or need some firmware to be loaded. And as usual we had a lot of small changes, comprehending fixes, clean ups and small improvements.

BlueZ on GSoC: Accepted students announced

Yesterday Google released the accepted students for this year’s Google Summer of Code and BlueZ will be participating with 4 students:

Project: Bluetooth Replayer
Student: Anton Weber
Mentor: Anderson Lizardo

Project: OBEX Filesystem In Userspace
Student: Michał Poczwardowski
Mentor: Vinicius Gomes

Project: Implement AVRCP 1.3 Controller Role
Student: Rafael Fonseca
Mentor: Luiz Augusto von Dentz

Project: Visualization of Bluetooth traffic
Student: Thiago da Silva Arruda
Mentor: Gustavo Padovan

It is now community bonding time, where students get know their mentors and the community. We wish a great summer to all students.  :-)

 

BlueZ on Google Summer of Code 2012

BlueZ was accepted to take part in GSoC 2012, if you don’t know what GSoC is, please go  to its page and learn about.

We have already published our list of ideas, so if you are a student  take a look there and check what might interest you. Then you can talk to one of our mentors to learn more about and work on a GSoC proposal.
You can get more information about BlueZ on GsoChere. Our contact info is on the same page.

We hope to have a great summer in this year’s Google Summer of Code.

Talk at Automotive Linux Summit

About a month ago I’ve been to the Automotive Linux Summit in Yokohama, Japan to present about the BlueZ stack and how it would fit in a CarKit system. You can find the slides here. The conference was very nice, about 200 attendees and many interesting talks.

Also on Dec, 1st I  attended the GENIVI Members Summit, where they created the Japanese working group of GENIVI.

Finally, I would like to thank Linux Foundation for sponsoring my travel to Yokohama.

The week at Prague

At the end of October I’ve been to Prague, Czech Republic to take part in this year Bluetooth Summit to discuss the issues and the future developments of the BlueZ Project. It was the biggest BlueZ meeting we ever had, in total there was 21 people attending our summit.

The discussions were dominated by the next steps in the Low Energy, Bluetooth 3.0 + High Speed and BlueZ 5.0 (our next major release). On the LE energy side the discussion were in all parts of its stacks, there are pending patches for the interleaved discovery, Management commands for LE, RSSI and Tx power handling. and the development on GATT was one of the most discussed things.

On the BlueZ 5.0 side we are going to drop a lot of old stuff like pand and dund daemons, IPC mechanism for audio as well some of our DBus API we already marked as deprecated. In the management API side the idea is to finish it as soon as possible and enable it by default in the kernel, then some day in the future we can get rid of hciops and raw access to HCI sockets in bluetoothd.

My summit tasks are finish the L2CAP separation in sock and core parts and move the Bluetooth subsystem to use workqueues instead of tasklets. ;-)

After the Bluetooth Summit I attended the open day of the kernel summit, you can find nice reports of it in LWN here and here.

On Wednesday both LinuxCon Europe and Embedded Linux Conference Europe started. It was certainly a good idea to put both conferences together in the same place at the same time, I had the opportunity to meet people and see talks from both conferences. Some of the talks I took part were “Demystifying HTML5″ by Sulamita Garcia & Gustavo Barbieri, “The Linux NFC Subsystem” by Lauro Ramos Venancio & Samuel Ortiz. “systemd Administration in the Enterprise” by Lennart Poettering & Kay Sievers. “Linux for In-Car Infotainment” by Matt Jones.

Finally, I would like to thank ProFUSION to sponsor my travel to Prague.

Bluetooth Changes for Linux 3.1

The 3.1 release is coming and it’s time to see what have changed in the Bluetooth subsystem. The biggest part of the changes are related to Bluetooth Low Energy, Andre Guedes worked in adding LE Adversiment cache support, all the remote devices found are cached in a list and after a defined timeout this list is flushed. Vinicius Gomes and Anderson Briglia added a initial implementation of the LE Security Manager Protocol. At the moment only JustWorks pairing is implemented.

Gustavo Padovan worked in another L2CAP refactoring patchset towards a clear  separation between l2cap_core.c and l2cap_sock.c. Peter Hurley fixed a lot of potential deadlock over all the Bluetooth subsystem. Mat Martineau reworked the local busy handling inside the L2CAP Enhanced Retransmission Mode.

There is also many minor changes, fixes and clean ups, like HCI auth path fixes by Waldemar Rymarkiewicz, remote device blacklisting in the MGMT interface  among many others.

A full changelog can be viewed issuing the following command in linus’ tree:

git shortlog -n v3.0..origin/master –no-merges  net/bluetooth/ include/net/bluetooth/ drivers/bluetooth/

GSoC: BlueZ projects sucessfullly finished

During this summer four students took part in Google Summer of Code with BlueZ. All four have passed the final term and produced a lot of code. Each of them the wrote a report about their projects. The reports were posted in bluez.org. Here follows the links:

Improve EDS backend of Phone Book Access Profile (PBAP)
Student: Bartosz Szatkowski
Mentor: Claudio Takahasi

Nintendo Wii Remote Device Driver
Student: David Herrmann
Mentor: Gustavo Padovan

Implementing the Basic Imaging Profile(BIP)
Student: Jakub Adamek
Mentor: Vinicius Gomes

Implement the Video Distribution Profile(VDP)
Student: Prasad Bhat
Mentor: Luiz Augusto von Dentz

That is it for this summer, I’m hoping to have another great summer on GSoC next year.

Bluetooth Changes for Linux 3.0

Yet another busy release. More than a hundred of commits for the Bluetooth subsystem will be in the upcoming kernel 3.0 release.

Those patches has the last bits for the Management Interface, By Johan  Hedberg. There should be things to fix and minor features to implement, especially about Bluetooth Low Energy, but the hard work is done.

Another big set of changes is in the L2CAP layer, where Gustavo Padovan is rewritten some parts of it to remove the socket dependence from the L2CAP core. This will help fix many issues in the RFCOMM layer and will help the AMP Manager implementation.

Szymon Janc worked in add Out Of Band Pairing Support to the Management Interface and to replace the kernel_thread() usage with the kthread API among other fixes.

There is also support for 16 digit PIN code in the Legacy Pairing, and lot of bug fixing and clean ups.