Commit Graph

5 Commits

Author SHA1 Message Date
Peter Ujfalusi 75f850fc22 ALSA: pcm_dmaengine: Correct support for 24bits physical sample widths
In case of _3LE/_3BE formats the samples are stored in 3 consecutive bytes
without padding it to 4 bytes. This means that the DMA needs to be able to
support 3 bytes word length in order to read/write the samples from memory
correctly. Originally the code treated 24 bits physical length samples as
they were 32 bits which leads to corruption when playing or recording audio.

The hw.formats field has already been prepared to exclude formats not
supported by the DMA engine in use, which means that only on platforms where
3 bytes is supported by the DMA will be able to use this format.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-04 18:55:25 +01:00
Peter Ujfalusi 732814c8ff ALSA: pcm_dmaengine: Use the available wrapper to get physical width
params_physical_width() is available via pcm_params.h

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-04 18:55:17 +01:00
Tushar Behera 02fb05a598 ALSA: pcm_dmaengine: Add check during device suspend
Currently snd_dmaengine_pcm_trigger() calls dmaengine_pause()
unconditinally during device suspend. In case where DMA controller
doesn't support PAUSE/RESUME functionality, this call is not able
to stop the DMA controller. In this scenario, audio playback doesn't
resume after device resume.

Calling dmaengine_pause/dmaengine_terminate_all conditionally fixes
the issue.

It has been tested with audio playback on Samsung platform having
PL330 DMA controller which doesn't support PAUSE/RESUME.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-19 11:31:24 +02:00
Takashi Iwai a655f75c75 ALSA: pcm_dmaengine: Remove hardcoded PCM formats
Use the standard PCM helper function to figure out the sample bytes
instead of hardcodec PCM format checks in
snd_hwparams_to_dma_slave_config().

The patch also extends the format check for 8 bytes formats although
no one should match so far.

Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-28 10:18:09 +01:00
Daniel Mack b7ae6f31d8 ALSA: move dmaengine implementation from ASoC to ALSA core
For the PXA DMA rework, we need the generic dmaengine implementation
that currently lives in sound/soc for standalone (non-ASoC) AC'97
support.

Move it to sound/core, and rename the Kconfig symbol.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-15 11:18:09 +01:00