Recalbox Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • recalbox.com
    • Gitlab repository
    • Documentation
    • Discord

    GPIO rotary volume

    GamePad/GPIO/USB encoder
    gpio rotary volume
    6
    74
    32692
    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.
    • dh04000
      dh04000 last edited by dh04000

      Would this be doable and useful for recalbox? Would be great for my arcade machine to have a master volume move to control the software audio levels.

      github link

      1 Reply Last reply Reply Quote 0
      • Substring
        Substring last edited by

        No GPIO is analog, so it would require a ADC for which we should determine the number of bits. But there might exist something that already does it. Do you use only the hdmi audio ?

        Former dev - Please reply with @substring so that i am notified when you answer me
        Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

        dh04000 1 Reply Last reply Reply Quote 1
        • dh04000
          dh04000 @Substring last edited by

          @subs Hey Subs,

          I use the headphone jack audio only. Did you look at the github link? The author had this to say about how it worked, "since the GPIO pins are just for arbitrary signals, you need a script on the Pi that knows what to do with them, The builtin GPIO library for the Pi will do nicely for this.

          You'll see the script below, but here's how it works: it listens on the specified pins, and when the knob is turned one way or another, it uses the states of the A and B pins to figure out whether the knob was turned to the left or to the right. That way it knows whether to increase or decrease the system volume in response, which it does with the command-line program amixer."

          He had it work on retropie.

          Is this generic enough to work in recalbox? Would anyone else be interested in this being default in recalbox as a way to control audio in arcade box situtions? Kinda like how a shutdown button was added as an alternative to gui shutdowns.

          1 Reply Last reply Reply Quote 0
          • Substring
            Substring last edited by

            you're right, i didn't check the link. So i have an answer for you

            /me summons @supernature2k

            Dude, i know you can change alsa volume with a tick on a pin, add it to your ¨Über gpio ultimate script ?

            Former dev - Please reply with @substring so that i am notified when you answer me
            Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

            dh04000 1 Reply Last reply Reply Quote 1
            • dh04000
              dh04000 @Substring last edited by dh04000

              @subs said in GPIO rotary volume:

              you're right, i didn't check the link. So i have an answer for you

              /me summons @supernature2k

              Dude, i know you can change alsa volume with a tick on a pin, add it to your ¨Über gpio ultimate script ?

              So are you saying that my suggestion this might be included in recalbox? If so, YAY! I contributed to something! Woot. 🙂 Also, it would really complete my arcade cabinet. Some day, I'll post pictures here to show you what the devs of Recalbox have allowed me to do. 🙂

              1 Reply Last reply Reply Quote 0
              • lackyluuk
                lackyluuk Translator last edited by

                @subs Controlling the ALSA controls is explained i the HiFiBerry wiki article that I wrote some time ago, if you speak about this?

                NintendoRS | Nintendo Adapter Box | Cardboard Recalbox

                1 Reply Last reply Reply Quote 0
                • Substring
                  Substring last edited by

                  @lackyluuk @dh04000 the idea is to have a gpio read Volume+ or Volume- ticks. So yes, the Hifiberry configuration part is almost exactly what will be done. May also need to check with recalbox internal audio volume, if it needs to be saved or not ...

                  Former dev - Please reply with @substring so that i am notified when you answer me
                  Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

                  1 Reply Last reply Reply Quote 0
                  • lackyluuk
                    lackyluuk Translator last edited by

                    @subs okay cool. Yes, this could be a useful improvement. Because I cannot use the internal audio seekbar from ES with my script 🙂

                    NintendoRS | Nintendo Adapter Box | Cardboard Recalbox

                    1 Reply Last reply Reply Quote 0
                    • Nachtgarm
                      Nachtgarm last edited by

                      <topic moved to the right category>

                      1 Reply Last reply Reply Quote 0
                      • dh04000
                        dh04000 last edited by

                        @subs

                        I am going to buy that rotary encoder found in the github link. When it arrives, would you mind helping me integrate this into my Recalbox 4.0 build? I'm going to upgrade to 4.1 due to fba rom set version changes. Thank you.

                        1 Reply Last reply Reply Quote 0
                        • Substring
                          Substring last edited by

                          4.1 is not publicly available. But either me either @supernature2k can help you to make it run meanwhile. Still, i didn't check how the button works, so wait a little before buying it

                          Former dev - Please reply with @substring so that i am notified when you answer me
                          Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

                          dh04000 1 Reply Last reply Reply Quote 0
                          • dh04000
                            dh04000 @Substring last edited by

                            @subs said in GPIO rotary volume:

                            4.1 is not publicly available. But either me either @supernature2k can help you to make it run meanwhile. Still, i didn't check how the button works, so wait a little before buying it

                            Alright, I'll hold off on the order. Thank you for assistance subs and supernature2k!

                            1 Reply Last reply Reply Quote 0
                            • Substring
                              Substring last edited by

                              @dh04000 several things as looked a little more in depth ... So :

                              • looks like it's a little more complicated than expected to port it
                              • it's python3, and we run python 2.7, so the script must be backported to python 2.7. Can't tell how much work it represents, i don't know enough python
                              • i think it's too much work for @supernature2k

                              Former dev - Please reply with @substring so that i am notified when you answer me
                              Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

                              dh04000 1 Reply Last reply Reply Quote 0
                              • dh04000
                                dh04000 @Substring last edited by dh04000

                                @subs said in GPIO rotary volume:

                                @dh04000 several things as looked a little more in depth ... So :

                                • looks like it's a little more complicated than expected to port it
                                • it's python3, and we run python 2.7, so the script must be backported to python 2.7. Can't tell how much work it represents, i don't know enough python
                                • i think it's too much work for @supernature2k

                                That's a shame 😞

                                Would this program help? https://wiki.python.org/moin/3to2 https://wiki.python.org/moin/3to2 It converts python 3 code to python 2 code. Maybe it'll work without modification? Crossing my fingers.

                                1 Reply Last reply Reply Quote 0
                                • dh04000
                                  dh04000 last edited by dh04000

                                  Here's another way to do a rotary encoder. No idea if python 3 or 2. https://volumio.org/forum/gpio-pins-control-volume-t2219.html

                                  Looks even simpler. But, that button to play music lines would need to be cut out.

                                  Substring 1 Reply Last reply Reply Quote 0
                                  • Substring
                                    Substring @dh04000 last edited by

                                    @dh04000 indeed, much easier. Can't say if it's python 3 or not, but it looks rather easy to setup

                                    Former dev - Please reply with @substring so that i am notified when you answer me
                                    Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

                                    1 Reply Last reply Reply Quote 0
                                    • dh04000
                                      dh04000 last edited by

                                      Is there any hope of a gpio volume by button or rotary encoder in the future, or should I start working on a new plan for my arcade box? Do you know if usb volume controllers work on recalbox?

                                      1 Reply Last reply Reply Quote 0
                                      • Substring
                                        Substring last edited by

                                        It's hard to tell. We just lack devices to test. Almost everything in recalbox is ready to handle it, except the gpio handling

                                        Former dev - Please reply with @substring so that i am notified when you answer me
                                        Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

                                        dh04000 1 Reply Last reply Reply Quote 0
                                        • dh04000
                                          dh04000 @Substring last edited by

                                          @subs said in GPIO rotary volume:

                                          It's hard to tell. We just lack devices to test. Almost everything in recalbox is ready to handle it, except the gpio handling

                                          Lacking devices to test, does that mean that you lack a rotary encoder to test? How much to the recalbox paypal would solve that? There's an issue withe the gpio handling? I thought recalbox could read gpio events already?

                                          Substring 1 Reply Last reply Reply Quote 0
                                          • Substring
                                            Substring @dh04000 last edited by

                                            @dh04000 we don't have any rotary button such as yours 😉 we do handle gpio, hopefully lol

                                            Former dev - Please reply with @substring so that i am notified when you answer me
                                            Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

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

                                            Want to support us ?

                                            72
                                            Online

                                            99.6k
                                            Users

                                            28.1k
                                            Topics

                                            187.1k
                                            Posts

                                            Copyright © 2021 recalbox.com