Couldn't configure X5500 audio card
-
Hello!
I am building my own arcade machine. I decided that I want a hardware potentiometer to control the volume. After a quick research I found that Geekworm X5500 should do the job. So I purchased that device and put it on top of my Raspberry Pi 4B. Unfortunately I couldn't properly configure the sound in Emulation station. I don't have sound in the games. I also don't have navigation sounds. I've read the retropie documentation related to sound issues but I couldn't find a solution.
First I tried all the possible combinations in ES Sound settings.
Then I made the following changes in config.txt:
#dtparam=audio=on dtparam=audio=off dtoverlay=hifiberry-dac
Based on the manufacturer wiki I should use hifiberry-dac for dtoverlay. More info here:
https://raspberrypiwiki.com/X450/X5500_Software_ConfigurationIf I run aplay -L I have the following list:
null Discard all samples (playback) or generate zero samples (capture) default output sysdefault:CARD=sndrpihifiberry snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0 Default Audio Device dmix:CARD=sndrpihifiberry,DEV=0 snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0 Direct sample mixing device dsnoop:CARD=sndrpihifiberry,DEV=0 snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0 Direct sample snooping device hw:CARD=sndrpihifiberry,DEV=0 snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0 Direct hardware device without any conversions plughw:CARD=sndrpihifiberry,DEV=0 snd_rpi_hifiberry_dac, HifiBerry DAC HiFi pcm5102a-hifi-0 Hardware device with all software conversions
As you can see above, I don't have a default card. However It seems I have sysdefault.
And If I run amixer scontrols -D default I receive:
amixer: Mixer attach default error: No such file or directory
And here is something interesting. If I run amixer scontrols -D sysdefault It doesn't return anything! No error this time but also no list of devices (mixers). So it seems there is a sound card but there aren't any audio devices (mixers) on it.
Then I decided to go back in ES and I selected sysdefault in ES sound settings and I tried with all of the listed possibilities for Audio Device without any success.
Additionally I tried aplay -l and it gives me the following:
**** List of PLAYBACK Hardware Devices **** card 0: sndrpihifiberry [snd_rpi_hifiberry_dac], device 0: HifiBerry DAC HiFi pcm5102a-hifi-0 [HifiBerry DAC HiFi pcm5102a-hifi-0] Subdevices: 1/1 Subdevice #0: subdevice #0
If I run amixer scontrols -D sndrpihifiberry I receive the following error:
ALSA lib control.c:1375:(snd_ctl_open_noupdate) Invalid CTL sndrpihifiberry amixer: Mixer attach sndrpihifiberry error: No such file or directory
And finally i made the speaker-test. if run speaker-test -D sndrpihifiberry -t wav -l 20 & I receive:
Playback open error: -2,No such file or directory
But if I run speaker-test -D sysdefault -t wav -l 20 & the test is successful and I can hear a voice calling "Front Left" 20 times with the corresponding logs in the terminal. Which means the audio card itself is working correctly but I can not properly configure it in EmulationStation!
Sorry for the very long description but I wanted to mention everything I tried.
Thank you in advance! -
@stiakooo said in Couldn't configure X5500 audio card:
If I run amixer scontrols -D sndrpihifiberry I receive the following error:
What does
amixer -c 0 scontrols
or just
amixer scontrols
show ? It should be the name of the (simple) mixer attached to the card.
-
@mitu Thank you for your post!
The first command returns nothing:amixer -c 0 scontrols
And just amixer scontrols returns an error:
amixer scontrols amixer: Mixer attach default error: No such file or directory
-
@stiakooo Do you have anything in
$HOME/.asoundrc
?
Isalsamixer
working ? -
cat $HOME/.asoundrc pcm.!default { type asym playback.pcm { type plug slave.pcm "output" } capture.pcm { type plug slave.pcm "input" } } pcm.output { type hw card 1 } ctl.!default { type hw card 1 }
Runnung alsamixer without any parameters it returns error:
alsamixer cannot open mixer: No such file or directory
If I try with sysdefault
alsamixer -D sysdefault
I have the alsamixer UI but there is only the message "This sound device does not have any controls." in the center of the screen.
-
@stiakooo Remove your
$HOME/.asoundrc
and try again to see if you still get an error withalsamixer
. -
@mitu Thanks a lot for all the advices! I finally found a solution that is working for me.
Just deleting .asoundrc wasn't enough. What is important in my case is to enable the softvol ALSA plugin.
To summarise what I needed in order to have sound in the games and also in the EmulationStation menu for my Geekworm X5500 ( I guess it should be the same also for X450).
- /boot/config.txt
# dtparam=audio=on dtparam=audio=off dtoverlay=hifiberry-dac
- /home/pi/.asoundrc
You need to enable softvol ALSA plugin. For more info visit https://alsa.opensrc.org/Softvol
Delete everything and put the following:
pcm.newdevice { type softvol slave.pcm "default" control.name "Softmaster" control.card 0 }
- /home/pi/.emulationstation/es_settings.cfg
<string name="AudioCard" value="default" /> <string name="AudioDevice" value="Softmaster" />
Note: The volume control inside EmulationStation is useless after those changes. The only way to control the volume is using the hardware potentiometer (which is exactly what I need).
Thanks again!
-
So, in other words, the card doesn't have a software volume control and you had to add a fake one to keep ES (or other ALSA based mixers) happy. That doesn't seem too practical if your Pi is not easily accessible.
Glad you got this sorted out, it's a good use case to have in mind.
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.