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

    Changing audio output from 3.5mm Headphone to USB Headset, using RetroPie Menus <tag>audio</tag>

    Scheduled Pinned Locked Moved Help and Support
    audiomenu
    4 Posts 2 Posters 1.0k 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.
    • D
      dominoman2
      last edited by mitu

      Pi Model: Raspberry Pi 3 B+
      RetroPie Version: 4.8.2, System: rpi3 (armv71)
      Built From Pre made SD Image on RetroPie website
      USB Devices Connected: Logitech F310 Gamepad, Keyboard, Logitech ClearChat Headset

      My regular configuration for audio output is through the 3.5mm jack to speakers. On occasion, I would like to connect and use USB Headphones / Headset, such as my Logitech ClearChat Headset, and turn off the 3.5mm jack / speakers. When not using the USB headset, it will be disconnected from the USB port.

      I have been able to make the change by editing the .asoundrc file, and changing the card number appropriately in the defaults. However, I cannot seem to find a way to do this through any of the cryptic menus related to audio on RetroPie. I'd think there would be a way to add a menu item called something like "Headset." I don't want to have to go in and edit config files every time I want to connect and use the USB headset.

      Any suggestions would be greatly appreciated. Thank you in advance!

      aplay -l    :
      **** List of PLAYBACK Hardware Devices ****
      card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
        Subdevices: 4/4
        Subdevice #0: subdevice #0
        Subdevice #1: subdevice #1
        Subdevice #2: subdevice #2
        Subdevice #3: subdevice #3
      card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
        Subdevices: 4/4
        Subdevice #0: subdevice #0
        Subdevice #1: subdevice #1
        Subdevice #2: subdevice #2
        Subdevice #3: subdevice #3
      card 2: Headset [Logitech USB Headset], device 0: USB Audio [USB Audio]
        Subdevices: 1/1
        Subdevice #0: subdevice #0
      

      .asoundrc (for 3.5mm Headphones)

      pcm.!default {
        type asym
        playback.pcm {
          type plug
          slave.pcm "output"
        }
      }
      
      pcm.output {
        type hw
        card 1
      }
      
      ctl.!default {
        type hw
        card 1
      }
      
      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by

        The audio menu in RetroPie is meant to work for the on-board audio on the Pi, it doesn't deal with external sound cards.
        What you can do is have 2 .asoundrc files and switch between them with a script.

        • Create a Headset.sh file in $HOME/RetroPie/retropiemenu with the contents:
         #!/usr/bin/env bash
         cp $HOME/.asoundrc_headset $HOME/.asoundrc
        
        • Create a Headphones file in the same folder with the contents
         #!/usr/bin/env bash
         cp $HOME/.asoundrc_headphones $HOME/.asoundrc
        
        • Restart EmulationStation and you should have 2 new entries in the RetroPie system, which you can use to switch between the 2 audio outputs.
        D 1 Reply Last reply Reply Quote 0
        • D
          dominoman2 @mitu
          last edited by

          @mitu Thank you for the help. That worked fine. When I run the scripts I have to restart EmulationStation for the sound output changes to take effect. Is there any way around that? If not, it's no big deal considering I won't be using the scripts very often.

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

            @dominoman2 said in Changing audio output from 3.5mm Headphone to USB Headset, using RetroPie Menus <tag>audio</tag>:

            When I run the scripts I have to restart EmulationStation for the sound output changes to take effect

            I guess that for EmulationStation to pick up the changes you need to modify the audio settings for the sound to be re-initialized, but for emulators it shouldn't be a problem.

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