* pcm_get_bytes_remaining()
* pcm_calculate_peaks()
* pcm_get_peak_buffer()
Nothing in-tree uses these at all (except for the lua plugin wrapper)
Change-Id: I971b7beed6760250c8b1ce58f401a601e1e2d585
Nothing in the core has used it for some time. It's exported to the
plugin API but the last plugins to use it were switched to the mixer API
back in 2011.
This allows us to get rid of pcm_play_dma_pause() from all audio drivers
Change-Id: Ic3fa02592316f84963e41d792d1cabb436d1ff6b
Additional status callback is added to pcm_play/rec_data instead of
using a special function to set it. Status includes DMA error
reporting to the status callback. Playback and recording callback
become more alike except playback uses "const void **addr" (because
the data should not be altered) and recording uses "void **addr".
"const" is put in place throughout where appropriate.
Most changes are fairly trivial. One that should be checked in
particular because it isn't so much is telechips, if anyone cares to
bother. PP5002 is not so trivial either but that tested as working.
Change-Id: I4928d69b3b3be7fb93e259f81635232df9bd1df2
Reviewed-on: http://gerrit.rockbox.org/166
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
Fix problems with volume of recorded material by converting 14-bit samples to
16-bit. Remove duplicate samples from recorded data and support proper
samplerate since ADC runs 1/2 the codec clock. Support monitoring mono on both
output channels by feeding data manually to I2SOUT under the right conditions.
DMA is no longer used for recording since frames must be processed as described
above but it does allow full-duplex audio.
Miscellaneous change includes a proper constant (HW_SAMPR_DEFAULT) to reset the
hardware samplerate when recording is closed. PP5024 and AS3525 have different
default recording rates (22kHz and 44kHz respectively) but both have half-speed
ADC.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31180 a1c6a512-1295-4272-9138-f99709370657
Fix the asm constraints to mark the left output variable as earlyclobber
Thanks to amiconn
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26777 a1c6a512-1295-4272-9138-f99709370657
When building with eabi gcc, 2 variables are assigned the same register
This might be a bug in the constraints, but it's just simpler to use C,
even at the cost of 1 cycle per loop
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26761 a1c6a512-1295-4272-9138-f99709370657
preventing the DMA callback to advance in the recording buffer is not
enough in pcm_rec_dma_get_peak_buffer()
we need to prevent it interrupting us while we are copying the left
channel data into the right channel
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26663 a1c6a512-1295-4272-9138-f99709370657
this removes workaround for spurious interrupts added in r26316
side effect: make keyclicks work correctly when used intensively (with
the scrollwheel for example), the clicks should be inserted fast enough
for the PCM fifo to not become empty.
PL190 can cause spurious interrupts if an interrupt is triggered by a
peripheral shortly before the interrupt for this peripheral is cleared
from VIC registers.
As an effect we should only write in VIC_INT_EN_CLEAR after having
disabled the source of the interrupt in the peripheral.
references on PL190 spurious interrupts:
- http://www.embeddedrelated.com/groups/lpc2000/show/14599.php
- http://water.cse.unsw.edu.au/esdk/lpc2/spurious-irq.html
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26444 a1c6a512-1295-4272-9138-f99709370657
Even if we disable it in VIC_INT_EN_CLEAR, it still fires an interrupt
by running the default isr.
Locking requires disabling interrupts completely.
I'm not sure if DMAC is the only interrupt affected or if we can't rely
on VIC_INT_EN_CLEAR to mask interrupts.
If it's the latter, we will need to have special locking scheme for
INT_AUDIO.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26316 a1c6a512-1295-4272-9138-f99709370657
Indent the asm constraints at the same level than instructions
Also add a trick to reduce the number of instructions outputted by gcc
in the commented C version of the loop
The difference between C and asm is now 1 instruction
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26027 a1c6a512-1295-4272-9138-f99709370657
This fixes the error introduced in r25989, where it would release the
DMA engine when uninitializing recording.
The real bug has been fixed instead (in pitch_detector)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26003 a1c6a512-1295-4272-9138-f99709370657
also avoid disabling completely the DMA engine in pitch_detector
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25989 a1c6a512-1295-4272-9138-f99709370657
Flyspray: FS#10371
Authors: Fred Bauer and myself
Only enabled on e200v2 and Fuze (crashes on clipv1)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23739 a1c6a512-1295-4272-9138-f99709370657
When read it returns all enabled interrupt sources
When written it enables interrupt sources for each bit set
So just like VIC_INT_EN_CLEAR, we don't have to read the previous value
before writing to it (VIC_INT_EN_CLEAR is write-only anyway)
Thanks to Fred Bauer for spotting
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23734 a1c6a512-1295-4272-9138-f99709370657
Init CGU_AUDIO with correct clock source (for play & rec)
Do not disable recording clocks when starting playback, they are already disabled
Move clock enable/disable code from dma callback to init
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23493 a1c6a512-1295-4272-9138-f99709370657
Unaligned memory ops will cause a data abort anyway
Make the check for samplerate at buildtime
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23480 a1c6a512-1295-4272-9138-f99709370657
Still disabled on all targets:
- Fuze and e200v2 see spurious interrupts with no source defined
- Clip/m200v4 deadlock instantly when starting recording (perhaps due to low memory size)
Having the code in SVN will make working on this feature easier
Also add keymaps for Fuze, and correct Frequency section of recording
options : the 22.05kHz limitation of e200v1 and c200v1 doesn't apply to
Sansa AMS (different I2S hardware, unrelated to as3514)
Flyspray: FS#10371
Authors: Fred Bauer and myself
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23476 a1c6a512-1295-4272-9138-f99709370657
The bits which are not divider (i2si/i2so enable and clock selection)
would be unset.
This is not a problem in the current code since this function was always
called before starting playback (and setting those bits) but this might
be a problem when recording is enabled.
Finally it is simpler to read.
Thanks to Fred Bauer for pointing this.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23156 a1c6a512-1295-4272-9138-f99709370657
- cache IRAM and DRAM
- map IRAM just next to DRAM to remove the need for -mlong-calls and reduce binsize
- tweak delays in Fuze button code
- tweak delays in Clip button code (down button sometimes doesn't respond anyway : an alternate driver is being worked on)
Before reporting any problem, please check your filesystem or format your player from the OF
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21228 a1c6a512-1295-4272-9138-f99709370657
Add dma_retain() and dma_release() to reference count the users
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19344 a1c6a512-1295-4272-9138-f99709370657