This component implements the Audio Video Remote Control Profile (AVRCP) as specified by the Bluetooth SIG in the official specification.
The bt-avrcp
component is a system service that is created when needed - typically as a side effect of launching the bt-a2dp-sink or bt-avrcp-target components. Once launched, bt-avrcp
will persist until explicitly terminated.
The component registers both the Controller (CT) and Target (TG) roles with the BR/EDR Profile Service.
Follow the steps for the A2DP sink profile and add this module to your build with --with //src/connectivity/bluetooth/profiles/bt-avrcp
to include AVRCP with your build. For product configurations in which AVRCP support is desired, include the bt-avrcp-core-shard
. For testonly configurations, include the bt-avrcp-testonly-core-shard
instead.
It's recommended to include the bt-avrcp-controller package to provide a simple REPL to send AVRCP commands to peers either by including the bt tools package in your build or directly with --with //src/connectivity/bluetooth/tools/bt-avrcp-controller
. This REPL is only available in testonly product configurations.
eg: fx set core.x64 --with //src/media/bundles:services --with //src/connectivity/bluetooth/tools/bt-avrcp-controller --with src/connectivity/bluetooth/profiles/bt-avrcp --with //src/connectivity/bluetooth/profiles/bt-a2dp
AVRCP doesn't start automatically and service manager should launch the bt_avrcp
service. The best way to do that today is by running the bt-avrcp-controller
tool from the Fuchsia shell with a fake peer id and then immediately exiting the shell.
Eg:
#> bt-avrcp-controller 12345 avrcp# exit >
Start the bt-a2dp-sink
service with run -d fuchsia-pkg://fuchsia.com/bt-a2dp-sink#meta/bt-a2dp-sink.cmx
(If you haven't paired previously) pair your fuchsia device with your test device -
bt-cli
from the fuchsia shell.discoverable
command to make the fuchsia device discoverableexit
command.Obtain the peer id for the paired device
bt-cli
from the fuchsia shell.list-peers
commands in bt-cli and copy down the peer ID.exit
command.Run bt-avrcp-controller <peer id>
(using the peer id from bt-cli) to obtain a controller for the peer.
Issue commands to the peer using the AVRCP tool. Use the help
command to get a list of supported commands available.
The bt-avrcp
component includes support for component inspection. To view component metrics or the current state of any connected peers , use fx iquery show core/bt-avrcp
.
root: peers: peer_#: peer_id browse = (connected / connecting / disconnected) control = (connected / connecting / disconnected) target_info controller_info last_connected_time metrics: distinct_peers control_connections browse_connections connection_errors control_channel_collisions target_peers_supporting_browsing distinct_target_peers_supporting_browsing target_peers_supporting_cover_art distinct_target_peers_supporting_cover_art controller_peers_supporting_browsing distinct_controller_peers_supporting_browsing controller_peers_supporting_cover_art distinct_controller_peers_supporting_cover_art
One peer child exists in the hierarchy for each peer that has been discovered regardless of its current connection status.
peer_manager
modPeerManager
TargetDelegate
peer
modRemotePeerHandle
Controller
RemotePeer
Controller
peer/tasks
modstate_watcher
task that is spawned to observe and react to state changes on each RemotePeer
createdTargetDelegate
peer/handlers
modControlCommandHandler
service
modprofile
modpackets
mod