How-to: Use USB Audio in Retropie v3.7

Various user-contributed guides for software-related things
User avatar
chiz
Posts: 228
Joined: Thu May 05, 2016 12:05 am
Has thanked: 29 times
Been thanked: 119 times

How-to: Use USB Audio in Retropie v3.7

Post by chiz » Thu May 12, 2016 9:06 pm

For those who's considering to go the USB audio route (vs. the PWM method), I've prepared this guide to help anyone who's at a loss on how to configure their Retropie installation for USB audio use. Note you'll need a USB keyboard attached or you can SSH into your system assuming you have configured it already for access within your home network.

Steps:
1. Attach the USB audio dongle into one of the USB ports connected the RPi. Reboot the system.

2. Once EmulationStation has loaded, exit from it by pressing F4. This will take you to the terminal.

3. Check if your USB audio has been detected by Raspbian Jessie by typing the command below:

Code: Select all

pi@retropie:~ $ lsusb
Output should be:

Code: Select all

Bus 001 Device 007: ID 0d8c:0014 C-Media Electronics, Inc.
Bus 001 Device 004: ID 0424:2517 Standard Microsystems Corp. Hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
The C-Media Electronics, Inc line shows that the USB audio device is detected.

4. Once we're sure the USB audio device is detected, let's check the order of priority of the sound cards being used by the system. Do so by typing this command:

Code: Select all

pi@retropie:~ $ cat /proc/asound/modules
Output should be:

Code: Select all

 0 snd_bcm2835
 1 snd_usb_audio
As you can see from the output above, the snd_bcm2835 is the built-in sound card but we want the system to use snd_usb_audio

5. We can change and force the system to load the sound cards in a different order by creating a sound configuration file. Create the file by using the command below:

Code: Select all

pi@retropie:~ $ sudo nano /etc/modprobe.d/alsa-base.conf
You will then enter the Nano editor environment and type the following lines:

Code: Select all

options snd_usb_audio index=0
options snd_bcm2835 index=1
options snd slots=snd-usb-audio,snd-bcm2835
Afterwards, press Ctrl+X to exit and answer Yes when prompted to save.

6. Reboot the system, exit EmulationStation once again to go to the terminal.

7. If you've successfully completed all the above steps, you should see the output below when you type the command:

Code: Select all

pi@retropie:~ $ cat /proc/asound/modules
Output should be:

Code: Select all

 0 snd_usb_audio
 1 snd_bcm2835
Notice that the order has changed and it's now the snd_usb_audio that's on top of the list with an index of 0

8. Test the sound by going to EmulationStation and playing a game. You should immediately hear EmulationStation sounds when you go select from the list of games.

Load EmulationStation by typing the following command:

Code: Select all

pi@retropie:~ $ emulationstation
Good luck!
Last edited by chiz on Fri May 13, 2016 1:42 am, edited 2 times in total.

User avatar
Fleder
Posts: 849
Joined: Thu May 05, 2016 9:04 am
Location: Germany
Has thanked: 183 times
Been thanked: 258 times

Re: How-to: Use USB Audio in Retropie v3.7

Post by Fleder » Thu May 12, 2016 11:59 pm

Thanks for sharing! Really helpful.

grenade44
Posts: 169
Joined: Wed May 04, 2016 11:58 pm
Location: Whitehill, UK
Has thanked: 17 times
Been thanked: 28 times
Contact:

Re: How-to: Use USB Audio in Retropie v3.7

Post by grenade44 » Fri May 13, 2016 1:56 am

Thanks for this, are you using a amplifier? Or Gameboy speaker soldered to usb audio?

User avatar
Ganreizu
Posts: 552
Joined: Thu May 05, 2016 8:20 am
Has thanked: 168 times
Been thanked: 97 times

Re: How-to: Use USB Audio in Retropie v3.7

Post by Ganreizu » Fri May 13, 2016 11:04 am

Bookmarked! :D Thank you~ Now all we need to do is document the physical connections and set up and we'll have a guide ready to go for when the wiki is up.

Robvp
Posts: 81
Joined: Mon May 09, 2016 10:53 am
Has thanked: 1 time
Been thanked: 2 times

Re: How-to: Use USB Audio in Retropie v3.7

Post by Robvp » Fri May 13, 2016 4:27 pm

How is the sound quality and volume compared to the pi's sound?

I'm currently debating wether to use this or get the output from the pi

User avatar
crispy_tofu
Posts: 340
Joined: Thu May 05, 2016 1:51 am
Location: Australia
Been thanked: 5 times

Re: How-to: Use USB Audio in Retropie v3.7

Post by crispy_tofu » Fri May 13, 2016 4:41 pm

Thanks for sharing chiz, this will come in very handy! :D

User avatar
chiz
Posts: 228
Joined: Thu May 05, 2016 12:05 am
Has thanked: 29 times
Been thanked: 119 times

Re: How-to: Use USB Audio in Retropie v3.7

Post by chiz » Fri May 13, 2016 8:41 pm

Glad you liked it guys. Let me know if you find anything incorrect or you're having problem following the step so we can improve or add more information to the guide.
grenade44 wrote:Thanks for this, are you using a amplifier? Or Gameboy speaker soldered to usb audio?
No I'm not. If you'll check my build log, you'll find a set of pics showing I measured the volume levels using the USB audio dongle connected to a micro speaker and it does sound decent enough. I'm waiting for a 2W micro speaker and would test if it will produce a louder sound.

User avatar
1461748123
Posts: 143
Joined: Wed May 04, 2016 8:36 pm
Has thanked: 9 times
Been thanked: 17 times

Re: How-to: Use USB Audio in Retropie v3.7

Post by 1461748123 » Fri May 13, 2016 9:47 pm

Thanks for the tutorial! Making this post sticky, also moving it to the RetroPi section :)

User avatar
dirtybeagles
Posts: 386
Joined: Thu May 05, 2016 6:04 am
Has thanked: 34 times
Been thanked: 64 times

Re: How-to: Use USB Audio in Retropie v3.7

Post by dirtybeagles » Mon May 30, 2016 12:05 am

Just completed my setup, thanks a ton for putting this together!!

BMBteke397
Posts: 8
Joined: Fri May 06, 2016 11:43 pm
Been thanked: 2 times

Re: How-to: Use USB Audio in Retropie v3.7

Post by BMBteke397 » Tue Jun 14, 2016 12:56 am

So, possible dumb question. If you use the USB audio would that bypass the HDMI audio if you decide to plug your Gameboy Zero into a TV? Would it still force the audio out through the Speaker or headphones instead of out to the TV?

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests