Introduction of AVRCP Common Commands for Bluetooth Music

Introduction of AVRCP Common Commands for Bluetooth Music

Insert picture description here

In this article, we will not talk about the protocol or analyze the Android source code, but simply understand the common AVRCP commands involved in actual Bluetooth music.

The commands of play, pause, and top and bottom cut songs all appear in pairs. To simulate the pressing state of the button, click pressed and release released. The two AVRCP commands appearing in pairs complete one action.

1. AVRCP Play
plays Bluetooth music, and uses AVCTP's AV/C format commands to walk the control channel
Insert picture description here

2. AVRCP Pause
pauses the Bluetooth music, and uses the AV/C format command to control the channel like the playback command
Insert picture description here

In actual use, the CT terminal may quickly send two play or pause commands, which will trigger some TG terminal devices (such as mobile phones) to perform the opposite operation. Corresponding to the above scenarios, it needs to be avoided to better provide Bluetooth music functions.

3. AVRCP Forward
cuts the song to the next one, and uses the control channel for data interaction.
Insert picture description here

4. AVRCP Backward
cuts the song to the previous one , and uses the control channel for data interaction.
Insert picture description here

5. AVRCP Get Element Attributes
obtains song information, such as artist, song title, album name, total song duration and other detailed information, and uses AV/C format commands to control the channel.
Insert picture description here

6. AVRCP Get Item Attributes
also obtains song information, but uses the browse format command to browse the channel.
Insert picture description here

7. AVRCP Get Play Status
obtains the current playback status, including the total duration of the song, the current playback progress bar, playback status, and other information, using AV/C format commands to take the control channel.
Insert picture description here

Because this command obtains the progress bar information of the song playing, it needs to request it in a loop. In the Android source code rc_start_play_status_timer() , the function is realized by a timer every 2s.

8. AVRCP Get Capabilities
obtains the AVRCP capabilities of the remote device, such as company name, supported events, and uses AV/C format commands to pass the control channel.
Insert picture description here

9. AVRCP Register Notification
registration notification. After the event supported by the GT side is successfully registered, if the event changes, it will be automatically notified to the CT side, so that the correct processing can be made. The command in the AV/C format is still used to control the channel.
Insert picture description here

10. AVRCP Get Folder Items
obtains a folder list, such as a media player list, a file system list, etc. Bluetooth music mainly obtains the list of media players through the browse channel through browse commands, which will return the names of the currently available media players and the functions they support.
Insert picture description here

AVRCP common commands are simply shared here. The combination of the above commands can basically meet the needs of Bluetooth music applications. The learning and use of more commands are left for everyone to experience in actual projects. Interested friends welcome private messages and leave a message to discuss together, learn together, and make progress together!

For more interconnection technologies, please pay attention to the WeChat public account: Connectivity
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44260005/article/details/108274193