Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

  • I'd been using Recalbox for a while, but this past weekend I decided to give Retropie a whirl. Overall I am VERY pleased with it, but there's just one hurdle I can't get past. In certain emulators, I am hearing audio errors: cracks, pops, glitches. They happen randomly, sometimes in rapid succession, other times 30 seconds apart. Games I have noticed this in:

    SNES

    • Actraiser
    • Super Metroid (especially noticeable at title screen)

    Game Boy Advance

    • Metroid Fusion
    • Metroid: Zero Mission

    Commodore 64

    • Last Ninja 2

    Mind you I haven't tested a lot of games because as soon as I realized it was happening across multiple systems, I ruled out the idea that it was a given emulator.

    There are systems where I haven't noticed it: Turbo Grafx 16, MAME, NES, PlayStation.

    I am reasonably experienced with Retroarch, having used it for several years on PC. Typically if this issue came up for me in the past, I would let the Estimated Refresh Rate in video settings gather samples for a couple of minutes, and then set it. On my PC it would usually settle between 59.999 and 60.002 Hz. The same behaviour is happening on my tv, but I find that if I keep it at the default 59.940 or change it to a different number, the problem persists.

    This is a fresh install of Retropie so not a lot of settings have been changed. I've disabled threaded video in Retroarch settings because in the past I've found this to introduce video stutter and eliminate audio issues, but even with it on I still get glitches (but smooth video). I'm wondering if threaded video even works in this version of Retroarch? (1.6.7)

    I've tried setting the audio driver to everything available, and also changing it in the cfg file to 44100 and sdl. No dice. I've tried lowering the output resolution. Still nothing. I've swapped out my power supply. I've done pretty much everything listed here: https://github.com/RetroPie/RetroPie-Setup/wiki/Sound-Issues

    Hoping someone might be able to help me troubleshoot this, because I am SO close to having my setup be perfect for me. Compatibility for games - particularly MAME games - seems to be far greater than with Recalbox, so I want to keep a Retropie setup, but I wasn't having these issues with Recalbox. Can't figure out why.

    Thanks for any help!

    Relevant info:
    Pi Model or other hardware: Raspberry Pi 3 model B
    Power Supply used: Initially psu that came with Canakit bundle, and now Northpada from Amazon with on/off switch
    RetroPie Version Used: 4.3
    Built From: Pre made SD Image on RetroPie website
    USB Devices connected: Remote control usb adapter, Mayflash Wii U Pro controller wireless adapter
    Controller used: Wii U Pro Controller
    TV: Sony Bravia KDL46NX720


  • @dickhams have you tried a different hdmi cable? That fixes a lot of audio issues.


  • @dickhams have you tried these games in recalbox? If you are using the standalone c64 vice emulator the audio issues are probably in the emulator and its settings. In lr-vice i havent had the audio issues. Its possible that the roms or emulators you are using have issues.


  • Do you get low voltage warnings? Adding switches usually does that. Low voltage and/or high temps will cause games to throttle and have some audio problems.

    pi3b oc'd to 1.3ghz using official pi 2.5a ac adapter, no problems with those snes games.


  • Do you have audio sync set to on?


  • Tried different hdmi cable. The games seemed to work fine in Recalbox. I've never had low voltage warnings. Audio sync is on. I'm also using whatever default emulators Retropie uses, although I did some testing with Super Metroid and the 2002 snes emulator and it seemed to go away, but the overall quality was awful. I'd rather deal with the occasional sound glitch.


  • @dickhams try the things in here


  • @rbaker said in Audio cracks/pops/glitches in Retropie 4.3:

    @dickhams try the things in here

    Yep, mentioned in the op.


  • Could someone please do me a favour? Could you disable threaded video and see if you get any of the audio issues mentioned in this thread? Particularly with the games I mentioned, if possible. I realize this setting is likely the culprit but having it on lead to inconsistent frame rates. Is it possible you just can't have good audio and video simultaneously?

    PS I did a fresh install last night and only changed the threaded video setting to off, and the problem was there. So everything else is now default.


  • @DickHams a few questions:

    • when you have it set to "on" are you saying you don't experience the problem?
    • what downside do you get from using "threaded video"?
    • have you tried changing the default emulator for those particular ROMs? In some SNES games I did experience audio slowdown -- which resulted in crackles and such -- especially when the more intense mode 7 effects would be on display. I noticed that changing the emulator I was using for that particular ROM would sometimes help, so trying that out can be an option for the SNES.

    The audio will start to crackle when you have Audio Sync set to ON (which I do like to have) but the framerate can't hold up for some reason. It will then delay the audio to match the lower framerate, and that's where you get those audio "glitches" as you call them.

    Of course, setting it to OFF brings a whole set of different issues, so my best recommendation is to try to find an emulator that works better (i.e. faster) for those particular ROMs, if that's an option. I don't fully get why you need to disable Threaded Video as I believe it does help speed up the performance, which helps for these issues.

    In my experience, these recommendations for RetroArch cores from the wiki have helped, with no real noticeable issues:

    Edit /opt/retropie/configs/all/retroarch.cfg and set:

    # Use threaded video driver
    video_threaded = true
    
    # Smoothens picture with bilinear filtering
    video_smooth = false
    
    # Audio driver backend.
    audio_driver = alsathread
    
    # Enable rewinding
    rewind_enable = false
    

    Edit: also, are you using any shaders?


  • @pjft said in Audio cracks/pops/glitches in Retropie 4.3:

    @DickHams a few questions:

    • when you have it set to "on" are you saying you don't experience the problem?
    • what downside do you get from using "threaded video"?
    • have you tried changing the default emulator for those particular ROMs? In some SNES games I did experience audio slowdown -- which resulted in crackles and such -- especially when the more intense mode 7 effects would be on display. I noticed that changing the emulator I was using for that particular ROM would sometimes help, so trying that out can be an option for the SNES.

    The audio will start to crackle when you have Audio Sync set to ON (which I do like to have) but the framerate can't hold up for some reason. It will then delay the audio to match the lower framerate, and that's where you get those audio "glitches" as you call them.

    Of course, setting it to OFF brings a whole set of different issues, so my best recommendation is to try to find an emulator that works better (i.e. faster) for those particular ROMs, if that's an option. I don't fully get why you need to disable Threaded Video as I believe it does help speed up the performance, which helps for these issues.

    In my experience, these recommendations for RetroArch cores from the wiki have helped, with no real noticeable issues:

    Edit /opt/retropie/configs/all/retroarch.cfg and set:

    # Use threaded video driver
    video_threaded = true
    
    # Smoothens picture with bilinear filtering
    video_smooth = false
    
    # Audio driver backend.
    audio_driver = alsathread
    
    # Enable rewinding
    rewind_enable = false
    

    Edit: also, are you using any shaders?

    Threaded video always gives me inconsistent frame rates. I've noticed this behaviour in the past when trying to use Retroarch on my phone, and it's the same here. A good test I use for this is the game Friday the 13th on NES. With threaded video on, I can clearly see the frame rate getting jumpy while walking. When I disable it, my video performance is always solid across the board, but then audio begins to suffer.

    I tried using some different emulators last night actually. Snex9x2002 seems to eliminate the issue, but the emulation itself is very inaccurate. Not worth the trade off. 2005 was slightly more accurate but still not great and the audio issues are present here.

    I do not have any shaders on, and I also have integer scale on if that makes any difference.


  • @dickhams Huh, I see.

    I honestly can't really say much about frame rate inconsistency, but you might be right. I'm not a stickler for exactly 60fps (though I do notice quite easily if a game's performance isn't what it's meant to be), so that's my baseline I suppose.

    I can't say I have experimented a lot with that setting - I used to have it off, and then after reading this document I turned it on and it seems to have better performance, but nothing really factual from my end.

    I do imagine that your audio suffers because, for some reason, the game is running slower than intended, but without actually experiencing it myself I can't comment more on what's happening, apologies.

    I was asking about shaders as they might be taxing your CPU slightly more than ideal and as such reducing the performance, which would in turn affect the audio.

    If you enable the "Show Framerate" option, what do you experience on each of the scenarios you're describing?


  • Part of what I do for a living involves noticing frame rate inconsistencies, so I am a little more sensitive to it than I imagine most people are. It's admittedly subtle when threaded video is on but it still irks me (moreso than the audio issues I experience).

    I'll try to make note of what the frame rate is actually doing sometime this week with "show framerate" enabled.


  • @dickhams Got it.

    Yeah, I don't expect the Pi to be consistently at 60fps. And, likely, when the audio glitches start, you'll find that it will be likely related to in-game slowdowns.

    I'm surprised, though, that that didn't seem to happen in Recalbox - I thought the emulators were very much the same?

    I'm sorry I don't have a lot more to contribute to here, though I suspect that it is related to in-game speed. Would the Recalbox default setup be slightly overclocked?

    I'm speculating. I don't think that's the case, but throwing it out there. You may also try to briefly overclock your Pi and see if the problems stay the same, just to attempt to check if it is indeed related to speed or not.


  • Super Metroid (especially noticeable at title screen) I still notice this as well. Trying to figure it out. It also happens on my FPGA SNES so it might be an HDMI issue.

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.