N64 Audio (A partial fix)
-
So I am sure that everyone is aware that N64 emulation on the Pi is not perfect. For myself, I can handle some slowdown in games as long as the audio keeps playing. Something I noticed with standalone mupen64 on the pi is that when the frame rate drops, the audio will completely drop out as well and there are sometimes long stretches where there is no sound until the FPS goes back up. I found this to be very annoying especially if there was a voice-over playing, I could end up missing something important.
So after doing some research I found that there are two main audio plugin options that mupen64 on the Pi uses. SDL audio and OMX audio. OMX seems to be the default plugin that is currently used, however OMX is apparently not compatible with save states and Mupen64 crashes every time I try to load state. OMX is also insanely loud, much louder than all the other emulators on the pi and I am forced to turn down the volume every time I play N64. OMX also seems to be the culprit when the audio drops out during lag. On a faster machine I am sure this isnt a problem but on the Pi we sometimes have to use stop gap measures and use work arounds to get N64 to work better. So I found that changing the audio plugin to SDL was a much better experience.
I did this by editing the file located at:
/opt/retropie/configs/all/autoconf.cfg
And changing:
mupen64plus_audio = "1"
to
mupen64plus_audio = "0"
Mupen64 will now default to using the SDL audio plugin. This will allow save states to work properly and the volume is set to a much more reasonable level.
One thing I noticed though with SDL audio is that the audio crackles. I saw reports of this on several threads here on the forum but with no solution listed. So I set about changing settings until I could figure out what was causing it. I finally figured out that if you change the default audio re-sampling algorithm you can get rid of the audio crackle.
That setting can be edited here:
/opt/retropie/configs/n64/mupen64plus.cfg
# Audio resampling algorithm. src-sinc-best-quality, src-sinc-medium-quality, src-sinc-fastest, src-zero-order-hold, src-linear, speex-fixed-{10-0}, trivial RESAMPLE = "speex-fixed-4"
Change to:
# Audio resampling algorithm. src-sinc-best-quality, src-sinc-medium-quality, src-sinc-fastest, src-zero-order-hold, src-linear, speex-fixed-{10-0}, trivial RESAMPLE = "src-sinc-fastest"
This took care of the audio crackling while using SDL audio. I tested multiple games with this setting and I could not find any ill effects from its use. If anyone knows a better setting or a reason why this should not be used please let me know. Audio will still stutter during gameplay during laggy scenes when using SDL but I found this to be much preferable to OMX where the audio will completely drop out.
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.