Naprosnia / RetroPie_BGM_Player

A simple background music player to implement on RetroPie and Emulation Station.
36 stars 16 forks source link

Music player doesn't fade. #17

Open particle1123 opened 3 years ago

particle1123 commented 3 years ago

RPI 4B 4GB, 128GB Samsung EVO Select SD RetroPie v4.7.1 - my own build using this image, not some prebuild image etc...

I have installed the music player. Everything works except the fade. When I start a game the music abruptly stops. Also, if I make changes to the volume in the setup screen it returns a message:

amixer: unable to find simple control 'pcm',0

Other than this, it works great. Please help, I've spent hours trying to resolve this.

Exarkuniv commented 3 years ago

since he is no longer working on this. i dont think it will be fixed. it is a issue since the audio drivers changed from the Pi3 to the Pi4.

till someone who knows what they are going takes a look at the script. i think we are SOL. if you want fade i know that mpeg123 that cyperghost on the retropie forum has posts on how to do it. and i think it works on the pi4

thesickkness commented 3 years ago

@particle1123

//UPDATE Just tested this fix with a Pi4. I didn't have to fix the mixer elements error.

Edit: /home/pi/RetroPie-BGM-Player/bgm_system.sh

Change: readonly CHANNEL=“PCM” To: readonly CHANNEL="HDMI"


I had the same issue with a new build. Strictly using HDMI audio output, no headphones or anything.

On my new image of Retropie (base 4.7.1) I had to fix the audio first, as I was getting failed to find mixer elements errors: Edit: /opt/retropie/configs/all/emulationstation/es_settings.cfg

Change: string name=“AudioDevice” value="xxxxx” To: string name=“AudioDevice” value=“HDMI”

Then the fix for the fade effect on BGM was simple: Edit: /home/pi/RetroPie-BGM-Player/bgm_system.sh

Change: readonly CHANNEL=“PCM” To: readonly CHANNEL="HDMI"

My fade effect is working and I have zero audio errors. This is on a standard vanilla Retropie 4.7.1 build, 3B+.

Hope this helps some people.

particle1123 commented 3 years ago

@particle1123

//UPDATE Just tested this fix with a Pi4. I didn't have to fix the mixer elements error.

Edit: /home/pi/RetroPie-BGM-Player/bgm_system.sh

Change: readonly CHANNEL=“PCM” To: readonly CHANNEL="HDMI"

I had the same issue with a new build. Strictly using HDMI audio output, no headphones or anything.

On my new image of Retropie (base 4.7.1) I had to fix the audio first, as I was getting failed to find mixer elements errors: Edit: /opt/retropie/configs/all/emulationstation/es_settings.cfg

Change: string name=“AudioDevice” value="xxxxx” To: string name=“AudioDevice” value=“HDMI”

Then the fix for the fade effect on BGM was simple: Edit: /home/pi/RetroPie-BGM-Player/bgm_system.sh

Change: readonly CHANNEL=“PCM” To: readonly CHANNEL="HDMI"

My fade effect is working and I have zero audio errors. This is on a standard vanilla Retropie 4.7.1 build, 3B+.

Hope this helps some people.

Tried this and no luck. Worth knowing that in my situation my sound device is SYSDEFAULT, sound card is PCM and omx is BOTH. unable to change those settings for whatever reason

thesickkness commented 3 years ago

Tried this and no luck. Worth knowing that in my situation my sound device is SYSDEFAULT, sound card is PCM and omx is BOTH. unable to change those settings for whatever reason

My Sound Settings are:

Audio Card: Default Audio Device: HDMI OMX Player Audio Device: Both

Rocketeer2001 commented 2 years ago

I created an account just to comment on my experience in case it helps others.

I have a Raspberry Pi 3B+ with a new Retropie 4.7.1 Buster build that I've been working on. Right out of the gate I had no sound. Nothing in Emulation Station or in games. I had all 3 of the symptoms described here: https://retropie.org.uk/forum/topic/26628/audio-issues-after-latest-raspbian-updates-june-2020

I have an HDMI cable for video going to my monitor, but I'm using a 3.5mm headphone cable for the audio going to some computer speakers. Having this configuration in Retropie Stretch worked fine, but Buster is picky.

In the EmulationStation main menu I had to change my sound settings to be: System Volume = 100% Audio Card = Default Audio Device = Headphone OMX Player Audio Device = ALSA

Then I had to enter the Audio menu in the RetroPie Menu to set my Audio output to "Headphones". This got sound working in both Emulation Station and in games, but now I would get an error when launching a game or entering a retropie menu that would say: amixer unable to find simple control 'pcm'

A bunch of googling later and I realized that this BGM player was the culprit. The music was playing, but it didn't fade out smoothly when launching a game; it would just get cut off. When I toggled off this player in the settings, I no longer got that error about the amixer.

Part of that googling led me here, and after seeing the fix @thesickkness did, I figured I could give that a shot. I used WinSCP to access this location over the network: /opt/retropie/configs/all/emulationstation/es_settings.cfg

Instead of replacing the audio device with 'HDMI', I Changed it to be 'Headphones' since that's what I had it set to in both EmulationStation Sound Settings and in Retropie Audio Settings:

string name=“AudioDevice” value="xxxxx” To: string name=“AudioDevice” value=“Headphones”

I also wanted to mimic this fix to get the fade effect working too, so I went to: /home/pi/RetroPie-BGM-Player/bgm_system.sh

and changed: readonly CHANNEL=“PCM” To: readonly CHANNEL="Headphones"

And just like @thesickkness my fade effect is working and I have zero audio errors popping up!

@particle1123 , you could try fiddling with the various sound settings in emulationstation menu (follow the directions in the link), and then setting your "AudioDevice" and CHANNEL to PCM and see if that makes it happy.