This component implements the Advanced Audio Distribution Profile (A2DP) as specified by the Bluetooth SIG in the official specification. This means that you can use your Fuchsia device with audio support as a bluetooth speaker or (very not-portable) headphones.
This profile supports the mandatory SBC audio codec as well as the optional AAC codec.
The bt-a2dp-sink
component requires some services to be reachable when it is run to be useful. For audio playback, a provider of the fuchsia.media.SessionAudioConsumerFactory
service must be available. In current Fuchsia the mediaplayer
package located at //src/media/playback/mediaplayer
is one provider.
The Player must in turn be able to decode SBC/AAC audio and play it. Currently decoding is provided internally if you are using the mediaplayer
package. For most players to play audio, the fuchsia.media.Audio
and fuchsia.media.AudioCore
services will be used.
Without too many extra dependencies, adding the audio
package group and mediaplayer
package to the available packages will provide all the required services so adding the following to your Fuchsia set configuration should build them all and make them available:
--with //src/connectivity/bluetooth/profiles/bt-a2dp-sink --with //src/media/audio/bundles:services --with //src/media/playback/mediaplayer --with-base=//src/media/playback/mediaplayer:audio_consumer_config
The profile makes an effort to determine if playing media will fail, and crash with a log message on startup.
To listen to Audio through the bt-a2dp-sink component, start the component, connect and pair from an audio source.
bt-a2dp-sink
with run -d fuchsia-pkg://fuchsia.com/bt-a2dp-sink#meta/bt-a2dp-sink.cmx
bt-cli
discoverable
command within the CLI to make the fuchsia device discoverablebt-cli
running until you have finished connectingTroubleshooting:
tones
test package.vol
command)