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 to play music to Bluetooth headphones or speakers.
This profile currently only supports the mandatory SBC audio codec.
The bt-a2dp-source
component needs access to the following at runtime:
fuchsia.media.AudioDeviceEnumerator
API to create the audio output device for source audio. This is generally available on most Fuchsia devices, provided by the audio_core
package.fuchsia.media.CodecFactory
API to encode the audio. This is provided by the codec_factory
package.codec_runner_sw_sbc
package.Without too many extra dependencies, adding the audio
, codec_factory
, and codec_runner_sw_sbc
packages to the available packages will provide all the required services. Adding the following to your Fuchsia set configuration should build them all and make them available:
--with //src/connectivity/bluetooth/profiles/bt-a2dp-source --with //src/media/audio --with //src/media/codec:codec_factory --with //src/media/codec:codec_runner_sw_sbc
The profile makes an effort to determine if encoding media will fail, and quits with a message on startup.
To provide Audio through the bt-a2dp-source component, start the component, then connect and pair to headphones or a speaker. Here are the steps:
bt-a2dp-source
with run -d bt-a2dp-source.cmx
bt-cli
start-discovery
and wait a few seconds.list-peers
and look for your device. If you know the name of the device, you can filter the results by adding part of the name as an argument.stop-discovery
when your device shows up.connect <BT address>
- you can type a partial address and use tab completionsignal_generator
will produce a tone for a couple seconds.tiles_ctl start; tiles_ctl add http://youtube.com
will replace any scenic with a youtube browser.Troubleshooting:
killall bt-a2dp-sink.cmx
vol
to turn up the volume on FuchsiaThe logging level for Audio Source can be increased at compile-time using the kernel command-line argument a2dp-source
.
a2dp-source=trace