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

Various user-contributed guides for software-related things
User avatar
Fleder
Posts: 848
Joined: Thu May 05, 2016 9:04 am
Location: Germany
Has thanked: 182 times
Been thanked: 257 times

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

Post by Fleder » Tue Jun 14, 2016 1:36 am

BMBteke397 wrote: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?
For me, i had to restart the Pi with the HDMI connected before i turned it on. But my wiring seems to be odd, so it might only affect me this way.

drlbradley
Posts: 38
Joined: Wed Jun 01, 2016 1:00 am
Location: Windsor, UK
Has thanked: 12 times
Been thanked: 5 times

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

Post by drlbradley » Tue Jun 14, 2016 3:43 pm

anyone else having problems with USB audio?

followed the guide, and my USB device is shown as default but, launching ROMs results in it bombing out to rom list with an error message saying 'failed to find mixer elements'

User avatar
tronicgr
Posts: 138
Joined: Tue Jun 07, 2016 4:26 pm
Has thanked: 94 times
Been thanked: 66 times
Contact:

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

Post by tronicgr » Tue Jun 14, 2016 3:57 pm

drlbradley wrote:anyone else having problems with USB audio?

followed the guide, and my USB device is shown as default but, launching ROMs results in it bombing out to rom list with an error message saying 'failed to find mixer elements'

Look here how to remove that message. Not easy way.

https://github.com/Aloshi/EmulationStation/issues/433


Thanks
Thanos

drlbradley
Posts: 38
Joined: Wed Jun 01, 2016 1:00 am
Location: Windsor, UK
Has thanked: 12 times
Been thanked: 5 times

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

Post by drlbradley » Tue Jun 14, 2016 4:04 pm

recompile :/

thanks, I'll try that

User avatar
Fleder
Posts: 848
Joined: Thu May 05, 2016 9:04 am
Location: Germany
Has thanked: 182 times
Been thanked: 257 times

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

Post by Fleder » Wed Jun 15, 2016 12:14 am

For easier access and backup, i will post the solution here.
jcoutch wrote:Assuming you've already set the USB sound card as the default in Alsa, you should be able to do the following:
Open up a terminal prompt, and run:

amixer -l
Note the name of your mixer. Mine was named "Speaker".

Now run:

git clone https://github.com/Aloshi/EmulationStation.git
nano EmulationStation/es-app/src/VolumeControl.cpp

Change line 8 from:

const char * VolumeControl::mixerName = "PCM";
to match the name of your mixer ("Speaker" in my case):

const char * VolumeControl::mixerName = "Speaker";
Press Ctrl+O and Enter to save the file, then Ctrl+X to exit Nano.

Then, follow the instructions for building the code from the main Github page:
sudo apt-get install libsdl2-dev libboost-system-dev libboost-filesystem-dev libboost-date-time-dev libboost-locale-dev libfreeimage-dev libfreetype6-dev libeigen3-dev libcurl4-openssl-dev libasound2-dev libgl1-mesa-dev build-essential cmake fonts-droid

cd EmulationStation
cmake .
make
make install


Restart Emulation Station, and now you should be able to control your volume.

drlbradley
Posts: 38
Joined: Wed Jun 01, 2016 1:00 am
Location: Windsor, UK
Has thanked: 12 times
Been thanked: 5 times

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

Post by drlbradley » Wed Jun 15, 2016 7:03 am

Fleder wrote:For easier access and backup, i will post the solution here.
jcoutch wrote:Assuming you've already set the USB sound card as the default in Alsa, you should be able to do the following:
Open up a terminal prompt, and run:

amixer -l
Note the name of your mixer. Mine was named "Speaker".

Now run:

git clone https://github.com/Aloshi/EmulationStation.git
nano EmulationStation/es-app/src/VolumeControl.cpp

Change line 8 from:

const char * VolumeControl::mixerName = "PCM";
to match the name of your mixer ("Speaker" in my case):

const char * VolumeControl::mixerName = "Speaker";
Press Ctrl+O and Enter to save the file, then Ctrl+X to exit Nano.

Then, follow the instructions for building the code from the main Github page:
sudo apt-get install libsdl2-dev libboost-system-dev libboost-filesystem-dev libboost-date-time-dev libboost-locale-dev libfreeimage-dev libfreetype6-dev libeigen3-dev libcurl4-openssl-dev libasound2-dev libgl1-mesa-dev build-essential cmake fonts-droid

cd EmulationStation
cmake .
make
make install


Restart Emulation Station, and now you should be able to control your volume.
anyone wanting/needing to do this, just be aware that it takes 2-3 hrs to compile EmulatationStation on the PiZero. I don't have my error anymore though :) And I get audio from the EmulationStation UI, now to just figure out how to get audio from the emulators..

User avatar
wermy
Site Admin
Posts: 1342
Joined: Tue May 03, 2016 8:51 pm
Has thanked: 617 times
Been thanked: 1318 times
Contact:

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

Post by wermy » Wed Jun 15, 2016 9:03 am

drlbradley wrote: anyone wanting/needing to do this, just be aware that it takes 2-3 hrs to compile EmulatationStation on the PiZero. I don't have my error anymore though :) And I get audio from the EmulationStation UI, now to just figure out how to get audio from the emulators..
Maybe someone feeling generous/bored could do this and get it set up, and then create a backup of their SD card image? Then others could just restore that backup to an SD card and be good to go. :)
ImageImageImageImage

User avatar
Fleder
Posts: 848
Joined: Thu May 05, 2016 9:04 am
Location: Germany
Has thanked: 182 times
Been thanked: 257 times

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

Post by Fleder » Mon Jun 20, 2016 1:12 pm

It took me 2 1/2 hours.
I am writing an image from the SD now and we will see how big it is.

Edit: 15GB. So not really a viable option.
I think compiling for 2 1/2 hours or downloading 15GB is a tie, especially if you consider that your device has to be "Speaker", too.
Or else it will not work.

drlbradley
Posts: 38
Joined: Wed Jun 01, 2016 1:00 am
Location: Windsor, UK
Has thanked: 12 times
Been thanked: 5 times

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

Post by drlbradley » Mon Jun 20, 2016 2:25 pm

Let me know if you get audio out of the emulators. I can get audio from emulationstation Ui, but not from any emulators

User avatar
Fleder
Posts: 848
Joined: Thu May 05, 2016 9:04 am
Location: Germany
Has thanked: 182 times
Been thanked: 257 times

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

Post by Fleder » Tue Jun 21, 2016 12:21 am

drlbradley wrote:Let me know if you get audio out of the emulators. I can get audio from emulationstation Ui, but not from any emulators
Could you try the following, please?:

Create the .asoundrc file. Which should not exist.

Code: Select all

sudo nano .asoundrc
Then type in the following (if your device is card 0 and device 0 (/proc/asound/cards)):

Code: Select all

pcm.PCM {
	type hw
	card 0
	device 0
}
Strg+X -> Yes -> Enter

Code: Select all

sudo reboot
This should create an alias for your mixer which is usually called "Speaker".
But as Alsamixer is looking for PCM, this causes it to ignore that one.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest