PulseAudio unable to connect; poor emulator performance issues and menu crashes.
-
Hello! I've encountered an issue with Pulse audio that results in poor emulator performance in both framerate and audio. The performance gets worse with more demanding consoles as well, for instance on N64 and PS1. It's still noticeable in consoles like SNES though. Additionally, I'm having crashes in the menus of Emulation Station that seem to be related. I wasn't able to find my exact issue documented, so I was hoping someone more experienced with this would be able to help me fix the problem more easily and quickly than I would on my own.
I'm running a Raspberry Pi 4 Model B with 4 gigabytes of RAM, an official Raspberry Pi power supply, and I have version 4.7.16 of RetroPie currently.
So, here are the error messages I get when booting a game:
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused Oct 10 14:58:59 lvl0: VolumeControl::init() - Failed to attach default card! ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused Oct 10 14:59:04 lvl0: AudioManager Error - Unable to open SDL audio: ALSA: Couldn't open audio device: Connection refused
Prior to receiving these errors, my emulation performance was good. My guess is that the errors are what's causing the issues that I'm experiencing in terms of performance, especially with N64 (as I know that didn't have a dedicated sound chip and all, so emulating the audio is likely much more taxing without whatever's missing lol.) The audio will stutter very badly and pretty consistently in N64 emulation, and the framerate of the games will slow to a crawl that renders them unplayable. Even some graphical errors occur that weren't there prior. PS1 is fine in terms of framerate and performance, but has its hiccups. I've not tested arcade systems. SNES will occasionally have audio cutting out, or frame drops in more demanding games like Yoshi's Island or Donkey Kong Country.
In addition to that, I have been getting issues with the Emulation Station menu crashing prior to booting a game. It only happens when the menus are set to video mode (where it'll play a small video preview of whatever game is highlighted) and it only crashes when you boot into any game other than the first one you launched after starting the Raspberry Pi. The menu fade-out transition before booting will begin, and then just hang partway through. This issue also didn't occur before these errors.
Some additional info: Unfortunately, it was a while ago when this began, so I don't remember how to recreate the issue, what I changed with the audio, and so on. I think Pulse audio got deleted for some weird reason and then I had to reinstall it?? I didn't have a system backup at the time. Reinstalling Pulse and updating all of my software a couple of months ago didn't help either. I have videos of the performance issues if it'd help.
If you need any further information, let me know. Any advice on the steps to take or possible fixes would help a lot. Thank you! :)
-
Any particular reason you need pulse audio in the first place? It's not normally installed in the default RetroPie image and while it does come packaged with something if you choose to install the desktop, you might notice the menu item directly beneath that is "Remove some unneeded packages (pulseaudio / cups / wolfram)". In the script module, that option has the comment "
# remove PulseAudio since this is slowing down the whole system significantly. Cups is also not needed
".If you don't need pulse audio for any specific reason, you might remove it and see if your issues clear up. You can do this through raspbiantools in the configuration editor, or enter the commands manually (this is all the script would do):
sudo apt-get remove -y pulseaudio cups wolfram-engine sonic-pi sudo apt-get -y autoremove
The first command removes the packages and the second one cleans up dependency packages that are no longer needed.
-
@sleve_mcdichael Oh heck, I had been working under the assumption that it was necessary for some reason! I followed the instructions you listed to remove it successfully.
Unfortunately, the issue remains unchanged, so I must have made the thread in error! Too bad correlation wasn't causation lol. I'll have to dig deeper elsewhere it seems, as I'm not sure what could be causing the issue if the emulator was reinstalled and reset to default settings already, and it didn't relate to my guess either.
-
@babyboodle said in PulseAudio unable to connect; poor emulator performance issues and menu crashes.:
reset to default settings
If you have reset RetroArch to default settings in the RGUI and then saved the config you have probably set non ideal defaults. Our defaults are not the same as the RetroArch defaults. You should remove
/opt/retropie/configs/all/retroarch.cfg
and reinstall retroarch from "Manage Packages/Core Packages"
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.