Commit graph

21 commits

Author SHA1 Message Date
Aidan MacDonald
e532714d1f pcm: Remove unused function pcm_play_dma_get_peak_buffer()
Change-Id: Ifd20fb14a22489cdb99154c01f69809a1e70d0c5
2021-07-25 14:07:41 +00:00
Solomon Peachy
388adff3cc pcm: Further cleanup of unused bits of the PCM ACPI:
* 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
2020-11-12 15:59:09 +00:00
Solomon Peachy
fe2d52cc7d pcm: Get rid of pcm_play_pause() and associated APIs
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
2020-10-31 01:18:27 +00:00
Cástor Muñoz
7442742208 iPod Classic: disable IRAM1
On Classic, IRAM1 (second 128Kb of a total of 256KB available IRAM) is
slower than DRAM. Codecs that actually are using regions of IRAM1 runs
faster when DRAM is used, so IRAM1 is disabled and only IRAM0 remains
enabled: 48KB for core and 80KB for codecs/plugins.

The next test_codec results shows how decode time is decreased:

file           boosted     unboosted
*.ra           ~1.5%       ~0.5%
*.mpc          ~21%        ~4.5%
*.ogg          ~0.5%       ~0%
nero_he*.m4a   ~8%         ~1%
nero*.m4a      ~25%        ~7%
wmapro*.wma    ~4.5%       ~0%
wma*.wma       ~25%        ~7%

In addition there is a small power save when IRAM1 HW is disabled.

Change-Id: I102adee11458e82037f23076d5d5956e23235de8
2018-07-30 18:50:27 -04:00
Cástor Muñoz
954d934ad2 iPod Classic: fix small bug on PCM record
On PCM record initialization, an unknown clockgate is enabled instead
of the I2S clockgate. This bug does not produce incorrect functionallity
because the right clockgate is already enabled on PCM playback
initialization.

Change-Id: I97a3a4a6f12131e492c1431359a0a976b68014be
2017-01-13 05:06:15 +01:00
Cástor Muñoz
291b2338c9 ipod Classic: implement HAVE_RECORDING
This patch has been tested on iPod 80 and 160slim, actually
it works but some updates must be done to the final version:

 - unlimitted input buffer
 - decrease CHUNK_SIZE
 - use non-cached addresses instead of discard d-cache ???

Capture hardware versions:

 Ver  iPod models   capture support
 ---  -----------   ---------------
 0    80/160fat     dock line-in
 1    120/160slim   dock line-in + jack mic

 HW version 1 includes an amplifier for the jack plug mic.

 Capture HW detection only tested on iPod 80 and 160slim.

CODEC power:

 AFAIK, OF powers CS42L55 at VA=2.4V for capture (1.8V for
 playback) and turns on the ADC charge pump. CODEC datasheet
 recommmends to disable the charge pump for VA>2.1V.

 CS42L55 DS, s4.13 (Required Initialization Settings): for
 VA>2.1V, some adjustments "must" be done using undocummented
 "control port compensation" registers. OF does not modifies
 these registers when VA=2.4V.

 This patch configures capture HW in the same way as OF does.

TODO:
 - ADC full scale voltage depends on VA, perform tests to find
   clipping levels for VA=1.8V and VA=2.4V

Change-Id: I7e20fd3ecaa83b1c58d5c746f5153fe5c3891d75
2015-10-07 06:15:03 +02:00
Cástor Muñoz
67b4e7f958 iPod Classic: use new PL080 DMA driver
This patch uses the new pl080 DMA driver for I2S playback and LCD
update. I have tried to be as fiel as possible to the current
behaviour, algorithms and configurations are the same, but using
the new driver. Other modifications:

Playback:

 - CHUNK_SIZE is decreased from 42988 to 8188 bytes, it does not
   affect normal playback (block size 1024), was tested using
   metronome (block size 46080). This change is needed because the
   new code commits d-cache range instead of commiting the whole
   d-cache, maximum time spent commiting the range should be
   limited, CHUNK_SIZE can be decreased even more if necessary.

 - pcm_play_dma_start() calls pcm_play_dma_stop() to stop the
   channel when it is running (metronome replays the tick sound
   without stopping the channel).

 - pcm_play_dma_get_peak_buffer(): same as actual SVN function but
   returns samples count instead of bytes count.
   TODO: AFAIK, actually this function is not used in RB. Not tested,
   but probably this function will fail because it returns pointers
   to the internal double buffer.

LCD update:

 - suppresses lcd_wakeup semaphore and uses yield()

