All of lore.kernel.org
 help / color / mirror / Atom feed
* Playback formats; does aplay pad S16_LE, or does the hardware?
@ 2017-04-02 23:40 Rob Nertney
  2017-04-04  9:11 ` Clemens Ladisch
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Nertney @ 2017-04-02 23:40 UTC (permalink / raw)
  To: alsa-devel

I can successfully play 32b@32KHz and 32b@16KHz to my I2S DAC.

I can also, with the same settings as 32b@16KHz, play 16b@32KHz, but I
don't think this is the way ALSA wants its data....

I've learned that hw_params is responsible for describing only what the
hardware is supposed to be capable of. Does this mean the hardware needs to
find a way to pad 0's on lower quality data for any given rate?

For example, when I play 32b @32 KHz, everything works. If I play 16b@32KHz,
I shouldn't change any output clocks, but will also present the data on a
32bit data bus as 16bits padded with 0? Or does it pack the data such that
the hardware needs to determine that it's in 16b mode, and pad the data
itself?

Thanks,
Rob

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Playback formats; does aplay pad S16_LE, or does the hardware?
  2017-04-02 23:40 Playback formats; does aplay pad S16_LE, or does the hardware? Rob Nertney
@ 2017-04-04  9:11 ` Clemens Ladisch
  0 siblings, 0 replies; 2+ messages in thread
From: Clemens Ladisch @ 2017-04-04  9:11 UTC (permalink / raw)
  To: Rob Nertney, alsa-devel

Rob Nertney wrote:
> I can successfully play 32b@32KHz and 32b@16KHz to my I2S DAC.
>
> I can also, with the same settings as 32b@16KHz, play 16b@32KHz, but I
> don't think this is the way ALSA wants its data....
>
> I've learned that hw_params is responsible for describing only what the
> hardware is supposed to be capable of.

The hw_params values describe the format of the samples in memory.
(If alsa-lib does format conversion, the application and the driver see
different hw_params values.)

What the hardware does with the samples after the DMA controller has
read them from memory is of no concern to the ALSA framework.

> Does this mean the hardware needs to find a way to pad 0's on lower
> quality data for any given rate?

If the hardware is capable of that, then the driver can support 16-bit
samples.  (I don't know of any I²S controller that cannot do that.)

> For example, when I play 32b @32 KHz, everything works. If I play 16b@32KHz,
> I shouldn't change any output clocks, but will also present the data on a
> 32bit data bus as 16bits padded with 0?

Which bus?  The memory bus, or the I²S bus?


Regards,
Clemens

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-04  9:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-02 23:40 Playback formats; does aplay pad S16_LE, or does the hardware? Rob Nertney
2017-04-04  9:11 ` Clemens Ladisch

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.