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

    Audio issue when streaming to twitch

    Scheduled Pinned Locked Moved Help and Support
    audiotwitchstreaming
    25 Posts 2 Posters 1.6k 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
      last edited by

      @yooodt said in Audio issue when streaming to twitch:

      Ah I see. I am not sure of the original image. Would there be a log file anywhere I could access which details which versions I've had?

      Any update is logged in $HOME/RetroPie-Setup/logs, you can take a look at the last update logs and it should show the RetroPie version at the beginning of the log file.

      Y 1 Reply Last reply Reply Quote 0
      • Y
        yooodt @mitu
        last edited by

        @mitu at the top of the log:

        RetroPie-Setup version: 4.8.2 (b11c10a0)
        System: rpi3 (armv7l) - Raspbian GNU/Linux 10 (buster) - Linux retropie 5.10.103-v7+ #1529 SMP Tue Mar 8 12:21:37 GMT 2022 armv7l GNU/Linux
        Update is available - updating ...

        What do you think about when I changed the 'audio latency' in the in-game retroarch menu, the sound goes perfect. If I refresh my twitch stream it seems like it actually keeps working.

        Is this a good clue I wonder?!

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

          @yooodt said in Audio issue when streaming to twitch:

          RetroPie-Setup version: 4.8.2 (b11c10a0)

          This is the latest version, it's not the update that added the new RetroArch version, it's probably in a previous log file.

          What do you think about when I changed the 'audio latency' in the in-game retroarch menu, the sound goes perfect. If I refresh my twitch stream it seems like it actually keeps working.

          If it works fine, then keep the option. Out of curiosity, does the issue occur with the mGBA core, while playing a GBA game (without the change to audio latency) ?

          Y 4 Replies Last reply Reply Quote 0
          • Y
            yooodt @mitu
            last edited by

            @mitu I'll look at the others.

            The setting works when I change it. But then when I load the game again its broken until I change the latency setting to something else again. So odd! Maybe a janky fix could be to make the emulator run a script which changes the latency by +1 or -1 every time the game starts?

            1 Reply Last reply Reply Quote 0
            • Y
              yooodt @mitu
              last edited by

              @mitu sorry just seen the GBA question. Ill have a go and see!

              1 Reply Last reply Reply Quote 0
              • Y
                yooodt @mitu
                last edited by

                @mitu said in Audio issue when streaming to twitch:

                Out of curiosity, does the issue occur with the mGBA core, while playing a GBA game (without the change to audio latency) ?

                Just went through the motions and yep, same thing! Audio fine on the recording/stream but locally goes horrific

                1 Reply Last reply Reply Quote 0
                • Y
                  yooodt @mitu
                  last edited by

                  @mitu Sorry to keep replying, Im trying to drop information as I find it. A local copy of the Pi log shows:

                  RetroPie-Setup version: 4.4.1 (f671bb39)
                  System: Linux retropie 4.9.80-v7+ #1098 SMP Fri Mar 9 19:11:42 GMT 2018 armv7l GNU/Linux

                  Could I possibly roll back to this?

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

                    @yooodt said in Audio issue when streaming to twitch:

                    @mitu Sorry to keep replying, Im trying to drop information as I find it. A local copy of the Pi log shows:
                    RetroPie-Setup version: 4.4.1 (f671bb39)
                    System: Linux retropie 4.9.80-v7+ #1098 SMP Fri Mar 9 19:11:42 GMT 2018 armv7l GNU/Linux

                    Hm, that's a little strange, since 4.4 was released 4 years ago, using Raspbian Stretch, which doesn't receive updates any longer. Also, your OS is based on buster, which suggests you've either copied the logs or upgraded the OS also. How did you do the upgrade ?

                    To the RetroArch version, 4.4 was using v1.7.1 - which is also quite old. Pinpointing a possible regression to a particular code change is going to be difficult, but if you upgraded in-situ your old 4.4 to buster, then I'd suggest you first try to reproduce the issue on a clean image.

                    Y 1 Reply Last reply Reply Quote 0
                    • Y
                      yooodt @mitu
                      last edited by

                      @mitu ah I see. Perhaps this local copy isn't thr one I started with. Might be an old backup of an early experiment.

                      This said I did do a rollback and the problem still persisted. On yours, have you tried the latency change mid game to stop the glitching? Be interested to know if the fix is specific to me or if it works on all. This would help me work out if its something I need to fix locally or wait for a RP update.

                      If I went down the clean install route, is it as simple as deleting the pie directory? Or is there a command line to do this? Thank you so much for your help

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

                        @mitu ah I see. Perhaps this local copy isn't thr one I started with. Might be an old backup of an early experiment.

                        Not sure what you mean - is the log fragment (with version 4.4) from your current 4.8 system ? (where you have the problem)

                        This said I did do a rollback and the problem still persisted.

                        How exactly did you do the rollback ? Did you install an earlier backup - from before the update ?

                        On yours, have you tried the latency change mid game to stop the glitching? Be interested to know if the fix is specific to me or if it works on all. This would help me work out if its something I need to fix locally or wait for a RP update.

                        I haven't tried yet - is this in the Audio settings menu ? Note that I just tried the Record function, since I don't have any streaming account (Twitch or otherwise). What I've noticed is that the lr-snes9x core doesn't have the issue, though a slight audio cracking appears periodically.

                        If I went down the clean install route, is it as simple as deleting the pie directory? Or is there a command line to do this? Thank you so much for your help

                        No, I was suggesting just to try with a clean image installation - from the latest RetroPie Pi3 image - without any updates. This eliminates any problems caused by an OS upgrade (held libraries, incompatible configs, etc.) If the issue doesn't occur on a clean image, then try a Retropie update, which should install the latest RetroArch and you can re-test to see if the issue occurs after this version upgrade.

                        Y 1 Reply Last reply Reply Quote 0
                        • Y
                          yooodt @mitu
                          last edited by

                          @mitu said in Audio issue when streaming to twitch:

                          @mitu ah I see. Perhaps this local copy isn't thr one I started with. Might be an old backup of an early experiment.
                          

                          Not sure what you mean - is the log fragment (with version 4.4) from your current 4.8 system ? (where you have the problem)

                          On a separate disk I have a backup of my emulators etc. All the log files on the actual pi seemed to say 4.8 from current system so I thought perhaps the one i located may have been where I started from.

                          This said I did do a rollback and the problem still persisted.

                          How exactly did you do the rollback ? Did you install an earlier backup - from before the update ?

                          I ran some code from an earlier forum post but changed the hex to the one I saw in the log file which I think made it install the older version. On my phone so can't quote the exact text.

                          On yours, have you tried the latency change mid game to stop the glitching? Be interested to know if the fix is specific to me or if it works on all. This would help me work out if its something I need to fix locally or wait for a RP update.

                          I haven't tried yet - is this in the Audio settings menu ? Note that I just tried the Record function, since I don't have any streaming account (Twitch or otherwise). What I've noticed is that the lr-snes9x core doesn't have the issue, though a slight audio cracking appears periodically.

                          It's on the main menu under 'options' I think, it says latency as a menu header. I access it mid game by holding my menu (ps) button and pressing triangle although this won't mean much unless you're also using a ps3 controller!

                          If I went down the clean install route, is it as simple as deleting the pie directory? Or is there a command line to do this? Thank you so much for your help

                          No, I was suggesting just to try with a clean image installation - from the latest RetroPie Pi3 image - without any updates. This eliminates any problems caused by an OS upgrade (held libraries, incompatible configs, etc.) If the issue doesn't occur on a clean image, then try a Retropie update, which should install the latest RetroArch and you can re-test to see if the issue occurs after this version upgrade.

                          As in wipe the whole sd card and put a clean image of retropie on? I may try this even if this isn't what you mean as I have all my files backed up anyway!

                          Thanks

                          1 Reply Last reply Reply Quote 0
                          • Y
                            yooodt
                            last edited by

                            @mitu
                            update
                            I've completely re-imaged the SD card with the image from rasperry pi imager, I selected the option to install retropie as well from the menu.

                            Dropped my Nes test roms on, added the twitch.cfg file (code below)

                            vcodec = libx264
                            acodec = libshine
                            pix_fmt = yuv420p
                            threads = 2
                            scale_factor = 1
                            format = flv
                            
                            video_preset = ultrafast
                            video_profile = main
                            video_tune = animation
                            video_bufsize = 512k
                            video_minrate = 512k
                            video_maxrate = 512k
                            video_r = 60
                            video_g = 120
                            video_keyint_min = 60
                            
                            sample_rate = 44100
                            audio_preset = aac_he_v2
                            audio_global_quality = 1
                            

                            and my emulators.cfg file is as follows:

                            lr-fbneo-nes = "/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-fbneo/fbneo_libretro.so --subsystem nes --config /opt/retropie/configs/nes/retroarch.cfg %ROM%"
                            lr-fceumm = "/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-fceumm/fceumm_libretro.so --config /opt/retropie/configs/nes/retroarch.cfg %ROM%"
                            default = "lr-fceumm"
                            lr-nestopia = "/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-nestopia/nestopia_libretro.so --config /opt/retropie/configs/nes/retroarch.cfg %ROM%"
                            lr-quicknes = "/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-quicknes/quicknes_libretro.so --config /opt/retropie/configs/nes/retroarch.cfg %ROM%"
                            lr-fceumm-record-twitch = "/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-fceumm/fceumm_libretro.so --config /opt/retropie/configs/nes/retroarch.cfg --recordconfig /home/pi/RetroPie/recording/twitch.cfg --record rtmp://live.
                            /live my key hidden --recordconfig /home/pi/RetroPie/recording/twitch.cfg %ROM%"

                            The game audio is perfect but as soon as I use the twitch emulator version, it goes horrific locally. Same as before!

                            Does this code make my audio codec both locally AND on the stream 'libshine'? I wonder if its as simple as changing this.

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

                              @yooodt said in Audio issue when streaming to twitch:

                              Does this code make my audio codec both locally AND on the stream 'libshine'? I wonder if its as simple as changing this.

                              I don't think that matters, I've tested with another codec (libmp3lame instead of libshine) and it's the same behavior.
                              Changing the Audio Latency from the menu, does indeed fix the broken audio (after recording). My guess is that RetroArch simply re-initializes the audio because of that change and this fixes the local output, the value set through the options doesn't matter. It's not a matter of changing the default value - it's the process of changing the value mid-recording that's fixing it.

                              I also tested using the latest RetroArch release and it seems the issue doesn't occur, I suppose it may have been fixed with some recent changes so that's a good thing.

                              Y 1 Reply Last reply Reply Quote 0
                              • Y
                                yooodt @mitu
                                last edited by

                                @mitu so I should run the latest update now? Which method shall I use to update?

                                Thanks for all your help with this.

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

                                  @yooodt said in Audio issue when streaming to twitch:

                                  @mitu so I should run the latest update now? Which method shall I use to update?

                                  RetroPie doesn't always have the latest version of RetroArch included, updating from RetroPie will get you v1.10.0, the latest - upstream - version is v1.10.3. I didn't test with v1.10.3, but with the latest source code from Github.

                                  You'll have to wait until RetroPie adds v1.10.3 and then update as normal from RetroPie-Setup to validate you don't have the issue.
                                  I guess there's one more reason to add v1.10.3 in RetroPie.

                                  Y 1 Reply Last reply Reply Quote 0
                                  • Y
                                    yooodt @mitu
                                    last edited by

                                    @mitu Is there a way I can add the latest retroarch without waiting for it to be added to retropie? I can ssh into it so if theres a cmd line way of doing it, great

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

                                      @yooodt If you want to test things, then follow the instructions from
                                      https://retropie.org.uk/forum/topic/33047/updating-retroarch-to-1-10-3.

                                      Y 1 Reply Last reply Reply Quote 0
                                      • Y
                                        yooodt @mitu
                                        last edited by yooodt

                                        @mitu thank you. here goes!!

                                        Edit - looks a little heavy for me to do right now. I'm going to just run the retropie updater which will put me at 1.10 and patiently wait for the new RA t to be added

                                        1 Reply Last reply Reply Quote 0
                                        • Y yooodt referenced this topic on
                                        • 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.