Change-Id: I79b8aa47a941e0dd91847150618f3f7f676c26ef
2015-10-07 06:15:03 +02:00
Cástor Muñoz
794169a18f iPod Classic: fix HW_FREQ_32
Change-Id: I1e1b4e6ceb92eb793affaefc61ab082d5da735b4
2014-11-18 06:22:32 +01:00
Cástor Muñoz
758a3ae4bb iPod Classic/6G: PCM support for all CS42L55 rates
pcm_dma_apply_settings(): sets the configured PCM frequency,
all native CS42L55 sample rates are available.

Change-Id: I2fcd5581457a669c3044516804cb64fb972218d0
2013-01-09 22:08:28 +01:00
Michael Sevakis
cd8e11b463 Tweak some PCM drivers for less typecasting with the data pointer.
Yeah, sizeof (void) here with GCC is 1. If something has a problem
with that, we'll set it straight.

Change-Id: I9ad3eee75dd440f6404a04a501d1533c8bc18ba9
2012-03-04 08:52:50 -05:00
Michael Sevakis
59e5a323f1 Fix errors in unintentionally merged gerrit commit.
It proved the system work as unintended, even if slightly prematurely.
It was almost ready anyway.

Change-Id: Ic4de2b925bd26b094eaf65a120591569923954d1
2012-03-03 01:45:09 -05:00
Michael Sevakis
286a4c5caa Revise the PCM callback system after adding multichannel audio.
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>
2012-03-03 07:23:38 +01:00
Cástor Muñoz
8c7d372e45 FS#12519 - iPod Classic/6G: swap L-R audio channels by Cástor Muñoz
Fixes swapped left and right channels on ipod 6g and changes the
i2s config to send samples as 16 bits instead of 16 zero padded to
24 bits to the dac.

Change-Id: Icfecfdf0f6868bdb01c11dced604ebfceb874aa1
Signed-off-by: Nils Wallménius <nils@rockbox.org>
2012-02-25 14:51:52 +01:00
Michael Sevakis
09769827fe Swap red and yellow for green on r31339's cranky builds.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31340 a1c6a512-1295-4272-9138-f99709370657
2011-12-17 07:54:00 +00:00
Torne Wuff
569285794b Bulk convert all DOS line endings to UNIX.
For the git migration we want a nice clean repository with UNIX line
endings. git does not use svn:eol-style, we just need the file contents to be
sane.

Sorry everybody. I know this messes up blame.

Scumbag *NIX developer says migrating to git will make line ending issues go
away; commits giant change to svn which changes line endings anyway. :)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30924 a1c6a512-1295-4272-9138-f99709370657
2011-11-06 22:44:25 +00:00
Michael Sevakis
4db3e89652 Shuffle some functions around so that interfacing with playback.c in particular isn't required. Though playback does finish the audio init, pcm doesn't care who does it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30403 a1c6a512-1295-4272-9138-f99709370657
2011-09-01 12:15:43 +00:00
Michael Sevakis
a2b6703a36 Commit FS#12150 - Fully-functional audio mixer - and finally whip old limitations about playback of voice and other sounds when paused. Channels are independent in state and amplitude. Fade on stop/pause is handled by the channel's volume control rather than global volume which means it now works from anywhere. Opens up the possibility of plugin sounds during music playback by merely adding an additional channel enum. If any PCM drivers were not properly modified, see one of the last comments in the task for a description of the simple change that is expected. Some params are tunable in firmware/export/pcm-mixer.h as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30097 a1c6a512-1295-4272-9138-f99709370657
2011-06-29 06:37:04 +00:00
Michael Sparmann
46945eff06 iPod Classic: Fix remaining PCM issues and add DMA information to the HW debug screen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28991 a1c6a512-1295-4272-9138-f99709370657
2011-01-07 15:16:17 +00:00
Michael Sparmann
67a85912c8 Fix yellow
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28990 a1c6a512-1295-4272-9138-f99709370657
2011-01-07 14:00:37 +00:00
Michael Sparmann
c7b8d07181 Fix iPod Classic playback slowness
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28989 a1c6a512-1295-4272-9138-f99709370657
2011-01-07 13:55:33 +00:00
Michael Sparmann
152847977a New port: iPod Classic (also known as iPod 6G/6.5G/7G)
Major known issues:
- No bootloader yet
- No support for the first-generation 160GB CE-ATA hard disk drive yet
- Audio playback is slow, only FLAC seems to reach realtime


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28953 a1c6a512-1295-4272-9138-f99709370657
2011-01-02 23:16:27 +00:00