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

[Solved] Audio output switching with toggle switch

Scheduled Pinned Locked Moved Help and Support
audio output
18 Posts 3 Posters 885 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.
  • O
    oldspicy
    last edited by 24 Apr 2019, 12:29

    Here is the python: https://pastebin.com/x9j51eKe

    1 Reply Last reply Reply Quote 0
    • M
      mitu Global Moderator
      last edited by 24 Apr 2019, 12:49

      The script looks fine - I don't see any problems with it. How are you testing if it works ?

      O 1 Reply Last reply 24 Apr 2019, 17:30 Reply Quote 1
      • C
        cyperghost @oldspicy
        last edited by cyperghost 24 Apr 2019, 17:00

        @oldspicy said in Audio output switching with toggle switch:

        All of them use the os.system command. That's why I'm thinking it's a retropie change to how audio is handled.

        why do you not test via CLI to toogle sound. Just enter the command sudo amixer cset numid=3 2 and see what is happening? As @mitu told there seems no error in the script.

        PS: Are you in DVI mode? Maybe you can force HDMI sound by adding hdmi_drive=2 to your /boot/config.txt

        O 2 Replies Last reply 24 Apr 2019, 17:28 Reply Quote 1
        • O
          oldspicy @cyperghost
          last edited by 24 Apr 2019, 17:28

          @cyperghost tried that, still isnt working. The amixer code just isnt activating for some reason.

          M 1 Reply Last reply 24 Apr 2019, 17:29 Reply Quote 0
          • M
            mitu Global Moderator @oldspicy
            last edited by 24 Apr 2019, 17:29

            @oldspicy Did you check the volume with alsamixer when switching between audio outputs ?

            O 1 Reply Last reply 24 Apr 2019, 17:32 Reply Quote 1
            • O
              oldspicy @mitu
              last edited by 24 Apr 2019, 17:30

              @mitu both in game and from the command line

              1 Reply Last reply Reply Quote 0
              • O
                oldspicy @mitu
                last edited by 24 Apr 2019, 17:32

                @mitu I haven't because there is audio out both, but I'll try that in a bit

                1 Reply Last reply Reply Quote 0
                • O
                  oldspicy @cyperghost
                  last edited by 24 Apr 2019, 17:35

                  @cyperghost I can force one or the other, but the point is to toggle. Sometimes using hdmi, sometimes using the internal speaker

                  C 1 Reply Last reply 24 Apr 2019, 17:37 Reply Quote 0
                  • C
                    cyperghost @oldspicy
                    last edited by cyperghost 24 Apr 2019, 17:37

                    @oldspicy I quickly tried on my build ... the commands amixer cset numid=3 2 works. But I'm still on a Jessie build! Maybe @mitu can test?

                    O 2 Replies Last reply 24 Apr 2019, 18:29 Reply Quote 0
                    • O
                      oldspicy @cyperghost
                      last edited by oldspicy 24 Apr 2019, 18:29

                      @cyperghost @mitu Okay, so I found two more problems. Bluetooth controllers are flaky, and the shutdown script won't work if the screensaver is active. The screensaver holds it and shutdown wont happen.

                      I still have a build I imaged from jessie when everything was working. It's a bit old and I'll have to rebuild some things, but it might be easier. I haven't noticed a big reason to update. I just did because the files got corrupted and I figured it was a good time to update everything.

                      But thanks for trying!

                      M 1 Reply Last reply 24 Apr 2019, 18:57 Reply Quote 0
                      • M
                        mitu Global Moderator @oldspicy
                        last edited by 24 Apr 2019, 18:57

                        @oldspicy Can't say I've seen the shutdown command being unable to actually shutdown/restart unless there was an I/O kernel operation stuck somewhere.

                        O 1 Reply Last reply 24 Apr 2019, 23:28 Reply Quote 0
                        • O
                          oldspicy @mitu
                          last edited by 24 Apr 2019, 23:28

                          @mitu I'm going to try wiping and a fresh install one more time before I give up, maybe something was corrupted that I couldn't find.

                          1 Reply Last reply Reply Quote 0
                          • O
                            oldspicy @cyperghost
                            last edited by 25 Apr 2019, 02:02

                            @cyperghost @mitu Okay, so a clean install fixed everything. I'm not sure what happened the first time, but now the audio switching works, along with the power and bluetooth. Something must have went wrong on the first install. Thanks for taking the time to help me troubleshoot though!

                            How do I mark the post as solved?

                            M 1 Reply Last reply 25 Apr 2019, 03:14 Reply Quote 1
                            • M
                              mitu Global Moderator @oldspicy
                              last edited by 25 Apr 2019, 03:14

                              @oldspicy said in SOLVED - Audio output switching with toggle switch:

                              How do I mark the post as solved?

                              Edit the topic starting post and modify the title - append or prepend [solved] to it.

                              1 Reply Last reply Reply Quote 0
                              18 out of 18
                              • First post
                                18/18
                                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.

                                This community forum collects and processes your personal information.
                                consent.not_received