forked from CoreELEC/CoreELEC
-
-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ALSA patch on RetroArch for Amlogic-old (#1260)
Fix audio on Amlogic-old. On S905L at least! Co-authored-by: bennydiamond <github@benjaminfd.com>
- Loading branch information
1 parent
59c30bf
commit eb45e85
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
packages/sx05re/libretro/retroarch/patches/Amlogic-old/01-ALSA_fix.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
diff --git a/audio/common/alsa.c b/audio/common/alsa.c | ||
index f1b011a2e8..07a3d9b23b 100644 | ||
--- a/audio/common/alsa.c | ||
+++ b/audio/common/alsa.c | ||
@@ -63,16 +63,6 @@ int alsa_init_pcm(snd_pcm_t **pcm, | ||
goto error; | ||
} | ||
|
||
- if ((errnum = snd_pcm_hw_params_any(*pcm, params)) < 0) | ||
- { | ||
- RARCH_ERR("[ALSA]: Failed to query hardware parameters from %s device \"%s\": %s\n", | ||
- snd_pcm_stream_name(stream), | ||
- snd_pcm_name(*pcm), | ||
- snd_strerror(errnum)); | ||
- | ||
- goto error; | ||
- } | ||
- | ||
format = (snd_pcm_hw_params_test_format(*pcm, params, SND_PCM_FORMAT_FLOAT) == 0) | ||
? SND_PCM_FORMAT_FLOAT : SND_PCM_FORMAT_S16; | ||
stream_info->has_float = (format == SND_PCM_FORMAT_FLOAT); | ||
@@ -83,6 +73,16 @@ int alsa_init_pcm(snd_pcm_t **pcm, | ||
snd_pcm_name(*pcm) | ||
); | ||
|
||
+ if ((errnum = snd_pcm_hw_params_any(*pcm, params)) < 0) | ||
+ { | ||
+ RARCH_ERR("[ALSA]: Failed to query hardware parameters from %s device \"%s\": %s\n", | ||
+ snd_pcm_stream_name(stream), | ||
+ snd_pcm_name(*pcm), | ||
+ snd_strerror(errnum)); | ||
+ | ||
+ goto error; | ||
+ } | ||
+ | ||
if ((errnum = snd_pcm_hw_params_set_access(*pcm, params, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) | ||
{ | ||
RARCH_ERR("[ALSA]: Failed to set %s access for %s device \"%s\": %s\n", |