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

BGM in Ubuntu Desktop 18.04



  • Hey all! I'm on a PC and running Ubuntu Desktop w/ ES and RetroPie. I've used Eazy's RetroPi toolkit to install background music, which plays just fine when first installed, however upon reboot, nothing happens.

    Ubuntu is different from Raspbian, so I'm assuming that the script relies on autostart.sh and on end, which just aren't present in the Ubuntu version.

    Should I be running Debian instead of Ubuntu to maximize similar functionality to the Pi version? Or is there a more simple approach to launching pygame music on boot in Ubuntu?

    I'm asking about Debian as well, since video splash screens aren't really working either.

    Could I possibly run the Pi's retropie_setup.sh in the shell and hope that it would work, enabling functionality and compiling from source on amd64 instead of Pi's arm architecture?



  • Hi, i use this script for BGM on emulationstation, i use Lubuntu 18.04.
    https://retropie.org.uk/forum/topic/347/background-music-continued-from-help-support
    Install pygame from terminal, and copy the script somewere to PC hdd, and start it from terminal, in my case: python /home/pi/bgm.py.
    After add to autostart on ubuntu.



  • @wmarcio I've tried that script too. I was on lubuntu earlier this week too. I just can't seem to find the proper startup location on either Ubuntu or lubuntu.


  • Global Moderator

    @dbrown1986 Add a '.desktop' file in $HOME/.config/autostart/ that will start your script. This is how RetroPie starts Emulationstation - through a retropie.desktop file:

    [Desktop Entry]
    Type=Application
    Exec=gnome-terminal --full-screen --hide-menubar -e emulationstation
    Hidden=false
    NoDisplay=false
    X-GNOME-Autostart-enabled=true
    Name[de_DE]=RetroPie
    Name=rpie
    Comment[de_DE]=RetroPie
    Comment=retropie
    Icon=/usr/local/share/icons/retropie.svg
    Categories=Game
    

    More details about .desktop files - https://wiki.archlinux.org/index.php/Desktop_entries.



  • I am away from my PC now, i am on work, but the reference from @mitu works fine.



  • Hey again...

    So I did as suggested, using retropie.desktop as a base, modifying it to exec=python ./path/to/script.py (/home/pi/RetroPie/bgm.py in my case). I also gave it a unique name and saved it as a new file (music.desktop), not only did it not execute on reboot, but it also broke ES autostart, so I've butchered it. Any suggestions, or perhaps an example .desktop with it working?

    I'm so lost...


  • Global Moderator

    @dbrown1986 Can you post the complete desktop file you have and it's not working ?
    Btw, if you modify the existing rpie.desktop, then of course Emulationstation would not start, you need to copy it first and then rename the copy to music.py.



  • @mitu said in BGM in Ubuntu Desktop 18.04:

    @dbrown1986 Can you post the complete desktop file you have and it's not working ?
    Btw, if you modify the existing rpie.desktop, then of course Emulationstation would not start, you need to copy it first and then rename the copy to music.py.

    That's what I did, I copied it and modified the copy. Neither worked after.

    [Desktop Entry]
    Type=Application
    Exec=python /home/pi/RetroPie/bgm.py
    Hidden=false
    NoDisplay=false
    X-GNOME-Autostart-enabled=true
    Name[de_DE]=music   
    Name=music
    Comment[de_DE]=music   
    Comment=music   
    Icon=/usr/local/share/icons/retropie.svg
    Categories=Game
    

  • Global Moderator

    @dbrown1986 The entry seems fine. You can probably put Hidden=True and NoDisplay=true. If you click on the icon, as you would do on a desktop icon, does it start the background music ?



  • I figured it out. Nano wasn't writing the changes because I forgot to run it in sudo. facepalms
    Working fine now. Stops when ES is quit, starts when ES is ran and pauses when game is run.


  • Global Moderator

    @dbrown1986 You shouldn't need to write it with sudo - the file is not a system file, it's a user owned file. You may have inadvertently broken some permissions in your $HOME folder.



  • @mitu That's what I thought, but I think Ubuntu wouldn't allow it since it was a 'hidden' folder.


  • Global Moderator

    @dbrown1986 said in BGM in Ubuntu Desktop 18.04:

    I think Ubuntu wouldn't allow it since it was a 'hidden' folder.

    First time I hear this kind of - obviously wrong - explanation. Check the permissions on the folder and make sure your $USER owns the folder where the scripts are saved. You don't need to use sudo to edit something that's in your home folder.



  • @mitu said in BGM in Ubuntu Desktop 18.04:

    @dbrown1986 said in BGM in Ubuntu Desktop 18.04:

    I think Ubuntu wouldn't allow it since it was a 'hidden' folder.

    First time I hear this kind of - obviously wrong - explanation. Check the permissions on the folder and make sure your $USER owns the folder where the scripts are saved. You don't need to use sudo to edit something that's in your home folder.

    Could also been something I mucked up; since I installed using net-inst, I checked the permissions and they looked fine.



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.