From 148c8d8e6acf3242bcc27b62f7f51bbdeee6472b Mon Sep 17 00:00:00 2001 From: Timo Wischer Date: Tue, 20 Nov 2018 15:51:42 +0100 Subject: [PATCH] alsa_in/out: Use float to S32 conversion if requested sample_move_d32u24_sS() converts into samples like 0x00****** but S32 format expects samples like 0x********. Therefore it will not use the full volume range when also using sample_move_d32u24_sS() for S32. Signed-off-by: Timo Wischer --- example-clients/alsa_in.c | 4 ++-- example-clients/alsa_out.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/example-clients/alsa_in.c b/example-clients/alsa_in.c index de694e07..cd0e2a6c 100644 --- a/example-clients/alsa_in.c +++ b/example-clients/alsa_in.c @@ -95,9 +95,9 @@ typedef struct alsa_format { alsa_format_t formats[] = { { SND_PCM_FORMAT_FLOAT_LE, 4, sample_move_dS_floatLE, sample_move_floatLE_sSs, "float" }, - { SND_PCM_FORMAT_S32, 4, sample_move_d32u24_sS, sample_move_dS_s32u24, "32bit" }, + { SND_PCM_FORMAT_S32, 4, sample_move_d32_sS, sample_move_dS_s32, "32bit" }, { SND_PCM_FORMAT_S24_3LE, 3, sample_move_d24_sS, sample_move_dS_s24, "24bit - real" }, - { SND_PCM_FORMAT_S24, 4, sample_move_d24_sS, sample_move_dS_s24, "24bit" }, + { SND_PCM_FORMAT_S24, 4, sample_move_d32u24_sS, sample_move_dS_s32u24, "24bit" }, { SND_PCM_FORMAT_S16, 2, sample_move_d16_sS, sample_move_dS_s16, "16bit" } #ifdef __ANDROID__ ,{ SND_PCM_FORMAT_S16_LE, 2, sample_move_d16_sS, sample_move_dS_s16, "16bit little-endian" } diff --git a/example-clients/alsa_out.c b/example-clients/alsa_out.c index 04122603..5b1a4f8c 100644 --- a/example-clients/alsa_out.c +++ b/example-clients/alsa_out.c @@ -96,9 +96,9 @@ typedef struct alsa_format { alsa_format_t formats[] = { { SND_PCM_FORMAT_FLOAT_LE, 4, sample_move_dS_floatLE, sample_move_floatLE_sSs, "float" }, - { SND_PCM_FORMAT_S32, 4, sample_move_d32u24_sS, sample_move_dS_s32u24, "32bit" }, + { SND_PCM_FORMAT_S32, 4, sample_move_d32_sS, sample_move_dS_s32, "32bit" }, { SND_PCM_FORMAT_S24_3LE, 3, sample_move_d24_sS, sample_move_dS_s24, "24bit - real" }, - { SND_PCM_FORMAT_S24, 4, sample_move_d24_sS, sample_move_dS_s24, "24bit" }, + { SND_PCM_FORMAT_S24, 4, sample_move_d32u24_sS, sample_move_dS_s32u24, "24bit" }, { SND_PCM_FORMAT_S16, 2, sample_move_d16_sS, sample_move_dS_s16, "16bit" } #ifdef __ANDROID__ ,{ SND_PCM_FORMAT_S16_LE, 2, sample_move_d16_sS, sample_move_dS_s16, "16bit little-endian" }