59 Responses

  1. Philippe Vaille-Brunet at | | Reply

    Sorry but I get troubles with the Bose SLIII
    here is the description :
    pacmd list-cards
    2 card(s) available.
    index: 1
    owner module: 7
    alsa.card = “0”
    alsa.card_name = “bcm2835 ALSA”
    alsa.long_card_name = “bcm2835 ALSA”
    alsa.driver_name = “snd_bcm2835”
    device.bus_path = “platform-soc:audio”
    sysfs.path = “/devices/platform/soc/soc:audio/sound/card0”
    device.string = “0”
    device.description = “bcm2835 ALSA”
    module-udev-detect.discovered = “1”
    device.icon_name = “audio-card”
    output:analog-mono: Mono analogique Output (priority 200, available: unknown)
    output:analog-stereo: Stéréo analogique Output (priority 6000, available: unknown)
    off: Éteint (priority 0, available: unknown)
    active profile:
    alsa_output.platform-soc_audio.analog-stereo/#0: bcm2835 ALSA Stéréo analogique
    alsa_output.platform-soc_audio.analog-stereo.monitor/#1: Monitor of bcm2835 ALSA Stéréo analogique
    analog-output: Sortie analogique (priority 9900, latency offset 70000 usec, available: unknown)

    index: 6
    owner module: 32
    device.description = “Bose SLIII”
    device.string = “08:DF:1F:4D:1E:59”
    device.api = “bluez”
    device.class = “sound”
    device.bus = “bluetooth”
    device.form_factor = “hifi”
    bluez.path = “/org/bluez/hci0/dev_08_DF_1F_4D_1E_59”
    bluez.class = “0x240428”
    bluez.alias = “Bose SLIII”
    device.icon_name = “audio-card-bluetooth”
    a2dp_sink: High Fidelity Playback (A2DP Sink) (priority 10, available: yes)
    off: Éteint (priority 0, available: yes)
    active profile:
    bluez_sink.08_DF_1F_4D_1E_59.a2dp_sink/#4: Bose SLIII
    bluez_sink.08_DF_1F_4D_1E_59.a2dp_sink.monitor/#6: Monitor of Bose SLIII
    hifi-output: HiFi (priority 0, latency offset 0 usec, available: yes)

    hifi-input: HiFi (priority 0, latency offset 0 usec, available: no)
    only a2dp_sink gives an answer, else headset is unknown
    the main difference is to priority and latency which are quite different from the alsa jack output
    when reading of the .ogg file is set , there is reading but any sound out from the bose
    I set the hcitool but I don’t know what ’s for.

    When I tried bluez in terminal mode, I got a message : frame isn’t transmitted approximatively
    I noted than the pulseaudio (pavucontrol ) never gives information about the bose in output devices
    Any suggestion will be readen attentivily.
    Thanks a lot by Philippe

  2. Larry at | | Reply

    Tried your instructions but cannot get set profile and sink. Errors on each.
    I have a headphone unit working well on a2dp but have been unable to get speaker working.
    When trying the speaker it pairs and connects but there is no card listed for the unit.
    As a sidenote….i tried a completely clean system (using stretch) and couldn’t get either unit to output sound. Headphones pair and connect and show as card1 but have been unable to activate profile. Speaker pairs and connects but do not even show as card. I have been reading all your efforts and will continue to monitor your site. Thanks for all your hard work.

  3. Larry at | | Reply

    Hi Youness, didn’t expect such a quick reply…..thanks.
    Buth units work well with android and ios hardware.
    I did turn off bluesalsa and noticed that the profile was turned off in pavuaudio so i rebooted and turned the profile on.
    I will be busy with other things today but will try to capture some info when i get a chance.
    Seems like all works well in your guide until I check cards as explained above. And seems odd that i can get a card for the headphones and can connect bit cannot get audio to output. Both units appear to suppory a2dp and hfp.

  4. Jan at | | Reply

    Hey Guys,

    I thought I’d highjack the comment section of your post, Youness, and ask for help in a similar setup I’m trying to get working: In my case I have an USB audio interface with in- and outputs connected to a Raspberry Pi Zero. I want the Pi to connect to another device (pc, ipad…) registering as a bluetooth headset (using hsp). So far following a mixture of your tutorial and this link (https://didier.io/post/raspberrypi-stream-sound-over-bluetooth) I managed to configure the pi as a bluetooth speaker. But I can not get it to send the microphone input of the audio-interface over bluetooth… Any ideas? I tried different values for the Class parameter in /etc/bluetooth/main.conf .. So far without success.

    Any help or ideas would be greatly appreciated!

  5. Philippe Vaille-Brunet at | | Reply

    Hi to everyone
    A lot of responses
    some progress today
    1 to youness
    the bose SLIII is only made for playing music
    and I want to run it in my home without connection to the Pi3 except by bluetooth
    2 to Larry and youness
    this afternoon, after some trials with terminal and gui nothing get
    but just now afer restarting the Pi3
    I start the Bose
    I click on bluetooth : make discoverable, add device and wait for bose, paired it
    suprise : in a terminal I just killer the bluealsa
    and in pulseaudio gui I got the Bose in output device
    in Bluemindo I started playing a music
    go back to every sourdine button in audio, pulseaudio output and playing
    now it’s running nearly well.

    Is the main progress would be stop the bluealsa service in console?
    I’ll try later, for instance I listen with pleasure.
    Thanks a lot.

  6. Philippe Vaille-Brunet at | | Reply

    Sorry youness
    but 45mn after the starting , I lost the stream on the bose
    I try to restart but nothing for instance.
    A new pi restarting give me a bose instance
    how :
    1 turn on the bluetooth by clicking on its icon
    2 click on the audio speaker to connect the bose if exists; if not add …
    3 the bose answers by a bip
    4 open a terminal and kill the bluealsa service
    5 go to bluetooth, verify bose is connected
    6 then start the music player ( bluemindo for me )
    7 choice the file to play
    seriously it’s fine
    The question : it’s little complex

  7. Connor at | | Reply

    Hello Youness,

    Thank you! This has been frustrating me for the last two weeks!

    I’m so close, yet so far! I’m getting the error you mention in the article:
    Failed to set card profile to ‘headset_head_unit’.

    I’ve restarted and re-synced the bluetooth device: (https://www.amazon.co.uk/gp/product/B076HRH34T/ref=oh_aui_detailpage_o03_s00?ie=UTF8&th=1)

    But, I still seem to get that error every time. I’ve tried a couple of things I found digging through some old forum posts, but nothing seems to fix the problem.

    I’m not sure what to try next, I was hoping you may know? Here’s the pacmd card listing: https://gist.github.com/anonymous/6fd573116eb37fcf1a917301ebfe8725

    The profile headset_head_unit does appear in the listed profiles, but I can’t set it as the active profile for some reason, I can set it to a2dp and off however.

    Could it possibly be because the listed protocol is (HSP/HFP) as opposed to being solely HSP?

    Thanks for any help and for all the effort you’ve put into solving this problem so far!

    1. Connor at | | Reply

      So, in the pacmd card listing it denotes that both a2dp_sink and headset_head_unit are both ‘unknown’ to be available:

      headset_head_unit: Headset Head Unit (HSP/HFP) (priority 20, available: unknown)
      a2dp_sink: High Fidelity Playback (A2DP Sink) (priority 10, available: unknown)

      However, I am able to switch the card profile and default-sink to a2dp_sink and play the audio file. But again when I try to switch the profile to headset_head_unit it fails with the above error.

      1. Connor at | | Reply

        Oops! We seem to have posted replies simultaneously.

        So, I just tried connecting it to my computer and managed to both play and record audio when it’s connected. I’ve also just tried this on my phone and managed to do the same, both without requiring a passcode or any authentication step. The device simply connects.

        What I’ve tried in terms of removing the device is to open bluetoothctl and remove the device from there. Is this what you’re referring to?

  8. Philippe Vaille-Brunet at | | Reply

    Hi youness
    the problem continues with my bose
    this evening it’s impossible to connect or remove the bose. I get error message about tre gdbus
    May I send you a scrennshot about errors
    The messages texts are :
    remove device : removal failed – GDBus.Error:org.bluez.Error.NotReady: Ressource Not Ready
    The other one:
    Connecting Audio Device: Failed to connect to device-
    GDBus.Error:org.bluez.Error.NotReady: Ressource Not Ready. Try to connect again..
    But I tried for one and half hour.
    Is it a bug?

  9. Philippe Vaille-Brunet at | | Reply

    Hi youness
    me again, sorry. But I’ld to understand how it’s work
    My last trial :
    I made the bluetooth script as above, I got an error about the LSB tags when I run the update.rc command
    I start again the Pi3 and connection to bose started immediatly
    I get rid of bluemindo and install aqualung
    I run aqualung on a Music directory
    But the pavucontrol doesn’t see the connected bose, so any music out in my ears
    if I use the wire between the jack connector’pi and the bose’jack, I got audible music.
    Do you know how we could get the bose-bluetooth line in the output-pavucontrol as soon as we have connected bose in the audio icon and in the bluetooth icon on the taskbar?
    Sorry for such disturbing elements
    Thanks a lot for any response.

  10. Eirik at | | Reply

    Thanks for this article. I actually had this working “right out of the box”, which makes the problems even more annoying. I had jessie running, and the only thing I did was to bluetoothctl pair and connect my Bluetooth speaker, and it connected, and STAYED connected. I could play mp3s of the command line, and use text-to-speech which was part of the project.

    Then suddenly, while testing, the audio stuck and repeated (broken record, extremely fast), and I had to turn off the Bluetooth speaker. Since then, I have not been able to pair again using the default alsa. I since upraded to stretch, it only worked using pulseaudio, but sound is very choppy. It sure would have been nice to have a simple and working A2DP and HSP.

  11. Philippe Vaille-Brunet at | | Reply

    Hi youness
    Thanks a lot for all your answers
    The bose is now running, how?
    using what you say by console.
    I uninstall bluealsa… may be a bad idea for another app?
    If I try to resume
    switch on the bose
    start bluetoothctl and the steps power on agent on default-agent : we wait for yes
    scan on sees the bose in some seconds, pair, trust and connect even if we havn’t answers «on» with pair and trust, connect has to get connected in any case.
    open pavucontrol
    in parallel : pacmd list-cards in which we wait the bose recognition
    and the 2 other commands
    pavu reacts to the pacmd commands
    If we start pulseaudio in console, the streaming flow is bad because the console prints out the levels of the streaming and creates interruptions.
    Running good for 3 hours, fine! The dream!
    For me, an improvement in order to click on something once would be better for start recognition and real connection of the bose. I can wait now I learned the console steps.
    Bye! Pleasure to meet you!

  12. Fabrizio at | | Reply

    Dear Youness, first of all i want to express my gratitude for sharing your knowledge/time with us.
    i have read all your project since the begin and applied to my situation.
    every tink whent ok and i was able to pair and connect the device in both protocol (hsp a2dp), i succeded to record and play a recorded audio…great…
    i would like to automate the connection after reboot , and i saw some indication that you suggested and i’ll try to applicate.
    what is not very clear to me is what in the procedure is permanent and what must be automated at reboot.
    for example, this command should be repeated at every boot?: sudo hcitool cmd 0x3F 0x01C 0x01 0x02 0x00 0x01 0x01

    i try to explane my project that is now in the first step and maybe i’ll get some suggestion.
    we are a group of motorcycle bikers, we ride in goup and we all have bluetooth devices in the helmets connected to the smartphone and some of us are also connected in intercom from bike to bike.
    the range of the bluetooth in certain condition is not enough so we want to use rtx radios (uhf/pmr).
    The project is to connect a common two way radio with the the bluetooth installed in the helmet.
    the idea is to connect via bluetooth a raspberry to the interphone (done, to be automated) and than to physically connect the raspberry (probably wit an extra audio dongle) to the mic/spk connector of the radio.
    when i am talking into the Helmet’s microphone, the audio should exit from a connector and enter in the mic connector of the radio.
    what the radio receive a signal, the audio getting out from the spk connector should enter in the raspberry and streamed into the helmet.

    Any suggestion? ……Tks in advance

  13. Randy T at | | Reply

    Minor nit
    For the install pulse audio commands, this looks incorrect:
    sudo apt-get install pulseaudio pulseaudio-module-bluetoot

    I think it should be bluetooth at the end, instead of bluetoot

    Also, I would disable the internal bluetooth interface on the pi3
    cd /boot
    sudo nano config.txt

    Add to config.txt:
    #disable the internal bluetooth

    You may also need to do this (I haven’t tried it yet)
    sudo systemctl disable hciuart.service

    I just bought an asus bluetooth module, and plan to try your instructions to install it, thanks.

  14. JK at | | Reply


    Yes, I have the same issue with distorted audio.
    I believe the problem may be caused by a sample format mismatch.
    I can hear it when I loopback the audio.

    What exactly is the following command in the final solution supposed to do?
    “sudo hcitool cmd 0x3F 0x01C 0x01 0x02 0x00 0x01 0x01”

    Is there a byte-for-byte breakdown?
    Is the sample format encoded in there somewhere?



  15. Theodore Stavropoulos at | | Reply

    Will this work with an external bluetooth adapter such as


    Im thinking about putting this in the office and hooking up my Dre PowerBeat3’s to it and running google home on the Pi. This way ive got Google home hooked up playing audio through my headphones and listening to commands from me on the attached mic

  16. SouSouleBarbu at | | Reply

    Hi Youness,

    I’m facing a weird situation: I have followed all the steps and I didn’t get any error. I got the sound when I types paplay /tmp/h2g2;ogg on A2DP, but no sound on HSP.

    I tried to remove, reconnect, reboot… multiple time, but I doesn’t change a thing…
    That’s really weird because I didn’t got any error…

    Config, RP3 with doss soundbox.

    Thanks a lot!

  17. Phil171 at | | Reply

    Same problem as SouSouleBarbu. I followed all the tutorial, can hear h2G2.ogg, but cannot hear an MP4.
    When I want to change in Blueman-Manager the audio profile to A2DP Sink, it return “Failed to change profile to a2dp_sink”.
    But even on Headset Head Unit (HSP/HPF), on my Philips SHB7000 head set, no sound.
    Best Regards from France,

  18. TheodoreStav at | | Reply

    Hey Youness,

    Ive given it multiple trys but keep getting the “failed to set card profile to ‘headset_head_unit’ ive removed the device and rebooted i can hear audio but cant record.. Any other suggestions ? these are powerbeat 3’s im trying with a pi 3

    index: 1
    owner module: 24
    device.description = “Theobeats”
    device.string = “2C:33:61:D8:BC:B4”
    device.api = “bluez”
    device.class = “sound”
    device.bus = “bluetooth”
    device.form_factor = “headphone”
    bluez.path = “/org/bluez/hci0/dev_2C_33_61_D8_BC_B4”
    bluez.class = “0x240418”
    bluez.alias = “Theobeats³”
    device.icon_name = “audio-headphones-bluetooth”
    a2dp_sink: High Fidelity Playback (A2DP Sink) (priority 10, available: unknown)
    headset_head_unit: Headset Head Unit (HSP/HFP) (priority 20, available: no)
    off: Off (priority 0, available: yes)
    active profile:
    headphone-output: Headphone (priority 0, latency offset 0 usec, available: unknown)

    headphone-input: Bluetooth Input (priority 0, latency offset 0 usec, available: no)

  19. TheodoreStav at | | Reply

    more to add to my post above…

    pi@raspberrypi:~ $ systemctl status bluetooth
    ● bluetooth.service – Bluetooth service
    Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
    Active: active (running) since Sat 2018-03-10 23:13:26 UTC; 28min ago
    Docs: man:bluetoothd(8)
    Main PID: 524 (bluetoothd)
    Status: “Running”
    CGroup: /system.slice/bluetooth.service
    └─524 /usr/lib/bluetooth/bluetoothd

    Mar 10 23:13:26 raspberrypi bluetoothd[524]: Endpoint registered: sender=:1.9 path=/A2DP/SBC/Source/1
    Mar 10 23:13:26 raspberrypi bluetoothd[524]: Endpoint registered: sender=:1.9 path=/A2DP/SBC/Sink/1
    Mar 10 23:13:32 raspberrypi bluetoothd[524]: Endpoint registered: sender=:1.17 path=/MediaEndpoint/A2DPSource
    Mar 10 23:13:32 raspberrypi bluetoothd[524]: Endpoint registered: sender=:1.17 path=/MediaEndpoint/A2DPSink
    Mar 10 23:13:32 raspberrypi bluetoothd[524]: RFCOMM server failed for Headset Voice gateway: rfcomm_bind: Address already in use (98)
    Mar 10 23:13:38 raspberrypi bluetoothd[524]: /org/bluez/hci0/dev_2C_33_61_D8_BC_B4/fd0: fd(29) ready
    Mar 10 23:17:04 raspberrypi bluetoothd[524]: Unable to get io data for Hands-Free Voice gateway: getpeername: Transport endpoint is not connected (107)
    Mar 10 23:17:33 raspberrypi bluetoothd[524]: /org/bluez/hci0/dev_2C_33_61_D8_BC_B4/fd1: fd(29) ready
    Mar 10 23:26:24 raspberrypi bluetoothd[524]: Endpoint unregistered: sender=:1.9 path=/A2DP/SBC/Source/1
    Mar 10 23:26:24 raspberrypi bluetoothd[524]: Endpoint unregistered: sender=:1.9 path=/A2DP/SBC/Sink/1

  20. simalto at | | Reply

    I am using raspberry pi zero w. with PA 10.0 and Bluez 5.43.
    I have manage to use my headset in A2DP mode without problem.
    But when I change to HSP profile no sound heard or mic record.
    by using the hcitool command(sudo hcitool cmd 0x3F 0x01C 0x01 0x02 0x00 0x01 0x01),
    I was able to hear sound and record.
    But my problem is that the sound is very bad and slow like motion.

    I am suspecting it has something to do with the pi zero w chip(BCM2835)
    according to this link:https://www.raspberrypi.org/magpi/pi-zero-w/

    can anyone help me with relevant hcitool command for this chip?
    Thanks in advance!

  21. Bastian at | | Reply

    Thank you for the real good work. I only required the A2D2P-support and due to your post it works the first time without sticking around for me. Using Raspberry pi zero w with Riva Turbo X on Raspbian Stretch. I issued the sound beeing slow motion alike, too. Hope to fix it in this weekend.

Please comment with your real name using good manners.

Leave a Reply