RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    [TUTORIAL] Bluetooth audio on RetroPie v4.4 and Raspberry Pi 3 Model B+

    Scheduled Pinned Locked Moved Help and Support
    bluetooth audiotutorialaudio output
    14 Posts 12 Posters 23.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      machile
      last edited by

      This short tutorial shows how to get RetroPi v4.4 installed on the Raspberry Pi 3 Model B+ to use a bluetooth speaker for audio output with the least amount of effort. To follow the steps you need to access a terminal on the RetroPie (either over ssh or through pressing F4).

      1. Install pulseaudio-module-bluetooth
        This module enables the PulseAudio sound server to work with audio bluetooth devices. [1]
        $ sudo apt-get install pulseaudio-module-bluetooth

      2. Add the user pi to the bluetooth group
        This is needed so the user pi can access the bluetooth service. [2]
        $ sudo adduser pi bluetooth

      3. Tell the PulseAudio server to automatically use the newest connected speaker
        To do so, add the following line to /etc/pulse/default.pa: [3]

      /etc/pulse/default.pa
      -----------------------------------
      load-module module-switch-on-connect
      
      1. Tell bluetooth to enable audio service
        In my case, bluetooth worked but did not offer an audio sink (a2dp-sink) for PulseAudio. Add the following line to /etc/bluetooth/main.conf under the section [General]: [4, 5]
      /etc/bluetooth/main.conf
      -----------------------------------
      [General]
      Enable=Source,Sink,Media,Socket
      

      For visitors that land on this page when troubleshooting their bluetooth audio problems, try adding the above line when the ouput of systemctl status bluetooth is something along the line:

      Dec 16 13:35:33 retropie bluetoothd[492]: a2dp-sink profile connect failed for 88:C6:26:81:4D:CE: Protocol not available
      
      1. Connect to the speaker through the GUI
        RetroPie -> BLUETOOTH -> Register and Connect to Bluetooth Device
        Select DisplayYesNo as agent.

      2. Have RetroPie automatically connect to the speaker
        RetroPie -> BLUETOOTH -> Configure bluetooth connect mode
        Set connect mode to "background":

      3. Do a reboot and be set

      Sidenote:
      Do not install bluealsa! In my case, bluetooth audio did not work anymore as soon as bluealsa was installed and deinstalling did not help either, as some settings were not properly restored.

      References:
      [1]: https://packages.debian.org/jessie/pulseaudio-module-bluetooth
      [2]: https://raspberrypi.stackexchange.com/questions/71333/bluetooth-does-not-work-with-raspbian-stretch-and-raspberry-pi-3
      [3]: https://wiki.archlinux.org/index.php/PulseAudio#Switch_on_connect
      [4]: https://raspberrypi.stackexchange.com/questions/47708/setup-raspberry-pi-3-as-bluetooth-speaker
      [5]: https://bbs.archlinux.org/viewtopic.php?id=222083

      D R 2 Replies Last reply Reply Quote 1
      • X
        X_Splinter
        last edited by

        Nice... Do you experience any type of audio lag?

        quicksilverQ 1 Reply Last reply Reply Quote 0
        • quicksilverQ
          quicksilver @X_Splinter
          last edited by

          @X_Splinter Looks like @machile made this one post and hasnt been on the forum since. Not sure you are likely to get a response.

          1 Reply Last reply Reply Quote 0
          • F
            fraisdos125
            last edited by

            Good tutorial, pulseaudio works very good with retropie/kodi.
            Just one point to add to the tutorial. The following modification is needed in order to avoid sound crackling and speed issues:

            • sudo vim /etc/pulse/default.pa
            • change "load-module module-udev-detect" to "load-module module-udev-detect tsched=0"

            This will switch the audio scheduling from timer-based to the traditional, interrupt-driven approach. Which is the one will is needed at least for the PI 3b+.

            Sound quality can even by increase with the option Audio Resampling to highest quality.

            1 Reply Last reply Reply Quote 0
            • D
              DudeLebowski @machile
              last edited by

              @machile I have done this on the pi 4. It has broken the hdmi audio completely, stuttering on everything I do. Any idea how I can roll it back? I have removed everything I added to the files, and Uninstaller pulse.

              J T BabyboodleB 3 Replies Last reply Reply Quote 0
              • J
                Jewbacca11
                last edited by

                Hey, working on the rpi 3 b+ and I can’t seem to find /etc/pulse/default.pa. All that is in the /etc/pulse folder is two config files. Please help me.

                1 Reply Last reply Reply Quote 0
                • J
                  Jewbacca11 @DudeLebowski
                  last edited by

                  @DudeLebowski You should copy all the folders that you have installed personally and then reinstall the base software.

                  1 Reply Last reply Reply Quote 0
                  • T
                    They @DudeLebowski
                    last edited by

                    @DudeLebowski Did you find another way to connect bluetooth audio?

                    1 Reply Last reply Reply Quote 0
                    • T
                      theskid
                      last edited by

                      can this be done on the pi4? ,as i cant find the default.pa
                      file
                      stuck on part 3, access to /etc/pulse/default.pa is permission denied
                      cant see default.pa or the etc folder via playbox either
                      so cant put in .pulse

                      T 1 Reply Last reply Reply Quote 0
                      • T
                        theskid @theskid
                        last edited by

                        ok i got root access and made the changes but i cannot get the audio to play on the bluetooth speaker ,tried eveything
                        here:can this be looked at for pi4

                        1 Reply Last reply Reply Quote 0
                        • R
                          rafaz182 @machile
                          last edited by

                          @machile Im receiving

                          Apr 21 16:13:59 retropie-128G bluetoothd[579]: Unknown key Enable for group General in /etc/bluetooth/main.conf
                          
                          T 1 Reply Last reply Reply Quote 0
                          • BabyboodleB
                            Babyboodle @DudeLebowski
                            last edited by Babyboodle

                            @dudelebowski Yeah, I'm encountering the same issue after following this guide, where HDMI audio no longer works right. Have you found a solution to this? I'd rather not reinstall, and I guess there's no way to swap between the two freely. Hopefully someone can chime in with advice.

                            1 Reply Last reply Reply Quote 0
                            • T
                              tobiasz @rafaz182
                              last edited by

                              @rafaz182 said in [TUTORIAL] Bluetooth audio on RetroPie v4.4 and Raspberry Pi 3 Model B+:

                              @machile Im receiving

                              Apr 21 16:13:59 retropie-128G bluetoothd[579]: Unknown key Enable for group General in /etc/bluetooth/main.conf
                              

                              Did you solve it as I have the same error message. Also the bluetooth speaker is connected, but can't get any audio there also with the speaker-test command

                              1 Reply Last reply Reply Quote 0
                              • L
                                lumo
                                last edited by

                                Hi.
                                I followed this tutorial's steps and managed to get my BT speaker working.
                                The problem was that after reboot, the speaker failed to connect.
                                After searching the web for a while, I ran across this: https://unix.stackexchange.com/questions/334386/how-to-set-up-automatic-connection-of-bluetooth-headset
                                Please see the proposed solution.
                                Best regards, Luís

                                1 Reply Last reply Reply Quote 0
                                • R roxton referenced this topic on
                                • P phantom471 referenced this topic on
                                • N Nemed referenced this topic on
                                • V vXDclutch referenced this topic on
                                • First post
                                  Last post

                                Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.