From: Takashi Iwai <tiwai@suse.de>
To: Jussi Laako <jussi@sonarnerd.net>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] alsa-kernel: Add big-endian DSD sample formats and fix XMOS DSD sample format
Date: Fri, 21 Nov 2014 15:11:55 +0100 [thread overview]
Message-ID: <s5hvbm8ve1g.wl-tiwai@suse.de> (raw)
In-Reply-To: <1416578687-12950-1-git-send-email-jussi@sonarnerd.net>
At Fri, 21 Nov 2014 16:04:46 +0200,
Jussi Laako wrote:
>
> This patch fixes XMOS DSD sample format to DSD_U32_BE and also adds
> DSD_U16_BE and DSD_U32_BE sample formats.
>
> Signed-off-by: Jussi Laako <jussi@sonarnerd.net>
Applied, thanks.
Takashi
> ---
> include/sound/pcm.h | 2 ++
> include/uapi/sound/asound.h | 4 +++-
> sound/core/pcm.c | 2 ++
> sound/core/pcm_misc.c | 8 ++++++++
> sound/usb/quirks.c | 4 ++--
> 5 files changed, 17 insertions(+), 3 deletions(-)
>
> diff --git a/include/sound/pcm.h b/include/sound/pcm.h
> index 40289ec..1e7f74a 100644
> --- a/include/sound/pcm.h
> +++ b/include/sound/pcm.h
> @@ -184,6 +184,8 @@ struct snd_pcm_ops {
> #define SNDRV_PCM_FMTBIT_DSD_U8 _SNDRV_PCM_FMTBIT(DSD_U8)
> #define SNDRV_PCM_FMTBIT_DSD_U16_LE _SNDRV_PCM_FMTBIT(DSD_U16_LE)
> #define SNDRV_PCM_FMTBIT_DSD_U32_LE _SNDRV_PCM_FMTBIT(DSD_U32_LE)
> +#define SNDRV_PCM_FMTBIT_DSD_U16_BE _SNDRV_PCM_FMTBIT(DSD_U16_BE)
> +#define SNDRV_PCM_FMTBIT_DSD_U32_BE _SNDRV_PCM_FMTBIT(DSD_U32_BE)
>
> #ifdef SNDRV_LITTLE_ENDIAN
> #define SNDRV_PCM_FMTBIT_S16 SNDRV_PCM_FMTBIT_S16_LE
> diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h
> index 6ee5867..941d32f 100644
> --- a/include/uapi/sound/asound.h
> +++ b/include/uapi/sound/asound.h
> @@ -220,7 +220,9 @@ typedef int __bitwise snd_pcm_format_t;
> #define SNDRV_PCM_FORMAT_DSD_U8 ((__force snd_pcm_format_t) 48) /* DSD, 1-byte samples DSD (x8) */
> #define SNDRV_PCM_FORMAT_DSD_U16_LE ((__force snd_pcm_format_t) 49) /* DSD, 2-byte samples DSD (x16), little endian */
> #define SNDRV_PCM_FORMAT_DSD_U32_LE ((__force snd_pcm_format_t) 50) /* DSD, 4-byte samples DSD (x32), little endian */
> -#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_DSD_U32_LE
> +#define SNDRV_PCM_FORMAT_DSD_U16_BE ((__force snd_pcm_format_t) 51) /* DSD, 2-byte samples DSD (x16), big endian */
> +#define SNDRV_PCM_FORMAT_DSD_U32_BE ((__force snd_pcm_format_t) 52) /* DSD, 4-byte samples DSD (x32), big endian */
> +#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_DSD_U32_BE
>
> #ifdef SNDRV_LITTLE_ENDIAN
> #define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
> diff --git a/sound/core/pcm.c b/sound/core/pcm.c
> index 8f624b7..cfc56c8 100644
> --- a/sound/core/pcm.c
> +++ b/sound/core/pcm.c
> @@ -216,6 +216,8 @@ static char *snd_pcm_format_names[] = {
> FORMAT(DSD_U8),
> FORMAT(DSD_U16_LE),
> FORMAT(DSD_U32_LE),
> + FORMAT(DSD_U16_BE),
> + FORMAT(DSD_U32_BE),
> };
>
> /**
> diff --git a/sound/core/pcm_misc.c b/sound/core/pcm_misc.c
> index ae7a0fe..ebe8444 100644
> --- a/sound/core/pcm_misc.c
> +++ b/sound/core/pcm_misc.c
> @@ -152,6 +152,14 @@ static struct pcm_format_data pcm_formats[(INT)SNDRV_PCM_FORMAT_LAST+1] = {
> .width = 32, .phys = 32, .le = 1, .signd = 0,
> .silence = { 0x69, 0x69, 0x69, 0x69 },
> },
> + [SNDRV_PCM_FORMAT_DSD_U16_BE] = {
> + .width = 16, .phys = 16, .le = 0, .signd = 0,
> + .silence = { 0x69, 0x69 },
> + },
> + [SNDRV_PCM_FORMAT_DSD_U32_BE] = {
> + .width = 32, .phys = 32, .le = 0, .signd = 0,
> + .silence = { 0x69, 0x69, 0x69, 0x69 },
> + },
> /* FIXME: the following three formats are not defined properly yet */
> [SNDRV_PCM_FORMAT_MPEG] = {
> .le = -1, .signd = -1,
> diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
> index 2c1018e..bc9ebb6 100644
> --- a/sound/usb/quirks.c
> +++ b/sound/usb/quirks.c
> @@ -1202,12 +1202,12 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,
> /* iFi Audio micro/nano iDSD */
> case USB_ID(0x20b1, 0x3008):
> if (fp->altsetting == 2)
> - return SNDRV_PCM_FMTBIT_DSD_U32_LE;
> + return SNDRV_PCM_FMTBIT_DSD_U32_BE;
> break;
> /* DIYINHK DSD DXD 384kHz USB to I2S/DSD */
> case USB_ID(0x20b1, 0x2009):
> if (fp->altsetting == 3)
> - return SNDRV_PCM_FMTBIT_DSD_U32_LE;
> + return SNDRV_PCM_FMTBIT_DSD_U32_BE;
> break;
> default:
> break;
> --
> 1.9.1
>
prev parent reply other threads:[~2014-11-21 14:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-21 14:04 [PATCH] alsa-kernel: Add big-endian DSD sample formats and fix XMOS DSD sample format Jussi Laako
2014-11-21 14:04 ` [PATCH] alsa-lib: Fix DSD sample format endianess and add big-endian format Jussi Laako
2014-11-21 14:12 ` Takashi Iwai
2014-11-21 14:11 ` Takashi Iwai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hvbm8ve1g.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=jussi@sonarnerd.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox