All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: "Tan, Seng Kai" <seng.kai.tan@intel.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Cc: Takashi Iwai <tiwai@suse.com>
Subject: Re: Question about Conversion to S24_LE from S24_3LE
Date: Tue, 19 Apr 2016 09:27:19 +0200	[thread overview]
Message-ID: <5715DDD7.7060907@ladisch.de> (raw)
In-Reply-To: <61B6C8BF61481342973655BC8AB0FF355AEFE5@PGSMSX101.gar.corp.intel.com>

Tan, Seng Kai wrote:
> The input to the driver should be 0x123456 (3 byte, no padding)
> And the driver supposed to arrange it to 0x12345600 (4 byte, LSB padding for left justified)

No, the kernel driver should never change sample data.

If the hardware supports only 32-bit-aligned samples, then the driver
must declare that.  Any needed conversions are then done in user space.

>>> S24_LE in wav file
>
> qwavheaderdump -F ~/Public/workspace/aud_file/Tones/2ch_48sine_S24_LE.wav
>         channels: 2
>         sample rate: 48000
>         bytes/second: 384000
>         bytes/sample: 8
>         bits/sample: 24

This is not correct according to the .wav specification; the
wBitsPerSamples field must be the container size, which is 32 here (as
shown by nChannels and nBlockAlign).

If the number of valid bits is less than the container size, the file
must use the wValidBitsPerSample field in the WAVEFORMATEXTENSIBLE
structure.

Anyway, .wav files cannot describe or use S24_LE samples, they use
either S32_LE (as in this file) or S24_3LE.


Regards,
Clemens

  reply	other threads:[~2016-04-19  7:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18  9:24 Question about Conversion to S24_LE from S24_3LE Tan, Seng Kai
2016-04-18  9:32 ` Clemens Ladisch
2016-04-18  9:54   ` Tan, Seng Kai
2016-04-18 12:01     ` Clemens Ladisch
2016-04-19  0:57       ` Tan, Seng Kai
2016-04-19  7:27         ` Clemens Ladisch [this message]
     [not found] <13855858.72631345077438708.cxe06701@nifty.ne.jp>
2012-08-16  5:41 ` Takashi Iwai
     [not found] ` <24633629.312801345103755036.cxe06701@nifty.ne.jp>
2012-08-16  9:16   ` Takashi Iwai
2012-08-16  9:41     ` Jaroslav Kysela
     [not found] ` <11973478.303981345442271456.cxe06701@nifty.ne.jp>
2012-08-20  6:47   ` Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2012-08-10  0:28 Fujikawa, Kazutoshi
2012-08-10  6:13 ` Takashi Iwai
2012-08-10  8:44   ` Fujikawa, Kazutoshi
2012-08-10 10:00     ` Takashi Iwai
2012-08-10 14:45     ` Clemens Ladisch

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=5715DDD7.7060907@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=seng.kai.tan@intel.com \
    --cc=tiwai@suse.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.