wizzomafizzo/MiSTer_BGM

Music keep playing when i boot cores and even during gameplay.

marceloMedeiros opened this issue · 16 comments

Just tried it and the mp3 music continue to play when i go to a core. And will still play even when i load games, playing over the game's sound.

That's weird, I'm not sure why it wouldn't work on another mister.

Just so you don't go crazy, you can either delete or the stuff from the music folder or comment out the startup line in /media/fat/linux/user-startup.sh to shut it up

Does this still consistently happen for you after you've rebooted as well? And do any of the bgm_play/stop/skip script work for you?

Thanks! And sorry it's not working properly for you

The way it detects if a core has been launched is a file called /tmp/CORENAME on the mister which get written to each time a core is launched, so it sounds like the thing that watches changes on that isn't working properly. Maybe you can double check if that file exists for you

I will write in some logging stuff later for the script so I can troubleshoot better

Hello, i just deleted everyhing (scripts, music folder) and started it over, and now its working fine.

Im not sure what fixed it but previously i had many music files (like 300 mp3 files) and some gargabe files (thumbnails, etc).

Now i only have like 10 files and its working fine. Not sure if thats related but the music stops now when i go to a core.

Thanks for the quick reply though. I really like your script, it adds some flavour to my MiSTer setup (=

Glad to hear it's working for you now! Thank you

I'm going to keep this open for now if that's ok. I will see if I can reproduce the issue

I have 5 mp3 files.

  1. Music keeps playing when a core is loaded.
  2. play/stop/skip scripts do not work.
    socat[1229] E connect(5, AF=1 "/tmp/bgm.sock", 15): No such file or directory

And yet:

/tmp# ls
bgm.sock  dbus	    ML_FSYNTH	 script  subsys      wtmp
CORENAME  messages  resolv.conf  sshd	 UART_SPEED
/tmp# ls -ltr
total 64
-rwxr-xr-x 1 root root   165 Apr 13 14:31 script
srwxr-xr-x 1 root root     0 Apr 13 14:32 bgm.sock
-rw-r--r-- 1 root root  1920 Apr 13 14:32 wtmp
-rw-r--r-- 1 root root 44424 Apr 13 14:32 messages
-rw-r--r-- 1 root root     1 Apr 13 14:33 UART_SPEED
-rw-r--r-- 1 root root     0 Apr 13 14:33 ML_FSYNTH
-rw-r--r-- 1 root root     4 Apr 13 14:33 CORENAME
drwxr-xr-x 2 root root    60 Apr 13 14:33 dbus
drwxr-xr-x 2 root root    60 Apr 13 14:33 subsys
-rw-r--r-- 1 root root   153 Apr 13 14:33 resolv.conf
-rw------- 1 root root     0 Apr 13 14:33 sshd

  1. The bgm.sock file does not exist when bgm is auto-started (music is playing):
/tmp# ls -ltr
total 60
-rw-r--r-- 1 root root     1 Apr 13  2022 UART_SPEED
-rw-r--r-- 1 root root     0 Apr 13  2022 ML_FSYNTH
-rw-r--r-- 1 root root     4 Apr 13  2022 CORENAME
drwxr-xr-x 2 root root    60 Apr 13  2022 dbus
drwxr-xr-x 2 root root    60 Apr 13  2022 subsys
-rw-r--r-- 1 root root   153 Apr 13  2022 resolv.conf
-rw------- 1 root root     0 Apr 13  2022 sshd
-rw-r--r-- 1 root root  1152 Apr 13  2022 wtmp
-rw-r--r-- 1 root root 44028 Apr 13  2022 messages

Thanks for the report. I'm still trying to investigate this one, I've seen the socket file issue reported in a few different places now but it's very difficult for me to troubleshoot with just 1 mister that doesn't have the problem

I'm wondering if it's something to do with the /tmp folder because almost all issues so far have been to do with the files there. Could you paste the contents of your /etc/fstab here too please?

Unfortunately, everything is working 100% (auto-start, play/stop/skip scripts, stops when core is launched) ATM.
Will post additional info when it is not working (using the latest as of April 14).

Auto-start OK, scripts OK, but music keeps playing after launching a core...

/etc# cat fstab 
# <file system>	<mount pt>	<type>	<options>	<dump>	<pass>
/dev/root	/		ext4	rw,noauto,noatime,nodiratime	0	1
proc		/proc		proc	defaults	0	0
devpts		/dev/pts	devpts	defaults,gid=5,mode=620,ptmxmode=0666	0
tmpfs		/dev/shm	tmpfs	mode=0777	0	0
tmpfs		/tmp		tmpfs	mode=1777	0	0
tmpfs		/run		tmpfs	mode=0755,nosuid,nodev	0	0
sysfs		/sys		sysfs	defaults	0	0
tmpfs		/var/lib/samba	tmpfs	mode=1777	0	0

/tmp# ls -ltr
total 60
drwxr-xr-x 2 root root    60 Apr 14 11:44 dbus
drwxr-xr-x 2 root root    60 Apr 14 11:44 subsys
-rw-r--r-- 1 root root   153 Apr 14 11:44 resolv.conf
-rw------- 1 root root     0 Apr 14 11:44 sshd
-rw-r--r-- 1 root root     1 Apr 14 11:44 UART_SPEED
-rw-r--r-- 1 root root     0 Apr 14 11:44 ML_FSYNTH
-rw-r--r-- 1 root root     6 Apr 14 11:44 CORENAME
srwxr-xr-x 1 root root     0 Apr 14 11:45 bgm.sock
-rw-r--r-- 1 root root  1152 Apr 14 11:45 wtmp
-rw-r--r-- 1 root root 45054 Apr 14 11:45 messages
/tmp# cat CORENAME
NEOGEO

@CharlieYankeeUniformLima do you have any startup sounds running? I've seen some issues when people have a startup sounds run long enough to end after a core is launched and that messes up monitoring for core launches. I'll be putting in a fix for that soon

Also, when you say the the music keeps playing after launch, does that mean it never stops? Or would it stop and start like normal after your first core launch if you were to go and play something else

Thanks again for troubleshooting

I have a startup sound. I had a short sound file and it did not cause any problems. The sound stopped playing when I launched a core.

With a longer startup sound (5min), it kept playing after launching a core and kept looping until I switched core.

This is with the first core loaded and the music is playing/looping:

/tmp# ls -ltr
total 60
drwxr-xr-x 2 root root    60 Apr 19 09:20 dbus
drwxr-xr-x 2 root root    60 Apr 19 09:20 subsys
-rw-r--r-- 1 root root   153 Apr 19 09:20 resolv.conf
-rw------- 1 root root     0 Apr 19 09:20 sshd
-rw-r--r-- 1 root root     0 Apr 19 09:20 ML_FSYNTH
-rw-r--r-- 1 root root     6 Apr 19 09:20 CORENAME
-rw-r--r-- 1 root root     1 Apr 19 09:20 UART_SPEED
-rw-r--r-- 1 root root  1152 Apr 19 09:20 wtmp
-rw-r--r-- 1 root root 44409 Apr 19 09:20 messages
/tmp# cat CORENAME
NEOGEO

/tmp# cat /etc/fstab
# <file system>	<mount pt>	<type>	<options>	<dump>	<pass>
/dev/root	/		ext4	rw,noauto,noatime,nodiratime	0	1
proc		/proc		proc	defaults	0	0
devpts		/dev/pts	devpts	defaults,gid=5,mode=620,ptmxmode=0666	0
tmpfs		/dev/shm	tmpfs	mode=0777	0	0
tmpfs		/tmp		tmpfs	mode=1777	0	0
tmpfs		/run		tmpfs	mode=0755,nosuid,nodev	0	0
sysfs		/sys		sysfs	defaults	0	0
tmpfs		/var/lib/samba	tmpfs	mode=1777	0	0

After switching core:

/tmp# ls -ltr
total 60
drwxr-xr-x 2 root root    60 Apr 19 09:20 dbus
drwxr-xr-x 2 root root    60 Apr 19 09:20 subsys
-rw-r--r-- 1 root root   153 Apr 19 09:20 resolv.conf
-rw------- 1 root root     0 Apr 19 09:20 sshd
-rw-r--r-- 1 root root  1152 Apr 19 09:20 wtmp
srwxr-xr-x 1 root root     0 Apr 19 09:24 bgm.sock
-rw-r--r-- 1 root root     1 Apr 19 09:27 UART_SPEED
-rw-r--r-- 1 root root     0 Apr 19 09:27 ML_FSYNTH
-rw-r--r-- 1 root root     4 Apr 19 09:27 CORENAME
-rw-r--r-- 1 root root 44753 Apr 19 09:27 messages
/tmp# cat CORENAME
SNES
/tmp# cat /etc/fstab
# <file system>	<mount pt>	<type>	<options>	<dump>	<pass>
/dev/root	/		ext4	rw,noauto,noatime,nodiratime	0	1
proc		/proc		proc	defaults	0	0
devpts		/dev/pts	devpts	defaults,gid=5,mode=620,ptmxmode=0666	0
tmpfs		/dev/shm	tmpfs	mode=0777	0	0
tmpfs		/tmp		tmpfs	mode=1777	0	0
tmpfs		/run		tmpfs	mode=0755,nosuid,nodev	0	0
sysfs		/sys		sysfs	defaults	0	0
tmpfs		/var/lib/samba	tmpfs	mode=1777	0	0

I'm getting this too. Short startup sound, and then a random song from 5 files. Plays when a core is loaded and keeps playing when a game is loaded.

I'm getting this too. Short startup sound, and then a random song from 5 files. Plays when a core is loaded and keeps playing when a game is loaded.

Hi. Sorry for the delay. Is this still happening for you? If so, can you please change the debug setting in your bgm.ini file to "debug = yes", restart your mister, launch a game (to reproduce the problem happening) and then paste the contents of your /tmp/bgm.log file here. You'll need to grab the file while your mister is still on, it gets deleted on reboot.

Well maybe I misunderstand what is supposed to happen. I assumed that allowing the music to play when a core was loaded meant just when you're in the core menus and once a ROM is loaded that the music would stop not play over top of it.

That's not how it works sorry. It just means it will continue playing all the time, including when games are played. I would like to set it up how you've described, but unfortunately there's no way for me to tell if a game is actually running from the linux side

You might like my games menu script though. It will let you launch roms from the main mister menu, so you can listen to music while you browse

That's too bad. I should note though that I originally have the core music play back disabled, but it still occasionally would keep playing. I've since disabled core playback again, so if it happens again, I'll try and reproduce and enable the logging.

Yes please let me know! Thanks