No audio after auto refresh rate change to 50 Hz
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 14.1k
- Forks
- 2.2k
- Avg merge
- 7h 35m
- Merged PRs (30d)
- 51
Description
Is there an existing issue for this?
- This is a bug in RetroArch frontend
- I have searched the existing issues
Description
Platform: Custom Lakka 5.x on RPi3 (aarch64) connected to TV.
Since Retroarch version 1.20.0, auto-changing refresh rate from 60 Hz to 50 Hz for PAL games causes audio to fail because the audio driver cannot be initialized. Log shows the following lines after loading 50 Hz content:
Lakka:~/testing # ./retroarch-4b177d0ac783ad84ea078bfd85279341ebefc6da -v
(...)
[INFO] [Video]: Video refresh rate changed to 50.000 Hz.
(...)
[INFO] [Audio]: Set audio input rate to: 47993.30 Hz.
[INFO] [ALSA] Using ALSA version 1.2.8
[INFO] [ALSA]: Using S16_LE sample format for PLAYBACK device "hdmi:CARD=vc4hdmi,DEV=0"
[INFO] [ALSA]: Period: 2 periods per buffer (1411 frames, 5644 bytes)
[INFO] [ALSA]: Buffer size: 2822 frames (11288 bytes)
[INFO] [ALSA]: Can pause: no.
[INFO] [ALSA]: Initialized PLAYBACK device "hdmi:CARD=vc4hdmi,DEV=0"
[INFO] [Audio]: Started synchronous audio driver.
[INFO] [ALSA] Using ALSA version 1.2.8
[INFO] [Microphone]: Initialized microphone driver.
wifi is already enabled
[INFO] [Display]: Found display driver: "gl".
[INFO] [Input]: Game Focus => OFF
[INFO] [Audio]: Set audio input rate to: 47993.30 Hz.
[INFO] [ALSA] Using ALSA version 1.2.8
[ERROR] [ALSA]: Failed to open PLAYBACK stream on device "hdmi:CARD=vc4hdmi,DEV=0": Device or resource busy
[ERROR] [ALSA]: Failed to initialize...
[INFO] [Audio]: Started synchronous audio driver.
[ERROR] Failed to initialize audio driver. Will continue without audio.
(...)
This happens after commit 4b177d0ac783ad84ea078bfd85279341ebefc6da (PR #17021) from Sep 21 2024.
Audio is working fine in previous commit (4ce7dd6fd5b6be4cb9049e7f58dda04051f877f7)
I just stumbled upon this issue while using Retroarch 1.22.2, which is the current latest tagged version.
Expected behavior
Have audio working after refresh rate change.
Steps to reproduce the bug
- Start Retroarch 1.20.0 and later with automatic refresh rate switch enabled.
- If display is set to 60 Hz by default, load 50 Hz content (PAL for example).
- Check if audio is working.
Version/Commit
1.20.0 and newer
Bisect Results
4b177d0ac783ad84ea078bfd85279341ebefc6da
Present in the nightly version
I don't know
Platform & operating system
Linux aarch64 (Custom Lakka 5.x on Raspberry Pi 3)
Affected Cores
FCeumm, PCSX-ReArmed tested.
Environment information
No response
Relevant log output
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing commits 4b177d0ac783ad84ea078bfd85279341ebefc6da and 4ce7dd6fd5b6be4cb9049e7f58dda04051f877f7, focusing on the audio and refresh-rate paths around ALSA reinitialization. Reproduce the 60 Hz to 50 Hz PAL transition on Linux aarch64 with automatic refresh switching enabled. Done means audio remains available after the change without the ALSA device-or-resource-busy failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- audio-video-rtc
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100