Problems with alsa sound driver Raspberry Pi

My apologies in advance if I don’t give enough information at first or if I give irrelevant information.

I jumped at the chance to buy a Raspberry Pi 2 as soon as they were announced, with intent to use as a Retroarch box mainly, but also for tinkering with linux.

To get retroarch running on it I followed the libretro wiki docs on how to compile from the source code on Linux. I got it to compile and somehow it actually runs, provided I don’t have X running. However, whenever it runs I get an error that the audio device driver fails to initialize. The only audio driver listed as available when I type “./retroarch --features” is oss, which I never installed, and apt-get is not able to identify.

I am running freshly installed and updated Raspbian on the Pi2, and it came with alsa as the default sound driver instead of oss.

How can I make retroarch recognize the alsa driver, and why does it say I have oss instead?

If this is too vague or more specific information is necessary, please say so! My roommate has been giving me advice up until now, but he avoids messing with sound drivers in linux, as he stated the topic is a “fustercluck”. Any advice would be appreciated!

Ha, yeah, it is a clusterfuck. Where did you get your RetroArch package? I take it you didn’t compile it yourself…?

I did compile it myself on the Raspberry Pi. I felt like doing this the hard way, as a learning experience. I followed the steps from https://github.com/libretro/RetroArch/wiki/Compilation-guide-(Linux) and compiled all the cores and retroarch.

to update, I just figured out figured out that to configure for the alsa driver, you need to have libasound2-dev installed. I re-compiled after having installed that and sound works now. Next problem is that when sound is enabled using alsathread as the audio driver, at the least the CatSFC core becomes unplayably slow. I don’t suppose you would have any advice on how to optimize performance?

Take a look here: Satisfying dependencies under Ubuntu 14.04

Probably the dependencies are similar.

Update: I went through the list of dependencies listed in that tutorial and installed them all on the pi. About half of them were already installed, but the others were not. The newly compiled retroarch is now even able to launch while X is started (which is nice, but im thinking a bad idea on something with so little power as a pi). It takes several seconds for it to launch, but once loaded, retroarch using RGUI or XMB is pretty snappy. Now (regardless of whether or not the desktop environment is running) the moment I try to launch any file using any core it makes it far enough to say “loading such and such…” but just sits there. On each attempt to run a file, I assumed that either the pi had frozen or there was some error I cannot investigate after waiting 5 minutes and rebooted.

I’m thinking that the next step now that I have (almost) all the drivers and settings available would be to try various settings in the config, but I’m not convinced entirely. If this doesn’t work, then I have a lot of reading up to do on compiling and flags and what my options are.

I use this for ARM build (tested only in Ubuntu, Odroid U3 and C1):


./configure --prefix=/usr --disable-ffmpeg --disable-vg --disable-cg --enable-gles --enable-neon --enable-floathard

ffmpeg and vg flags are due incompatibilities in ubuntu packages.

Immediately after compiling with those flags, Retroarch was able to load a sega genesis game successfully, and playably, but audio was still just a little sluggish. I went to try again using a gameboy color emulator instead and then every game I’ve tried since then goes right back to stalling indefinitely on start.

I’ve been caught up in other studies as well lately, so I’m thinking I’ll continue to mess around with this, but not actively. I’ll really just leave getting retroarch up and running on the Pi 2 to the pros over in Lakka. Their nightly has the same issue I started with in that it does not play sound, but the pi 2 nightly was last updated around the same time the pi 2 was announced. If sound there continues to be a problem, I should post a new thread in the lakka TV section, right?

WOW this needs to be mentioned. I have made only 2 changes since my last post in that I have moved the pi to a newer HDMI computer monitor instead of my old tv(still HDMI), and I switched to using the rgui menu instead of xmb. I don’t know how either of those could have made such a huge difference, but now I am able to play cave story and MegaMan X at full speed with no lag whatsoever. The sound is perfect now.

Is there anything I can do to find out and document what made the improvement? I’d love to contribute to retroarch.

Try troubleshooting those two options to figure out which one made the difference. Switch back to XMB while using your monitor, then switch back to RGUI and see if it gains/loses performance when you do. Then, do the same steps connected to your TV. That should tell you definitively whether one or both of those changes did the trick.