RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    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

    lr-PUAE Pi400 CD Audio jumps/mute in 50Hz

    Scheduled Pinned Locked Moved Help and Support
    50hzaudiopuaeskips
    22 Posts 2 Posters 3.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mituM
      mitu Global Moderator @maxbeanz
      last edited by

      @maxbeanz said in lr-PUAE Pi400 CD Audio jumps/mute in 50Hz:

      @mitu Does the makefile look correct to you ? There's no Pi 4 defined and is there supposed to be a -fp-armv8 flag that i've seen other cores use ?

      It's not relevant, RetroPie-Setup sets the proper compilation flags automatically.

      Also, Retroarch is only version 1.8.8. Does the latest version not work on the Pi ?

      1.9.0 has an issue on the Pi3, but it's fixed afterwards. Not sure if affects the emulation though or if the core needs a newer version.

      1 Reply Last reply Reply Quote 0
      • maxbeanzM
        maxbeanz
        last edited by maxbeanz

        @mitu
        The runcommand log -

        Parameters: 
        Executing: SDL_VIDEO_KMSDRM_CRTCID=87 SDL_VIDEO_KMSDRM_MODEID=6 /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-puae/puae_libretro.so --config /opt/retropie/configs/amiga/retroarch.cfg "/home/pi/RetroPie/roms/amigacd32/Pinball Fantasies (21st Century Entertainment).chd" --appendconfig /dev/shm/retroarch.cfg
        

        the retroarch log -
        https://pastebin.com/xAurTpig

        What does CRTCID=87 mean in that runcommand ? I'm using a TV with HDMI.

        I assume it could only be the 'alsa' sound drivers ? Is there a way to go back to how it was on the Pi 3 ?

        mituM 1 Reply Last reply Reply Quote 0
        • mituM
          mitu Global Moderator @maxbeanz
          last edited by mitu

          @maxbeanz said in lr-PUAE Pi400 CD Audio jumps/mute in 50Hz:

          the retroarch log -
          https://pastebin.com/xAurTpig

          The log shows some errors reading for chd file - maybe they are not properly supported or not correctly created.

          What does CRTCID=87 mean in that runcommand ? I'm using a TV with HDMI.

          It's an internal DRM ID, used for setting the resolution.

          I assume it could only be the 'alsa' sound drivers ? Is there a way to go back to how it was on the Pi 3 ?

          Why is that ? If other (non-50hz) games are working fine, then the sound (and alsa) is fine. Pi3 uses also alsa, I'm not sure what you mean by 'like it was on the Pi3' - did these games work(ed) on a Pi3 with lr-puae ?

          maxbeanzM 1 Reply Last reply Reply Quote 0
          • maxbeanzM
            maxbeanz @mitu
            last edited by maxbeanz

            @mitu
            I asked the dev about those 'PG missing sector: LBA 2208, trklog 2208' and he said it was nothing to worry about. The sound also mutes (for a fraction of a second) whenever the PUAE core changes the resolution on any game (ADF,LHA etc.)

            It only seems to happen when the TV is at 50Hz (in PUAE). I tried a MegaCD PAL game on lr-genesisgx in 50Hz and it sounds fine. This is why it made me think the makefile was missing something.

            1 Reply Last reply Reply Quote 0
            • maxbeanzM
              maxbeanz
              last edited by maxbeanz

              Merged

              1 Reply Last reply Reply Quote 0
              • maxbeanzM
                maxbeanz
                last edited by maxbeanz

                @mitu
                I just dug out my old Pi 3 (not plus), installed the latest image.

                This needs updating in the es_systems.cfg -
                Add .chd to the supported extensions.

                I notice that the default Retroarch Audio driver on the Pi 3 is 'Alsathread'.

                On the Pi 400 it's just 'Alsa'. This makes the CD Audio jump/mute. Why has the Pi400 been set differently ?

                mituM 1 Reply Last reply Reply Quote 0
                • mituM
                  mitu Global Moderator @maxbeanz
                  last edited by

                  @maxbeanz said in lr-PUAE Pi400 CD Audio jumps/mute in 50Hz:

                  On the Pi 400 it's just 'Alsa'. This makes the CD Audio jump/mute. Why has the Pi400 been set differently ?

                  I don't think it's ALSA - my guess is that the resolution change doesn't actually switch to a 50hz mode or the core tries to change the resolution to something else and the audio/video sync is broken, hence the audio jumps:

                  [INFO] [Video]: Average monitor Hz: 49.992501 Hz. (4.532 % frame time deviation, based on 2048 last samples).

                  Your verbose log is truncated, so I can't say which resolution is set up in RetroArch - can you re-upload the full log ?

                  maxbeanzM 1 Reply Last reply Reply Quote 0
                  • maxbeanzM
                    maxbeanz @mitu
                    last edited by maxbeanz

                    @mitu How do I do a full log ? I selected '0 Debug' in Retroarch.

                    And the thing is, if I change the audio driver to 'alsathread' (which is how it's set by default on the Pi 3) or 'sdl2' then it doesn't jump/mute randomly but still doesn't sound quite right.

                    Are you thinking this could be related to the audio skewing option ?

                    1 Reply Last reply Reply Quote 0
                    • mituM
                      mitu Global Moderator
                      last edited by

                      @maxbeanz said in lr-PUAE Pi400 CD Audio jumps/mute in 50Hz:

                      How do I do a full log ? I selected '0 Debug' in Retroarch.

                      See https://retropie.org.uk/docs/Runcommand/#launch-with-verbose-logging

                      maxbeanzM 2 Replies Last reply Reply Quote 0
                      • maxbeanzM
                        maxbeanz @mitu
                        last edited by

                        @mitu Here it is -
                        https://pastebin.com/WbCPkxdm

                        1 Reply Last reply Reply Quote 0
                        • maxbeanzM
                          maxbeanz @mitu
                          last edited by

                          @mitu No ideas then ?

                          1 Reply Last reply Reply Quote 0
                          • mituM
                            mitu Global Moderator
                            last edited by

                            I haven't got to test the game on a 50hz display, just ran it normally (at @60hz) and the music seems fine to me - the intro plays without any skips or stutters. Did you try doing the same - just run the game without any special resolution set-up ?

                            maxbeanzM 1 Reply Last reply Reply Quote 0
                            • maxbeanzM
                              maxbeanz @mitu
                              last edited by maxbeanz

                              @mitu Yeah, as I said in my first post, it doesn't happen at 60Hz. (And also doesn't happen if you set the audio driver to anything but 'alsa').

                              1 Reply Last reply Reply Quote 0
                              • mituM
                                mitu Global Moderator
                                last edited by

                                I managed to reproduce the issue on a 50hz resolution and it's strange that it only happens with alsa. Switching to alsathread as audio driver (you can do that from the configuration editor) fixes this.
                                I don't know well enough how RetroArch configured both drivers and which parameters affect how they're configured, it looks like the threaded ALSA driver has a shorter buffer and may synchronize the audio better (?):

                                • with alsathread

                                  [INFO] ALSA: Using signed 16-bit format.
                                  [INFO] ALSA: Period size: 480 frames
                                  [INFO] ALSA: Buffer size: 1536 frames

                                • with alsa

                                  [INFO] [ALSA]: Using signed 16-bit format.
                                  [INFO] [ALSA]: Period size: 768 frames
                                  [INFO] [ALSA]: Buffer size: 3072 frames

                                maxbeanzM 1 Reply Last reply Reply Quote 0
                                • maxbeanzM
                                  maxbeanz @mitu
                                  last edited by maxbeanz

                                  @mitu Thanks for confirming, now we know that it's a problem with Raspberry Pi. As I said, it's weird how a clean install on a Pi 3 sets it as 'alsathread' but the Pi 4/400 sets it as 'alsa' ('sdl2' also works better than 'alsa'). The CD audio still doesn't sound clean in 'alsathread' (like it does at 60Hz). Have you also noticed that the audio quickly mutes whenever the core changes the resolution ? This seems to only happen on the RPi too (can be quite annoying when watching demos that switch res a lot).

                                  I tried Android at 50Hz and it sounds fine, (Android uses 'opensl').

                                  I take it this is a problem that will never be fixed ? Is it RetroPie or Raspian ?

                                  mituM 1 Reply Last reply Reply Quote 0
                                  • mituM
                                    mitu Global Moderator @maxbeanz
                                    last edited by mitu

                                    @maxbeanz said in lr-PUAE Pi400 CD Audio jumps/mute in 50Hz:

                                    Have you also noticed that the audio quickly mutes whenever the core changes the resolution ?

                                    Yes, but I expect this to happen with emulation, since probably the emulator needs to re-calibrate and re-sync the audio to the video.

                                    it's weird how a clean install on a Pi 3 sets it as 'alsathread'

                                    Not sure which version of RetroPie you're installing, but alsathread is not explicitly set as default anywhere in the latest version, regardless of Pi version. Could be that RetroArch chooses it as best at runtime.

                                    I take it this is a problem that will never be fixed ? Is it RetroPie or Raspian ?

                                    Given that I don't know why the issue occurs, I can't say.

                                    maxbeanzM 1 Reply Last reply Reply Quote 0
                                    • maxbeanzM
                                      maxbeanz @mitu
                                      last edited by

                                      @mitu said in lr-PUAE Pi400 CD Audio jumps/mute in 50Hz:

                                      @maxbeanz said in lr-PUAE Pi400 CD Audio jumps/mute in 50Hz:

                                      Have you also noticed that the audio quickly mutes whenever the core changes the resolution ?

                                      Yes, but I expect this to happen with emulation, since probably the emulator needs to re-calibrate and re-sync the audio to the video.

                                      It only seems to happen on Raspberry Pi, i've tried Android and PC and they don't do it. The Android device I tried was a Firestick 4K which is a lot slower than a Pi 400.

                                      it's weird how a clean install on a Pi 3 sets it as 'alsathread'

                                      Not sure which version of RetroPie you're installing, but alsathread is not explicitly set as default anywhere in the latest version, regardless of Pi version. Could be that RetroArch chooses it as best at runtime.

                                      I installed a clean version to my old Pi 3 from the Retropie Downloads section. The first thing I did was look at the audio section in Retroarch, it said 'alsathread'.

                                      So to sum up, this whole thread was a pointless report and looks like we're stuck with it !

                                      1 Reply Last reply Reply Quote 0
                                      • First post
                                        Last post

                                      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.