Page 2 of 5

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

Posted: Tue Jun 14, 2016 1:36 am
by Fleder
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.

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

Posted: Tue Jun 14, 2016 3:43 pm
by drlbradley
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'

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

Posted: Tue Jun 14, 2016 3:57 pm
by tronicgr
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

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

Posted: Tue Jun 14, 2016 4:04 pm
by drlbradley
recompile :/

thanks, I'll try that

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

Posted: Wed Jun 15, 2016 12:14 am
by Fleder
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.

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

Posted: Wed Jun 15, 2016 7:03 am
by drlbradley
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..

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

Posted: Wed Jun 15, 2016 9:03 am
by wermy
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. :)

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

Posted: Mon Jun 20, 2016 1:12 pm
by Fleder
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.

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

Posted: Mon Jun 20, 2016 2:25 pm
by drlbradley
Let me know if you get audio out of the emulators. I can get audio from emulationstation Ui, but not from any emulators

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

Posted: Tue Jun 21, 2016 12:21 am
by Fleder
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.