Bluetooth A2DP + AVRCP 1.3+ module

radensb picture radensb · Feb 9, 2014 · Viewed 7.6k times · Source

I am having a difficult time understanding how to implement AVRCP with my project. I have searched quite a bit and read many datasheets, but I still seem to be missing something...

Here is what I want to do:

Simply put, i want to be able to connect with my android 4.3 device via bluetooth to stream music via A2DP (which seems pretty straight forward) as long as the bluetooth module supports A2DP. Additionally, i want to be able to control the media player app (Pandora, etc). Now, i know that AVRCP 1.0 supports only basic control commands (pause, play, next, prev, FF, RW), and I have found many bluetooth modules online that support sending these commands via simple UART AT commands or commands via an SPI bus. However, I also want to be able to get metadata from the android device (which is an AVRCP 1.3+ only capability), such as track name, album name, artist name, track length, and elapsed time.

Now, from what I understand, to get metadata, I need a bluetooth module that supports AVRCP 1.3 or higher. What I cannot understand is HOW one requests the metadata! From what I read, metadata, such as track name, artist, ablum, and track length, are are sent in response to a track change command. Can anyone confirm this? What about if I need to request the elapsed time?

Ideally, I am looking for a bluetooth module that support A2DP (24 bit if available) and AVRCP 1.3 or higher with a UART or SPI or I2C interface where I can send it play, pause, next, prev commands to control the music player and request artist, album, track name, elapsed time, track length metadata.

This is the only unit that I have found that mentions metadata in the datasheet: http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Wireless/Bluetooth/Melody_5.0_Manual-RevD-RC10-Release.pdf (pg.16)

But I am still unclear how this works!

Any assistance here would be great!

Answer

Michaud picture Michaud · Mar 28, 2014

First, you should have a look at this document: https://developer.bluetooth.org/TechnologyOverview/Documents/AVRCP_SPEC.pdf

To get the metadata from the source, you must use the following command: GetElementAttributes()

To know how to use that function and which parameters to set, go to page 53 in the datasheet. Whit that function, you have access to the following attributes: Title, Artist Name, Album Name, Track Number, Total number of tracks, Genre, Playing time. The source will response with the desired attributes. For the list of all attributes with their specific ids, see appendix E on page 132.