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

    No music without boot text

    Scheduled Pinned Locked Moved Help and Support
    hide boot textpythonbgm player
    17 Posts 4 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.
    • ClydeC
      Clyde @mitu
      last edited by

      @mitu I just thought of the effect on normal Linux distros when you switch from the graphical desktop to another tty and any playing sound stops until you login as the same user on that tty as on the desktop. But I'm not that familiar with the inner workings of the ttys.

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

        @bobharris Can you check if the BGM script is started after a reboot ? Look in the list of processes with ps -ef | grep pythonfrom a SSH session or from a command line, after exiting Emulationstation.

        BobHarrisB 1 Reply Last reply Reply Quote 1
        • cyperghostC
          cyperghost
          last edited by cyperghost

          @mitu @BobHarris I think that the mpg123 player, which was once presented by @synack is one of the best methods. It is seemless integrated into runcommand.shvia the -onend and -onstart calls. There is no juggleling with python scripts that simple build an array of emulators and ask PID if an emulator is running or not.

          The thread can be found here - Quick and easy guide for adding music to Emulatonstation on RetroPie. Noob friendly!

          I think I also posted some scripts to mute/unmute the player via RetroPie-Menu there :D

          1 Reply Last reply Reply Quote 0
          • BobHarrisB
            BobHarris @mitu
            last edited by BobHarris

            @mitu I don't think that will be necessarily. I think I've located the problem and it has nothing to do with hiding the boot text (like you thought from the beginnning). I had made one other change, that I thought was not worth mentioning.

            Before I made any of these changes, when booting the Pi I often saw this text:
            'A startup job is running for dhcpcd on all interfaces.'
            This almost doubled the boot time, so I went to raspi config and disabled 'wait for network at boot', which remedied the issue.
            But there is another message I almost always get when I boot the Pi:
            'Failed to start usbmount@dev-sda service.'

            So what I think happens is this:
            Before my changes the Pi would boot up slower, but this extra time gives the Pi the chance to mount the usb drive during the boot process. Then the music works (I store the tracks on my usb flash drive). By shortening the boot time, the usb drive isn't mounted in time and the music can't start.

            So the question now is: How do I get rid of the 'Failed to start usbmount@dev-sda service message'?
            The alternative solution would be to store the music on the micro sd, but for me it's easier to store them on the flash drive. (Then I don't have to make a new backup of my sd everytime I put some new songs on there; I just add the songs to my usb flash drive backup on my hard drive.)

            (I had the same issue with a splash screen video: Every time I got the message 'Failed to start usbmount@dev-sda service' the video wouldn't load. Once in a while I wouldn't get the Failed message and the video started. I had to move the video to the sd card for it to work every time.)

            @cyperghost I made sure the script kills the music for all my emulators, so it works fine for me. At the time I was deciding between the two methods the Python script had some benefits for me: Different music track after quitting a game, fade out when starting a game, the option to set a start song: Playstation 1 boot sound.

            Pi 3B , 64 GB Sandisk ultra flashdrive, 19 systems, 872 hand picked classic gaming gems :-) Dual shock 4v2

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

              @bobharris You could try and move the music start command to the RetroPie autostart script and remove it from /etc/rc.local. You can edit the Autostart script from the RetroPie-Setup script, in the Configuration / tools / autostart section, and add the command there. Check if that makes a difference, I assume that if ES is able to read the USB (with the ROMs), so will the script.

              BobHarrisB 1 Reply Last reply Reply Quote 0
              • BobHarrisB
                BobHarris @mitu
                last edited by

                @mitu I'm not really familiar with these edits so I hope you can walk me trough it. This is what is inside rc.local :
                #!/bin/sh -e

                rc.local

                This script is executed at the end of each multiuser runlevel.

                Make sure that the script will "exit 0" on success or any other

                value on error.

                In order to enable or disable this script just change the execution

                bits.

                By default this script does nothing.

                Print the IP address

                _IP=$(hostname -I) || true
                if [ "$_IP" ]; then
                printf "My IP address is %s\n" "$_IP"
                fi
                (sudo python /home/pi/PyScripts/bgmusic.py) &
                exit 0

                What do I leave in this file and what do I move to autostart.sh?
                In autostart.sh , do I copy the text on the same line as 'emulationstation #auto' or on the next line or maybe it doesn't make a difference?

                Pi 3B , 64 GB Sandisk ultra flashdrive, 19 systems, 872 hand picked classic gaming gems :-) Dual shock 4v2

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

                  @bobharris said in No music without boot text:

                  What do I leave in this file and what do I move to autostart.sh?

                  Add an # before the line containing (sudo python /home/pi/PyScripts/bgmusic.py) &

                  In autostart.sh , do I copy the text on the same line as 'emulationstation #auto' or on the next line or maybe it doesn't make a difference?

                  Add a new line, before the emulationstation #auto line, with

                  (python /home/pi/PyScripts/bgmusic.py) &
                  
                  BobHarrisB 3 Replies Last reply Reply Quote 1
                  • BobHarrisB
                    BobHarris @mitu
                    last edited by

                    @mitu I'm having a hard time typing a hashtag symbol instead of a pound sterling symbol. I even changed the localisation /keyboard options and rebooted but to no effect.
                    Have to go to work now, when I get back I will make the changes through SSH. I will let you know if it solved my issue. Thanks so far!

                    Pi 3B , 64 GB Sandisk ultra flashdrive, 19 systems, 872 hand picked classic gaming gems :-) Dual shock 4v2

                    1 Reply Last reply Reply Quote 0
                    • BobHarrisB
                      BobHarris @mitu
                      last edited by

                      @mitu I ran into some other problems, so I decided to just move the music folder to the sd. Music works, boot time is quick and the boot text is hidden. Thanks anyway!

                      Pi 3B , 64 GB Sandisk ultra flashdrive, 19 systems, 872 hand picked classic gaming gems :-) Dual shock 4v2

                      1 Reply Last reply Reply Quote 0
                      • BobHarrisB
                        BobHarris @mitu
                        last edited by

                        @mitu I gave it another shot and moving the line to autostart did the trick! Music still starts and I get to keep the music folder on my usb stick. Thanks!

                        Pi 3B , 64 GB Sandisk ultra flashdrive, 19 systems, 872 hand picked classic gaming gems :-) Dual shock 4v2

                        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.