No audio on video preview snaps with omxplayer
-
Thanks in advance to anyone who can offer assistance on this. I'm a relative newbie to RetroPie, but am a long time computer professional so this kind of stuff isn't too new to me.
Pi model: 3B+
Power Supply: 5V 3A ([https://www.amazon.com/gp/product/B01N336XEU](link url))
RetroPie Version: 4.4.8
Built From: pre-made SD image from RetroPie web site
USB Devices: keyboard, dragon rise joystick/button controller
Error messages received: ALSA lib control.c:1373:(snd_ctl_open_noupdate) Invalid CTL both, lvl0: VolumeControl::init() - Failed to attach to default card!I'm not sure if the error message above is related to my issue or not, but I thought I would include it. I see this message frequently when jumping in and out of ES and various other GUI setup screens. I've seen posts on using the ALSA mixer and I've been able to go in and adjust sound there without issue so I don't think I am having an issue with built-in raspberry pi sound card. The sound card is being detected. Sound in games is fine.
My problem is that video previews/snaps play using omxplayer, but I get no audio whether I'm in a rom gallery previewing videos there or if screen saver is on and playing videos. I'm attempting to direct audio out 3.5mm jack. Interesting thing is, with my current setup, if I go into ES and disable OMX Player hardware acceleration, videos play and I do get audio at that point, but quality of video and audio is poor. I believe this is a known issue as all posts I read indicate that HW acceleration should be used. I tried VLC and had same results as omxplayer when HW acceleration was turned off so not an option there. Also, VLC does not do a good job with stretching videos out from what I saw.
Preview videos I am using were downloaded via Skyscraper. When I play video files outside of omxplayer, they play fine including the audio. I don't think source files are the issue.
Maybe one of the most interesting things is if I ran this from command line (i.e. SSH session on retropie machine), audio worked fine and I would hear audio from video out of 3.5mm jack.
omxplayer -o local /home/pi/.emulationstation/downloaded_media/arcade/videos/1941.mp4
Here's output from above command...
pi@retropie:~ $ omxplayer -o local /home/pi/.emulationstation/downloaded_media/arcade/videos/1941.mp4 Video codec omx-h264 width 480 height 640 profile 100 fps 59.940060 Audio codec aac channels 2 samplerate 48000 bitspersample 16 Subtitle count: 0, state: off, index: 1, delay: 0 V:PortSettingsChanged: 480x640@59.94 interlace:0 deinterlace:0 anaglyph:0 par:1.00 display:0 layer:0 alpha:255 aspectMode:0 have a nice day ;)
ES navigation audio works fine. When I move between selections in navigation I hear navigation sounds over 3.5mm jack.
One more thing that I should mention which might be relevant. In ES -> Sound Settings -> System Volume, I can never save any changes to volume. It's always at 0%. I've seen a lot of posts on this topic with a lot of ways to fix this. Nothing seems to work for me. I don't know if it is critical to this issue though.
I should probably mentioned all of my ES sound settings so here they are just in case...
"Audio Card" = LOCAL "Audio Device" = PCM "Enable Navigation Sounds" = ON (I can hear these) "Enable Video Audio" = ON "OMX Player Audio Device" = LOCAL
In /boot/config.txt I have these settings enabled...
# Enable audio (loads snd_bcm2835) dtparam=audio=on # At one point I was trying to get this working via HDMI and had below enabled. In fact this is still enabled. # uncomment to force a HDMI mode rather than DVI. This can make audio work in # DMT (computer monitor) modes hdmi_drive=2
Per [https://retropie.org.uk/forum/topic/19946/no-sound-in-es-with-3-5mm-port/8](link url) I've run the following and rebooted with no improvement...
sudo amixer cset numid=3 1 sudo alsactl store
Thanks!
-
@kavin_steele Try playing with the Card/Device settings in Emulationstation - the ALSA error you're getting indicates the
Master
device cannot be controlled from Alsa, hence the volume settings staying at 0. -
Thanks @mito for the guidance on what to focus on. Changing ES -> Sound Settings -> Audio Card from "LOCAL" to "DEFAULT" finally did the trick for me. Everything now works. Thank you so much!
Here are my ES sound settings I ended up with.
"Audio Card" = DEFAULT "Audio Device" = PCM "Enable Navigation Sounds" = ON (I can hear these) "Enable Video Audio" = ON "OMX Player Audio Device" = LOCAL
-
@kavin_steele Thanks for sharing your solution for others who might have the same problem.
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.