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

    Connecting a Bluetooth audio device to retropie

    Scheduled Pinned Locked Moved Help and Support
    bluetooth audiocommand linequestion
    10 Posts 3 Posters 8.9k 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.
    • H
      HairDyeGuy
      last edited by

      Hey,

      Pi Model or other hardware: Zero W
      Power Supply used: 5v. phone charger with micro-usb cable
      RetroPie Version Used: 4.7.1
      Built From: Raspberry pi imaging tool
      USB Devices connected: Wireless keyboard and mouse dongle
      Controller used: Keyboard
      Guide used: this guide.

      I'm trying to attach my headphones to my retropie zero, and for that I've been following this guide.
      I managed to pass steps 1 and 2 easily but step 3 says:

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

      The thing is, I don't know to what I should attach this line to and how to reach it (I don't know how to code, so if it's something obvious please excuse me 😅).
      Thanks in advance!

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by mitu

        If you disabled the onboard audio, then I don't think you'll need any further configurations, once PulseAudio is installed and the heaphones are paired.
        Run speaker-test from the command line and see if you get sound.

        H 2 Replies Last reply Reply Quote 0
        • H
          HairDyeGuy @mitu
          last edited by

          @mitu I didn't disable my onboard audio, at least, not intentionally (or did installing pulse audio disabled the onboard one?). I'll try to pair the headphones and see if it works, thanks!

          1 Reply Last reply Reply Quote 0
          • H
            HairDyeGuy @mitu
            last edited by HairDyeGuy

            @mitu
            Update: Sorry it took me a while to respond. It's the beginning of exam season in uni.
            Anyway, the bluetooth audio works great, but now every time I move between screens (emulationnation to a game/settings and vis versa) I get the following message:

            [date] lvl10: VolumeControl :: init() - Failed to find mixer elements!
            

            What can I do to fix it?
            EDIT: I don't know if it matters, but the whole code line appears in white, not orange like in this comment

            mituM 1 Reply Last reply Reply Quote 0
            • mituM
              mitu Global Moderator @HairDyeGuy
              last edited by

              @hairdyeguy said in Connecting a Bluetooth audio device to retropie:

              What can I do to fix it?

              This means the AudioDevice configuration in EmulationStation is not correct - change it to one of the other options (Master/PCM/etc.) and see if this message disappears.

              H 2 Replies Last reply Reply Quote 0
              • H
                HairDyeGuy @mitu
                last edited by HairDyeGuy

                @mitu
                I tried doing so: First it was changed when I plugged it to a tv (to HDMI) and when it still didn't solve the issue I changed it to master.
                The interesting bit is that the first time after the change it shows the error message multiple times but then returns to one line per transition between games/systems.

                1 Reply Last reply Reply Quote 0
                • H
                  HairDyeGuy @mitu
                  last edited by

                  @mitu
                  Update: I tried to check it through the retropie audio settings and found an option called "enable Pulse Audio" once I did that the message disappeared. I've yet to test it with bluetooth but I think (and hope) that solved the issue.
                  Thanks for your help!

                  1 Reply Last reply Reply Quote 0
                  • R
                    roxton
                    last edited by roxton

                    Hi all,

                    Could someone post (and maybe pin) a summary here which would describe how to properly connect a bluetooth speaker to Retropie on Raspberry Pi (3B+ in my case)?
                    AFAIU, this guide is old and some of its steps are not needed or are harmful in Retropie 4.8, right?

                    I'm trying to connect my JBL Flip 4, I know its MAC but Retropie won't show it when I scan for bluetooth devices using the Retropie -> bluetooth menu.
                    bluetoothctl does not show it in scan results as well but if I try to pair using the known MAC, then trust and connect - it connects but there's still no audio, even after a reboot.
                    Should enabling pulseaudio play some role here?
                    I'd be grateful for a guide of just elaboration.

                    Thanks!

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

                      Replying to my own post.
                      I've got my JBL Flip 4 working on RPi 3b+ with RetroPie 4.8 using this guide, subsequently changing /etc/asound.conf to look like this:

                      # Bluetooth speaker
                      pcm.btspeaker {
                          type plug
                          slave.pcm {
                              type bluealsa
                              device "04:FE:A1:BF:FD:80"
                              profile "a2dp"
                          }
                          hint {
                              show on
                              description "JBL Flip 4"
                          }
                      }
                      
                      ctl.btspeaker {
                          type plug
                          card bluealsa
                      }
                      
                      pcm.!default pcm.btspeaker
                      ctl.!default ctl.btspeaker
                      

                      No issues playing audio files with omxplayer or aplay (e.g. aplay /usr/share/sounds/alsa/Front_Center.wav). The problem is with playing audio from the games - audio is delayed approximately by one second and sometimes stutters adding freezes to the game itself.

                      Do you guys know how the stuttering/delay could be eliminated in bluealsa?

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

                        Ok, so the stutter goes away if I set baud rate of Bluetooth to 460800:
                        Run sudo nano /boot/config.txt and then append the following

                        # Enable autoprobing of Bluetooth driver
                        dtparam=krnbt=on
                        
                        # Increase Bluetooth baud rate
                        dtparam=krnbt_baudrate=460800
                        

                        The idea was taken from here: https://github.com/Arkq/bluez-alsa/issues/205

                        Now only the playback delay left.

                        1 Reply Last reply Reply Quote 1
                        • 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.