Embedded Linux
  • Cover
  • Summary
  • About This Training
    • Objectives
    • Skills
    • Prerequisites
    • Requirements
  • Once Upon A Time ...
  • Embedded Linux
  • Build Systems
    • Yocto Board Support Package
      • Yocto
      • Compilation
        • Make
        • Bitbake
        • Script
      • Building Blocks
      • SDK
      • Extra Packages
      • Kernel
        • Patch
        • Building
        • Headers
      • Modules
        • Cross Compilation
        • Native
      • Filesystem
      • Flashing
    • Distributions
      • CentOS
      • Google Brillo
      • Jubilinux
      • Kali
      • Ostro
      • Ubilinux
      • Debian
  • Boot Loaders
    • U-Boot
  • Initialization
    • Upgrade
    • Boot Up
    • Dual Boot
    • Root Directory
    • Display Message
    • Modules
    • Filesystem
    • Memory
    • Backup
    • Recovery
    • Reboot
    • Processes
  • User Space
    • Virtual Network Computing
    • Text Editors
    • Services
    • Logs
    • Package Management Systems
      • Open Package Management
      • Python Package Index
      • Nicely Package Make
      • Advanced Packaging Tool
      • Manual
      • Conda
    • Libraries
      • Mraa
      • Upm
      • OpenCv
      • Temboo
      • Libiio
    • Frameworks
      • Cylon JS
      • Johnny Five
      • ROS
      • Gobot
      • Pixhawk
      • Artoo
      • Bower
      • Zetta
      • Miscellaneous
  • Subsystems
    • X File Systems
    • Pin Muxing
    • Virtual File System
    • Memory
    • Input
    • General Purpose Input Output
    • Serial
    • Bluetooth
      • Advanced Audio Distribution Profile
        • Bluez
        • Gstreamer
        • Alsa
      • Human Interface Device Game Controller
      • Serial Port Protocol
      • Arduino
    • WiFi
    • Audio
    • Camera
    • Block
    • Universal Serial Bus
      • Human Interface Device Mini Keyboard
      • Python USB
    • Inter Integrated Circuit
    • Inter Process Communication
    • Peripheral Component Interconnect
    • Clock
    • Modems
    • Networking
    • Power
    • Thermal
    • Graphics
    • LED
    • LIDAR
    • Printer
    • Serial Peripheral Interface
  • Application Development
    • C
    • C++
    • Cross Compile
    • Containers
    • Python
    • NodeJS
    • Cloud9
    • Data
    • Drone Code
    • Speech
      • Python
    • Radio Frequency
    • Bots
    • Artificial Intelligence
      • WitAi
      • MycroftAi
    • Games
    • Vision
      • Bar Codes
      • Google Cloud Vision API
    • Messaging
    • Entertainment
    • Home Assistants
    • Dashboards
    • IRC
    • Location
    • Facial Recognition
    • Software Defined Radio
    • REST
    • Notes
    • Security
    • HAM Radio
    • Automotive
    • Digital Signage
    • Photography
  • Debug
  • Wrap-Up
    • Online Training
    • Challenge
    • Tbd
  • SandBox
Powered by GitBook
On this page
  1. Subsystems
  2. Bluetooth

Advanced Audio Distribution Profile

root@edison:~# rfkill unblock bluetooth
  root@edison:~# bluetoothctl
[bluetooth]# scan on
Discovery started
[CHG] Controller 98:4F:EE:04:21:2A Discovering: yes
[NEW] Device F1:C1:83:A4:17:0C Evolutel
[NEW] Device 58:51:00:00:41:4D BT MINI
[CHG] Device F1:C1:83:A4:17:0C RSSI: -83
[CHG] Device F1:C1:83:A4:17:0C RSSI: -73
[bluetooth]# scan off
[CHG] Device 58:51:00:00:41:4D RSSI is nil
[CHG] Device F1:C1:83:A4:17:0C TxPower is nil
[CHG] Device F1:C1:83:A4:17:0C RSSI is nil
[CHG] Controller 98:4F:EE:04:21:2A Discovering: no
Discovery stopped
[bluetooth]# pair 58:51:00:00:41:4D
Attempting to pair with 58:51:00:00:41:4D
[CHG] Device 58:51:00:00:41:4D Connected: yes
[CHG] Device 58:51:00:00:41:4D UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Device 58:51:00:00:41:4D UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Device 58:51:00:00:41:4D UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device 58:51:00:00:41:4D UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device 58:51:00:00:41:4D Paired: yes
Pairing successful
[CHG] Device 58:51:00:00:41:4D Connected: no
[bluetooth]# connect 58:51:00:00:41:4D
Attempting to connect to 58:51:00:00:41:4D
[CHG] Device 58:51:00:00:41:4D Connected: yes
Connection successful
[CHG] Device 58:51:00:00:41:4D UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Device 58:51:00:00:41:4D UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Device 58:51:00:00:41:4D UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device 58:51:00:00:41:4D UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device 58:51:00:00:41:4D UUIDs: 0000111f-0000-1000-8000-00805f9b34fb
[bluetooth]# info 58:51:00:00:41:4D
Device 58:51:00:00:41:4D
        Name: BT MINI
        Alias: BT MINI
        Class: 0x240404
        Icon: audio-card
        Paired: yes
        Trusted: no
        Blocked: no
        Connected: yes
        LegacyPairing: no
        UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)
        UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree Audio Gateway   (0000111f-0000-1000-8000-00805f9b34fb)
