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

    RetroFlag with CM4 no audio

    Scheduled Pinned Locked Moved Help and Support
    retroflagcm4compute moduleaudio
    22 Posts 3 Posters 2.2k 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.
    • R
      rasp_renegade
      last edited by

      After all the struggles to get this working, I have yet to get any audio. The case is okay, confirmed since at first as I installed RecallBox and heard it. Quickly wiped it because I didnt like that OS at all. Waited to get a USB-C adapter so I could try the following steps, but still no luck.

      /usr/share/alsa/alsa.conf
      change the following two lines from:
      defaults.ctl.card 0
      defaults.pcm.card 0
      to
      defaults.ctl.card 1
      defaults.pcm.card 1

      /boot/config.txt

      changed
      from dtparam=audio=off
      to dtparam=audio=on

      Now I am not entirely sure what the sound settings in EmulationStation are supposed to be since I swapped them around so much

      Specs:
      RetroPie 4.8 (RPI 4/400) through Raspberry Pi Imager v1.72
      CM4 #CM4108032

      G 1 Reply Last reply Reply Quote 0
      • G
        G30FF @rasp_renegade
        last edited by

        @rasp_renegade Did you install the safe shutdown script from RetroFlag? The script comes with an alsa configuration file that it installs, along with the updated config.txt files.

        On my GPi Case 2, I use the following sound settings in ES and I get sound:

        Audio Card: Default
        Audio Device: Speaker
        OMX Player Audio Device: ALSA

        I do not get sound on my splash screen video on handheld, but everything else works.

        As an aside, you should consider adding this to your install: https://www.reddit.com/r/retroflag_gpi/comments/c176wg/sound_fix_for_gpi_mono_sound_link_inside/ The onboard sound card in the case is for stereo sound, but only the right channel is wired up, so games with stereo sound will sound wrong without this script.

        R 1 Reply Last reply Reply Quote 0
        • R
          rasp_renegade @G30FF
          last edited by rasp_renegade

          @G30FF said in RetroFlag with CM4 no audio:

          @rasp_renegade Did you install the safe shutdown script from RetroFlag? The script comes with an alsa configuration file that it installs, along with the updated config.txt files.

          On my GPi Case 2, I use the following sound settings in ES and I get sound:

          Audio Card: Default
          Audio Device: Speaker
          OMX Player Audio Device: ALSA

          I do not get sound on my splash screen video on handheld, but everything else works.

          As an aside, you should consider adding this to your install: https://www.reddit.com/r/retroflag_gpi/comments/c176wg/sound_fix_for_gpi_mono_sound_link_inside/ The onboard sound card in the case is for stereo sound, but only the right channel is wired up, so games with stereo sound will sound wrong without this script.

          I went back through the patch and the shutdown script process. Here is how I did it according to the readme file in the GPiCase2-Script-main folder

          -Ran RPIBOOOT
          -Copied GPi_Case2_patch_retropie folder to /boot/
          -Launched in Windows /boot/GPi_Case2_patch_retropie/install.bat
          -From the terminal ran the safe shutdown script
          wget -O - "https://raw.githubusercontent.com/RetroFlag/GPiCase2-Script/main/retropie_install_gpi2.sh" | sudo bash

          -Verified in ES
          Audio Card: Default
          Audio Device: Speaker
          OMX Player Audio Device: ALSA

          Still no sound. Can I have your config.txt?

          G 1 Reply Last reply Reply Quote 0
          • G
            G30FF @rasp_renegade
            last edited by G30FF

            @rasp_renegade I forgot there was one more thing I had to do. The RetroPie image's default audio settings do not work with the GPi case and need to be reset.

            • In the Retroflag config.txt, you'll find a setting dtparam=audio=off. Comment that out and reboot. The config.txt reports that there is no onboard audio, and without this enabled we will not be able to reset the audio settings.
            • Go into the RetroPie's Config menu in ES and select Audio.
            • Select the "Reset to default" option
            • Exit the audio settings menu
            • Edit config.txt and uncomment the dtparam line.
            • Reboot

            That should hopefully do the trick for you.

            R 1 Reply Last reply Reply Quote 0
            • R
              rasp_renegade @G30FF
              last edited by

              @G30FF said in RetroFlag with CM4 no audio:

              @rasp_renegade I forgot there was one more thing I had to do. The RetroPie image's default audio settings do not work with the GPi case and need to be reset.

              • In the Retroflag config.txt, you'll find a setting dtparam=audio=off. Comment that out and reboot. The config.txt reports that there is no onboard audio, and without this enabled we will not be able to reset the audio settings.
              • Go into the RetroPie's Config menu in ES and select Audio.
              • Select the "Reset to default" option
              • Exit the audio settings menu
              • Edit config.txt and uncomment the dtparam line.
              • Reboot

              That should hopefully do the trick for you.

              I deleted dtparam=audio=off from config.txt (confirmed)
              Rebooted and get the following output when selecting Audio in the RetroPie menu inside ES
              1.jpg

              2.jpg

              I get the same results with or without that audio setting in config.txt.
              Is this something I could have done?

              G 1 Reply Last reply Reply Quote 0
              • G
                G30FF @rasp_renegade
                last edited by

                @rasp_renegade Try reverting the changes you made to alsa.conf. Your message specifically says it cannot find card 1.

                R 1 Reply Last reply Reply Quote 0
                • R
                  rasp_renegade @G30FF
                  last edited by

                  @G30FF

                  I reverted the lines in alsa.conf but get the same. The output of errors in the shell have stopped though

                  G 1 Reply Last reply Reply Quote 0
                  • G
                    G30FF @rasp_renegade
                    last edited by G30FF

                    @rasp_renegade Have you tried through the dock? The only other ALSA setting change I've made is this: https://retropie.org.uk/forum/topic/29888/no-sound-in-ports/2?_=1658496742604

                    R 1 Reply Last reply Reply Quote 0
                    • R
                      rasp_renegade @G30FF
                      last edited by

                      @G30FF

                      I created a new file in /home/pi called "alsoftrc". The system will not allow me to name it ".alsoftrc". I have the error still if I got the name right.

                      Yes, audio can be heard when plugged into the dock.

                      G 1 Reply Last reply Reply Quote 0
                      • G
                        G30FF @rasp_renegade
                        last edited by

                        @rasp_renegade You'll need to use vi on the terminal to create the file, because starting a file with a . means it's a hidden file.

                        Can you reset audio settings while it's plugged into the dock?

                        R 1 Reply Last reply Reply Quote 0
                        • R
                          rasp_renegade @G30FF
                          last edited by

                          @G30FF

                          Not sure what happened but I went to try that from the dock, but the pi would not boot "config.txt does not exist". So I ran the patch to get it back, but now I cannot run the safe shutdown script to get back to the dock.

                          See attacked. This keeps scrolling on the screen so I cannot even type or use up arrow to get to the command. How do I make that stop?
                          20220723_150810.jpg

                          G 1 Reply Last reply Reply Quote 0
                          • G
                            G30FF @rasp_renegade
                            last edited by

                            @rasp_renegade I have no idea what you've done here. You might have changed the permissions on the files, or otherwise broken the configuration. Check that the files in /boot are owned by the same user as the rest of the files. Worst case scenario you will need to reinstall RetroPie.

                            R 2 Replies Last reply Reply Quote 0
                            • R
                              rasp_renegade @G30FF
                              last edited by rasp_renegade

                              @G30FF

                              Those errors went away. I was able to set Audio to default from ES, but now I cannot connect to install the shutdown script. "404 not found" when running the command. I am able to ping 8.8.8.8 so I have internet
                              "wget -O - "https://raw.githubusercontent.com/RetroFlag/GPiCase2-Script/main/retropie_install_gpi2.sh" | sudo bash"

                              Fix one thing and another breaks. =/ I will try later since they may have issues on the website. The page loads in a browser on Windows.

                              1 Reply Last reply Reply Quote 0
                              • R
                                rasp_renegade @G30FF
                                last edited by

                                @G30FF

                                Is the safe shutdown script responsible for making the display on the retroflag work? Here is the process I think I followed previously, but no luck this time.

                                1. Install the patch from https://github.com/RetroFlag/GPiCase2-Script/raw/main/GPi_Case2_patch.zip
                                2. Press F4 when docked and run the command for the script, wget -O - "https://raw.githubusercontent.com/RetroFlag/GPiCase2-Script/main/retropie_install_gpi2.sh" | sudo bash

                                The script installed without errors.

                                1 Reply Last reply Reply Quote 0
                                • E
                                  EctoOne
                                  last edited by

                                  As far as I know, the config.txt file from the patch zip makes the screen work. And the safeshutdown script checks if the dock is used or not and then replaces the original config with either the lcd or hdmi variant.

                                  And for me the installation of the shutdown script fixed the audio problem.

                                  Here is what I did (using a different Pi):

                                  • Flashed the image
                                  • Manually copied the three config files to the new boot partition (/boot)
                                  • Started Retropie for the first time and configured WiFi and enabled SSH.
                                  • After an reboot, I used ssh to connect and ran the safeshutdown install command.

                                  Then sound was working for me. I added my own way later to switch between Speaker (Mono) and Headphones (Stereo) later, which was already mentioned somewhere in here. I don't know why you're having so much trouble.

                                  R 1 Reply Last reply Reply Quote 0
                                  • R
                                    rasp_renegade @EctoOne
                                    last edited by

                                    @EctoOne said in RetroFlag with CM4 no audio:

                                    I don't know why you're having so much trouble.

                                    If you were to read my many posts here from over the years you will find that technology hates me. LOL AND Ive been in IT for about 20 years!!!

                                    Thanks, I will review my process and see what I missed. Frustrating when I got the display to work twice before and now nothing.

                                    E 1 Reply Last reply Reply Quote 0
                                    • E
                                      EctoOne @rasp_renegade
                                      last edited by

                                      @rasp_renegade I believe it also matters if you use the dock from the beginning or not. Sadly I personally don't have the dock myself. I only had the chance to get a bundle of the Case and a CM4 a few weeks ago. But since the shutdown script does swap out the different config files, it is kinda necessary to do the initial installation without the dock. But I'm not sure about that and obviously can't test it.

                                      R 1 Reply Last reply Reply Quote 0
                                      • R
                                        rasp_renegade @EctoOne
                                        last edited by

                                        @EctoOne

                                        I must have had the wrong patch somehow. I downloaded again and copied to the boot folder and ran from Windows and got the LCD to work again.

                                        I booted up connected to the dock.
                                        Went to Retropie-Audio from EmulationStation, and selected Reset to default.
                                        Rebooted un-docked.
                                        Returned to Retropie-Audio from EmulationStation and I still get "On-board audio disabled or not present".

                                        I have another retroflag here that I need to return. I verified it also has the same issue. How am I supposed the configure the audio?

                                        E 1 Reply Last reply Reply Quote 0
                                        • E
                                          EctoOne @rasp_renegade
                                          last edited by

                                          @rasp_renegade Hmm, I've only messed around with the sound options before I installed the shutdown script because it had no audio before that.

                                          My current settings are:

                                          • Audio Card = Default
                                          • Audio Device = Speaker
                                          • Navigation and Video Sounds = Off
                                          • OMX Device = Both
                                          R 1 Reply Last reply Reply Quote 0
                                          • R
                                            rasp_renegade @EctoOne
                                            last edited by

                                            @EctoOne

                                            OMG! I reimaged and the same exact thing. Did just the basics as you suggested and in ES under RetroPie-Audio there was the message, "On board audio disabled or not present"

                                            BUT, I played with the settings in ES and selecting Headphones, and the sound works.!!! With or without plugging in the headphones. ???? I nearly crapped my pants when I first hear audio play. LOL

                                            I think I tried that option before I wiped it, but I guess I will never know. Thank you so much @G30FF and @EctoOne for your support.

                                            E 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.