* [PATCH] ALSA: aloop: Support S24 sample formats
@ 2019-03-25 15:14 twischer
2019-03-25 15:35 ` Jaroslav Kysela
0 siblings, 1 reply; 3+ messages in thread
From: twischer @ 2019-03-25 15:14 UTC (permalink / raw)
To: patch, broonie, perex, tiwai; +Cc: alsa-devel, linux-kernel, Timo Wischer
From: Timo Wischer <twischer@de.adit-jv.com>
Currently snd_aloop supports only S16 and S32 audio sample formats. With
this patch the S24 formats are also supported.
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
---
sound/drivers/aloop.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c
index 8c3fbe1..c14e57b 100644
--- a/sound/drivers/aloop.c
+++ b/sound/drivers/aloop.c
@@ -337,7 +337,7 @@ static int loopback_prepare(struct snd_pcm_substream *substream)
loopback_timer_stop_sync(dpcm);
- salign = (snd_pcm_format_width(runtime->format) *
+ salign = (snd_pcm_format_physical_width(runtime->format) *
runtime->channels) / 8;
bps = salign * runtime->rate;
if (bps <= 0 || salign <= 0)
@@ -562,6 +562,8 @@ static const struct snd_pcm_hardware loopback_pcm_hardware =
SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_RESUME),
.formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE |
+ SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE |
+ SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_3BE |
SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE |
SNDRV_PCM_FMTBIT_FLOAT_LE | SNDRV_PCM_FMTBIT_FLOAT_BE),
.rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_192000,
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ALSA: aloop: Support S24 sample formats
2019-03-25 15:14 [PATCH] ALSA: aloop: Support S24 sample formats twischer
@ 2019-03-25 15:35 ` Jaroslav Kysela
2019-03-25 15:39 ` [ALSA patch] " Takashi Iwai
0 siblings, 1 reply; 3+ messages in thread
From: Jaroslav Kysela @ 2019-03-25 15:35 UTC (permalink / raw)
To: twischer, patch, broonie, tiwai; +Cc: alsa-devel, linux-kernel
Dne 25. 03. 19 v 16:14 twischer@de.adit-jv.com napsal(a):
> From: Timo Wischer <twischer@de.adit-jv.com>
>
> Currently snd_aloop supports only S16 and S32 audio sample formats. With
> this patch the S24 formats are also supported.
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
>
> Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
> ---
> sound/drivers/aloop.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c
> index 8c3fbe1..c14e57b 100644
> --- a/sound/drivers/aloop.c
> +++ b/sound/drivers/aloop.c
> @@ -337,7 +337,7 @@ static int loopback_prepare(struct snd_pcm_substream *substream)
>
> loopback_timer_stop_sync(dpcm);
>
> - salign = (snd_pcm_format_width(runtime->format) *
> + salign = (snd_pcm_format_physical_width(runtime->format) *
> runtime->channels) / 8;
> bps = salign * runtime->rate;
> if (bps <= 0 || salign <= 0)
> @@ -562,6 +562,8 @@ static const struct snd_pcm_hardware loopback_pcm_hardware =
> SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_PAUSE |
> SNDRV_PCM_INFO_RESUME),
> .formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE |
> + SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE |
> + SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_3BE |
> SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE |
> SNDRV_PCM_FMTBIT_FLOAT_LE | SNDRV_PCM_FMTBIT_FLOAT_BE),
> .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_192000,
>
--
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [ALSA patch] [PATCH] ALSA: aloop: Support S24 sample formats
2019-03-25 15:35 ` Jaroslav Kysela
@ 2019-03-25 15:39 ` Takashi Iwai
0 siblings, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2019-03-25 15:39 UTC (permalink / raw)
To: twischer; +Cc: Jaroslav Kysela, broonie, alsa-devel, linux-kernel
On Mon, 25 Mar 2019 16:35:20 +0100,
Jaroslav Kysela wrote:
>
> Dne 25. 03. 19 v 16:14 twischer@de.adit-jv.com napsal(a):
> > From: Timo Wischer <twischer@de.adit-jv.com>
> >
> > Currently snd_aloop supports only S16 and S32 audio sample formats. With
> > this patch the S24 formats are also supported.
>
> Reviewed-by: Jaroslav Kysela <perex@perex.cz>
>
> >
> > Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
Applied now, thanks.
Takashi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-25 15:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-25 15:14 [PATCH] ALSA: aloop: Support S24 sample formats twischer
2019-03-25 15:35 ` Jaroslav Kysela
2019-03-25 15:39 ` [ALSA patch] " Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).