Age | Commit message (Collapse) | Author |
|
Add required ioctl constants for i2s loopback tests.
Audio test framework is using these ioctls for setting
pcm format paramters for I2S loopback test.
Change-Id: Id192668c5e9937e3cb42f8712a982f214e999289
Reviewed-on: http://git-master/r/59524
Reviewed-by: Rahul Mittal <rmittal@nvidia.com>
Reviewed-by: Vijay Mali <vmali@nvidia.com>
Tested-by: Vijay Mali <vmali@nvidia.com>
Reviewed-by: Scott Peterson <speterson@nvidia.com>
Rebase-Id: R5cb6bfb63d281559d992818c2a2a95cb00fba78d
|
|
Added some ioctl constants required for audio test framework use cases
like DAM mixing and APBIF channel validation
Change-Id: Icc536fbb2cfd28f89ac760cd67b24e5a46892d7d
Reviewed-on: http://git-master/r/56222
Tested-by: Rahul Mittal <rmittal@nvidia.com>
Reviewed-by: Scott Peterson <speterson@nvidia.com>
Rebase-Id: Re03b618eb7923447c13d0732641be8a2bf80e75f
|
|
Added EXPORT_SYMBOL to functions to be used by loadable kernel module
for audio test framework. Also added ioctl declarations for the same.
Change-Id: Id8a023c1d76fd031c042c7c663bb0e1df2d33b5c
Reviewed-on: http://git-master/r/52333
Tested-by: Rahul Mittal <rmittal@nvidia.com>
Reviewed-by: Vijay Mali <vmali@nvidia.com>
Reviewed-by: Scott Peterson <speterson@nvidia.com>
Rebase-Id: Rfdc9fd3b9a42b2ee601c273480f9986ab897f046
|
|
- Refactor DMA interactions to handle continuous single-buffered DMA
- Remove PIO support (obsolete, conflicts with new buffer management)
- Remove sample rate conversion (obsolete)
- Remove error-reporting logic
- Remove TEGRA_AUDIO_IN/OUT_GET/SET_BUF_CONFIG
- Add TEGRA_AUDIO_IN/OUT_GET/SET_NUM_BUFS
Change-Id: I8f21a0bb314aac3b7d1bb4918bda9141e58db38d
Signed-off-by: Iliyan Malchev <malchev@google.com>
|
|
-- Ignore kfifo thresholds on recording and playback and adjust the delays.
-- Take out the code from TEGRA_AUDIO_IN_STOP into a separate function
stop_recording_nosync()
-- Rename stop_recording() to wait_for_recording_to_stop().
-- add ioctl(TEGRA_AUDIO_OUT_FLUSH), which blocks the caller until the output
fifo is drained. While the caller is blocked, pending write() calls will
return immediately with whatever data they had managed to queue up.
-- removed ioctl(TEGRA_AUDIO_OUT_PRELOAD_FIFO)
-- since TEGRA_AUDIO_OUT_FLUSH and TEGRA_AUDIO_IN_STOP act similarly, moved
audio_driver_state::recording_cancelled to audio_stream::stop and changed
the code accordingly. Renamed functions wait_for_recording_to_stop() and
stop_recording_nosync() to wait_till_stopped() and request_stop_nosync()
since they handle both playback and recording.
-- print errors on close() if wakelocks are still held
-- Call request_stop_nosync() on close() of a recording file handle
-- Do not use struct audio_stream::active for playback streams. Instead,
where applicable, use kfifo_len(). As a consequence, playback kfifo
underruns are no longer reported. These were bogus anyway, as we really
need the DMA engine to tell us if there are underruns.
-- Because of above item, had to rework tx_fifo_atn_store(),
rx_fifo_atn_store(), and __attr_fifo_atn_write().
-- Set struct audio_stream::active for a recording stream to true when a
recording starts, and set it to false when recording get stopped. Do not
set/clear it within the body of read(), because just being within read()
does not mean that recording is in progress.
-- In tegra_audio_read(), check for stop == true before calling
start_recording_if_necessary(); this makes sure that if a user calls read()
after calling ioctl(TEGRA_AUDIO_IN_STOP), recording will not resume unless
ioctl(TEGRA_AUDIO_IN_START) gets called, or the file is closed and
re-opened.
-- Fixed TEGRA_AUDIO_IN_START
-- In PIO mode, enabled FIFOs before enabling interrupts as specified in the
TRM.
-- Added missing break in tegra_audio_ioctl().
-- Silenced some debug spew
Signed-off-by: Iliyan Malchev <malchev@google.com>
|
|
Added an ioctl to set the bit format for I2S between "DSP"/"PCM" mode and
normal mode (set by board file)
Signed-off-by: Iliyan Malchev <malchev@google.com>
|
|
This patch replaces the error counter with two separate error counters, one for
late dma callbacks, and another for overruns (during recording) or underruns
(during playback). The ioctls TEGRA_AUDIO_IN_GET_ERROR_COUNT and
TEGRA_AUDIO_OUT_GET_ERROR_COUNT now take a pointer to a struct containing both
error counters.
Signed-off-by: Iliyan Malchev <malchev@google.com>
|
|
Add an ioctl to allow the TX fifo to be loaded with data before playback
starts. Playback can then be started by calling write() on the FIFO, even
with a length of 0. This will cause the pending data to be played out.
Signed-off-by: Iliyan Malchev <malchev@google.com>
|
|
-- Use consistently the various state flags:
-- active is set only when there is a read or write in flight
-- recording_canncelled is set only when recording is stopped via the ioctl()
-- dma_has_it is used to determine whether DMA is already in flight; do not
use the state of the fifos for this (e.g., if the TX fifo is empty, do not
assume that playback is stopped)
-- added a stop_completion (implemented for readers only) so that readers
closing a stream can wait until DMA or PIO transactions are stopped
-- Split /dev/audio0_{in,out} into /dev/audio0_{in,in_ctl,out,out_ctl} where the
_ctl versions have the ioctl()s
-- Introduced an error count per audio_stream; error count is reset on open, can
be read back & reset through an ioctl
Signed-off-by: Iliyan Malchev <malchev@google.com>
|
|
-- Add ioctls for configuring buffer, threshold, and DMA-transaction sizes from
user space.
-- Buffer sizes are provided in orders of magnitude.
-- Allocate max-sized buffers during probe, and allow the user to resize them
only within the original allocation, to avoid the risk from kmalloc failing
due to kernel-heap fragmentation, and also to avoid race conditions on DMA
shut-down.
-- In tegra_audio_write(), moved the call to start_playback_if_necessary()
immediately after writing to the fifo. Otherwise, when the fifo size is
smaller than what the user is trying to write, the user will block before
playback is started.
-- Silenced printk spew on spinning on i2s registers after transactions are
completed.
-- Cleaned up a 80-col style violation in downsample()
Signed-off-by: Iliyan Malchev <malchev@google.com>
|
|
downsampling:
-- add ioctl()s to downsample recorded data
-- supported frequencies are 8kHz, 11.025kHz, 22.05kHz, and 44.1kHz
-- downsamping to stereo and mono
-- default is 11.025kHz mono
fixes:
-- fix crashes from dequeuing DMA requests twice
Signed-off-by: Iliyan Malchev <malchev@google.com>
|
|
-- add audio_in_stream (identical to audio_out_stream, may merge them later)
-- add support for DMA and PIO recording
-- add ioctls for /dev/audio<n>_in to start and stop recording
Signed-off-by: Iliyan Malchev <malchev@google.com>
|