RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    [opendev] The Background Music Box

    Scheduled Pinned Locked Moved Ideas and Development
    cyperghostbgmmp3mpg123
    33 Posts 6 Posters 5.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.
    • cyperghostC
      cyperghost
      last edited by cyperghost

      It's possible to see tracklength of current selected track...

      Ugly hack!! removed!!!

      and add --item-help to your dialog config, then you can see tracklength of selected mp3 title ;) Maybe somebody can improve the coding .... I did it just in a swift way.

      cyperghostC 1 Reply Last reply Reply Quote 0
      • cyperghostC
        cyperghost @cyperghost
        last edited by

        So this is an updated version of the music player with additional info to selected mp3 file. See bottom line ....

        Get it from here

        1 Reply Last reply Reply Quote 0
        • M
          majikill
          last edited by

          i understand that this topic is old. but a different bgm player is no longer woking properly. That and im having way more fun setting it up and having bgm work the way it should. That being said its kind of a shame this project didnt go far, i aim to change that. Is is possible to set a different volume level for mpg123 than master setting of ES? to keep the music at a tollerable level i cant hear the games. id have to set the volume the moment i get out of a game and that can be a hassle. so im hoping there is a script or something i can use to remedy this

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

            @majikill said in [opendev] The Background Music Box:

            That being said its kind of a shame this project didnt go far, i aim to change that. Is is possible to set a different volume level for mpg123 than master setting of ES.

            You can, by defining a new ALSA device, with it's own volume - https://alsa.opensrc.org/How_to_use_softvol_to_control_the_master_volume.

            Basically, you add in $HOME/.asoundrc

            pcm.mp3 {
                type            softvol
                slave.pcm       "default"
                control.name    "Softmaster"
                control.card    0
            }
            

            then you instruct the audio application to use the mp3 ALSA device. When you open alsamixer to se the volume, you'll have 2 mixer elements, one of them called "Softmaster", and you can set the volume individually.

            cyperghostC M 2 Replies Last reply Reply Quote 0
            • cyperghostC
              cyperghost @mitu
              last edited by cyperghost

              @mitu @majikill The method for volume change can be kept quite simpler. mpg123 -f switch scales volume level.

              So please feel free to improve

              32768 -- Volume 100%
              29491  --Volume 90%
              ...
              16284 -- Volume 50%
              ...
              0 -- Mute
              
              M 1 Reply Last reply Reply Quote 1
              • M
                majikill @cyperghost
                last edited by

                @cyperghost where would i apply these changes exactly? unless i make the changes to any instance mpg123 starts?

                1 Reply Last reply Reply Quote 0
                • M
                  majikill @mitu
                  last edited by

                  @mitu this would go just in the /home directory?

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

                    @majikill You can try modifying the script that starts the BGM music and add the -f parameter as @cyperghost mentioned. The .asoundrc configuration file I was mentioning should be added in $HOME (which translates to /home/pi).

                    M 2 Replies Last reply Reply Quote 0
                    • M
                      majikill @mitu
                      last edited by

                      @mitu awesome. perfect guys thank you. im gonna try both and see what works best for me.

                      1 Reply Last reply Reply Quote 0
                      • M
                        majikill @mitu
                        last edited by

                        @mitu i managed to create the .asoundrc file where it should be. but when i launch alsasound i only have a single mixer. i did put the file in /home/pi

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

                          @majikill Can you run

                          speaker-test -D mp3
                          

                          and see if you get any errors ? Then start alsamixer and see if you have 2 mixer devices.

                          M 2 Replies Last reply Reply Quote 0
                          • M
                            majikill @mitu
                            last edited by

                            @mitu that worked! im curious why tho. once the test is run, does it force alsa to load the file i created?

                            1 Reply Last reply Reply Quote 0
                            • M
                              majikill @mitu
                              last edited by

                              @mitu ok well kinda worked. i see the softmaster in the mixer. but pcm still controls the volume for bgm

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

                                @majikill said in [opendev] The Background Music Box:

                                but pcm still controls the volume for bgm

                                You need to tell mpg321 to use the newly created device - as I said in my initial post:

                                mpg321 -o alsa --audiodevice mp3 <path/to/file>
                                
                                M 1 Reply Last reply Reply Quote 0
                                • M
                                  majikill @mitu
                                  last edited by

                                  @mitu ok, i think i get it now. im using this as a crash course in writing scripts, so im sorry if i dont understand how this should work. but this is a huge help, thank you.

                                  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.