[bluetooth]#
[BT MINI]# quit
[DEL] Controller 98:4F:EE:04:21:2A edison [default]
root@edison:~# pactl list sinks
Sink #0
        State: SUSPENDED
        Name: alsa_output.platform-merr_dpcm_dummy.0.analog-stereo
        Description: dummy-audio Analog Stereo
        Driver: module-alsa-card.c
        Sample Specification: s16le 2ch 48000Hz
        Channel Map: front-left,front-right
        Owner Module: 1
        Mute: no
        Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100%$
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor Source: alsa_output.platform-merr_dpcm_dummy.0.analog-stereo.mo$
        Latency: 0 usec, configured 0 usec
        Flags: HARDWARE DECIBEL_VOLUME LATENCY
        Properties:
                alsa.resolution_bits = "16"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = ""
                alsa.id = "1"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "1"
                alsa.card_name = "dummy-audio"
                alsa.long_card_name = "dummy-audio"
                device.bus_path = "platform-merr_dpcm_dummy.0"
                sysfs.path = "/devices/platform/merr_dpcm_dummy.0/sound/card1"
                device.string = "hw:1"
...
...
Sink #1
        State: SUSPENDED
        Name: alsa_output.0.analog-stereo
        Description: Loopback Analog Stereo  
        Driver: module-alsa-card.c
        Sample Specification: s16le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 2
        Mute: no
        Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100%$
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor Source: alsa_output.0.analog-stereo.monitor
        Latency: 0 usec, configured 0 usec
        Flags: HARDWARE HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
        Properties:
                alsa.resolution_bits = "16"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "Loopback PCM"
                alsa.id = "Loopback PCM"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "0"
                alsa.card_name = "Loopback"
                alsa.long_card_name = "Loopback 1"
                device.bus_path = "/devices/virtual/sound/card0"

...
...
Sink #2
        State: SUSPENDED
        Name: bluez_sink.58_51_00_00_41_4D
        Description: BT MINI
        Driver: module-bluez5-device.c
        Sample Specification: s16le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 13
        Mute: no
        Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100%$
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor Source: bluez_sink.58_51_00_00_41_4D.monitor
        Latency: 0 usec, configured 0 usec
        Flags: HARDWARE DECIBEL_VOLUME LATENCY
        Properties:
                bluetooth.protocol = "a2dp_sink"
                device.description = "BT MINI"
                device.string = "58:51:00:00:41:4D"
                device.api = "bluez"
                device.class = "sound"
                device.bus = "bluetooth"
                device.form_factor = "headset"
root@edison:~# pactl list sinks | grep "Name:"
        Name: alsa_output.platform-merr_dpcm_dummy.0.analog-stereo
        Name: alsa_output.0.analog-stereo
        Name: bluez_sink.58_51_00_00_41_4D
root@edison:~#
root@edison:~# pactl set-default-sink bluez_sink.58_51_00_00_41_4D
root@edison:~# gst-launch-1.0 audiotestsrc ! audioconvert ! audioresample ! pulsesink
root@edison:~# wget http://www.wavsource.com/snds_2016-10-09_1797402624934163/animals/bear_growl_y.wav
root@edison:~# gst-launch-1.0 filesrc location=bear_growl_y.wav  ! wavparse ! pulsesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstPulseSinkClock
Got EOS from element "pipeline0".
Execution ended after 0:00:04.593866303
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
root@edison:~#
root@edison:~# gst-launch-1.0 filesrc location=bear_growl_y.wav ! decodebin ! audioconvert ! audioresample ! pulsesink
root@edison:~# gst-launch-1.0 filesrc location=bear_growl_y.wav  ! decodebin ! pulsesink
root@edison:~# bluetoothctl
[NEW] Controller 98:4F:EE:04:21:2A edison [default]
[NEW] Device 58:51:00:00:41:4D BT MINI
[bluetooth]#
[bluetooth]# paired-devices
Device 58:51:00:00:41:4D BT MINI
[bluetooth]# remove 58:51:00:00:41:4D
[bluetooth]# paired-devices
Device 58:51:00:00:41:4D BT MINI
Device has been removed
[CHG] Device 58:51:00:00:41:4D Connected: no
[DEL] Device 58:51:00:00:41:4D BT MINI
[bluetooth]# paired-devices
[bluetooth]#
PreviousBluetoothNextBluez

Last updated 7 years ago