Commit graph

8708 commits

Author SHA1 Message Date
Thomas Martitz
7e14b935df Dircache: Allow dircache to be enabled without reboot.
Also add two dircache function, one of which does what dircache_disable()
did previously as this now also frees the dircache buffer.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30393 a1c6a512-1295-4272-9138-f99709370657
2011-08-30 21:07:46 +00:00
Bertrik Sikken
e66ad3e8a8 sansa clipzip: implement backlight
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30390 a1c6a512-1295-4272-9138-f99709370657
2011-08-30 19:13:44 +00:00
Bertrik Sikken
99f260ef49 sansa clipzip: fix bounds check/correction in lcd_update_rect
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30389 a1c6a512-1295-4272-9138-f99709370657
2011-08-30 18:14:20 +00:00
Thomas Martitz
bb000ce525 Fix last yellows.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30385 a1c6a512-1295-4272-9138-f99709370657
2011-08-30 14:38:16 +00:00
Thomas Martitz
0c4c81620f Fix h100 red and other warnings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30384 a1c6a512-1295-4272-9138-f99709370657
2011-08-30 14:32:16 +00:00
Thomas Martitz
baa070cca6 GSoC/Buflib: Enable compaction in buflib.
This enables the ability to allocate (and free) memory dynamically
without fragmentation, through compaction. This means allocations can move
and fragmentation be reduced. Most changes are preparing Rockbox for this,
which many times means adding a move callback which can temporarily disable
movement when the corresponding code is in a critical section.

For now, the audio buffer allocation has a central role, because it's the one
having allocated most. This buffer is able to shrink itself, for which it
needs to stop playback for a very short moment. For this,
audio_buffer_available() returns the size of the audio buffer which can
possibly be used by other allocations because the audio buffer can shrink.

lastfm scrobbling and timestretch can now be toggled at runtime without
requiring a reboot.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30381 a1c6a512-1295-4272-9138-f99709370657
2011-08-30 14:01:45 +00:00
Thomas Martitz
d0b72e2590 GSoC/Buflib: Add buflib memory alocator to the core.
The buflib memory allocator is handle based and can free and
compact, move or resize memory on demand. This allows to effeciently
allocate memory dynamically without an MMU, by avoiding fragmentation
through memory compaction.

This patch adds the buflib library to the core, along with
convinience wrappers to omit the context parameter. Compaction is
not yet enabled, but will be in a later patch. Therefore, this acts as a
replacement for buffer_alloc/buffer_get_buffer() with the benifit of a debug
menu.

See buflib.h for some API documentation.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30380 a1c6a512-1295-4272-9138-f99709370657
2011-08-30 14:01:33 +00:00
Bertrik Sikken
17fcb4cfe3 sansa clipzip: correct GPIO used for backlight
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30377 a1c6a512-1295-4272-9138-f99709370657
2011-08-29 21:08:24 +00:00
Bertrik Sikken
401edf8b48 sansa clipzip: implement more functions in the lcd driver
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30376 a1c6a512-1295-4272-9138-f99709370657
2011-08-29 21:05:59 +00:00
Michael Sevakis
7ad2cad173 Commit work started in FS#12153 to put timing/position information in PCM
buffer chunks.

* Samples and position indication is closely associated with audio data
  instead of compensating by a latency constant. Alleviates problems with
  using the elapsed as a track indicator where it could be off by several
  steps.

* Timing is accurate throughout track even if resampling for pitch shift,
  whereas before it updated during transition latency at the normal 1:1 rate.

* Simpler PCM buffer with a constant chunk size, no linked lists.

In converting crossfade, a minor change was made to not change the WPS until
the fade-in of the incoming track, whereas before it would change upon the
start of the fade-out of the outgoing track possibly having the WPS change
with far too much lead time.

Codec changes are to set elapsed times *before* writing next PCM frame because
 time and position data last set are saved in the next committed PCM chunk. 


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30366 a1c6a512-1295-4272-9138-f99709370657
2011-08-28 07:45:35 +00:00
Bertrik Sikken
463b3ed8b2 Initial framework for the Sandisk Sansa Clip Zip
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30365 a1c6a512-1295-4272-9138-f99709370657
2011-08-27 16:21:19 +00:00
Thomas Martitz
c08299cedd Dircache: Fix memory leak (and recently panic).
If the dircache was interrupted during generation (e.g. through USB
insertion), then the allocated buffer was leaked and a new one
was allocated for the second cache generation. This causes a
panic since r30308 since playback holds the control over the
audiobuffer at that time.

The fix is to simply check allocated_size instead of
dircache_size which is reset to 0 upon cancellation.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30321 a1c6a512-1295-4272-9138-f99709370657
2011-08-16 13:01:03 +00:00
Thomas Martitz
4087875f1c Dircache: Fix bug introduced in r30308.
dircache_root wasn't initialized at all and the giving allocated_size
passed to buffer_release_buffer() didn't account for alignment padding.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30318 a1c6a512-1295-4272-9138-f99709370657
2011-08-15 15:13:17 +00:00
Frank Gevaerts
bf34cdfacb Add a 100ms delay before calling disk_mount_all(). Some players (especially some gigabeat Fs) seem to need a delay after disabling USB if we want disk access to work.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30316 a1c6a512-1295-4272-9138-f99709370657
2011-08-15 14:36:23 +00:00
Thomas Martitz
8a701e5488 Fix errors and warnings.
The buffer_offset paramter of audio_init_recording() is removed as it
was unused in both implementations.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30310 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 15:37:05 +00:00
Thomas Martitz
7695b0403f Fix typo in and clarify comment.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30309 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 15:21:26 +00:00
Thomas Martitz
d1322b7159 GSoC/Buflib: Replace all direct accesses to audiobuf with buffer API functions.
Namely, introduce buffer_get_buffer() and buffer_release_buffer().
buffer_get_buffer() aquires all available and grabs a lock, attempting to
call buffer_alloc() or buffer_get_buffer() while this lock is locked will cause
a panicf() (doesn't actually happen, but is for debugging purpose).
buffer_release_buffer() unlocks that lock and can additionally increment the
audiobuf buffer to make an allocation. Pass 0 to only unlock if buffer was
used temporarily only.
buffer_available() is a replacement function to query audiobuflen, i.e. what's
left in the buffer.
Buffer init is moved up in the init chain and handles ipodvideo64mb internally.

Further changes happened to mp3data.c and talk.c as to not call the above API
functions, but get the buffer from callers. The caller is the audio system
which has the buffer lock while mp3data.c and talk mess with the buffer.
mpeg.c now implements some buffer related functions of playback.h, especially
audio_get_buffer(), allowing to reduce #ifdef hell a tiny bit.

audiobuf and audiobufend are local to buffer.c now.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30308 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 15:13:00 +00:00
Thomas Martitz
c0a4c66f9d Android: Minor changes in ldebugf.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30304 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 13:58:39 +00:00
Bertrik Sikken
b2d0ea204c Remove a couple of duplicate #includes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30301 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 13:42:32 +00:00
Thomas Martitz
dbdbc242ac Remove hosted_get_volume(), as event data is available in button_get_data().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30300 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 13:38:10 +00:00
Marcin Bukat
3b0783068b Fix typos in comments. Thanks ukleinek for pointing out.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30270 a1c6a512-1295-4272-9138-f99709370657
2011-08-08 20:21:29 +00:00
Marcin Bukat
1d2fae4466 rk27xx sd driver fixes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30269 a1c6a512-1295-4272-9138-f99709370657
2011-08-08 20:09:27 +00:00
Thomas Martitz
44ffa3ef93 format/*printf: Add simple support for %p format specifier.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30249 a1c6a512-1295-4272-9138-f99709370657
2011-08-04 10:44:41 +00:00
Frank Gevaerts
936494f9c5 Lower the maximum brightness of the fuzev2 backlight even more.
The previous maximum (20) still causes excessive heat for some people, and measurements (using a digital camera and a white screen) show that the maximum brightness in the OF corresponds to 12 in rockbox, so we use 12 now.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30227 a1c6a512-1295-4272-9138-f99709370657
2011-07-31 15:30:07 +00:00
Thomas Martitz
32b54164d8 Dircache: Fix 2 nasty bugs introduced with the reworks starting with r30032.
The first is an off-by-one that leads to miscalculation of the dircache size.
The format string size was used but dircache size was incremented by the snprintf() result which is smaller.
The other forgot to update the location of the "." and ".." strings upon compaction,
so that new folders got assigned orphaned pointers for those directory entires.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30224 a1c6a512-1295-4272-9138-f99709370657
2011-07-30 23:21:58 +00:00
Michael Giacomelli
62d666df6f Convert AMSv2 microphone samples from 14 to 16 bit before storing them.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30209 a1c6a512-1295-4272-9138-f99709370657
2011-07-25 01:00:15 +00:00
Michael Giacomelli
c27ea297a3 Commit FS#12111 by Stephan Grossklass. Disables output mixer auto gain control on AMSv2. Should fix occasional distortion reported when running the player at very high output levels (e.g. at or above 0dB).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30208 a1c6a512-1295-4272-9138-f99709370657
2011-07-24 21:56:24 +00:00
Amaury Pouly
855e3c6f0f imx233/fuze+: implement lcd_blit_yuv (untested)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30207 a1c6a512-1295-4272-9138-f99709370657
2011-07-24 19:12:27 +00:00
Amaury Pouly
1df8072c08 imx233/fuze+: cleanup sd code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30206 a1c6a512-1295-4272-9138-f99709370657
2011-07-24 19:12:23 +00:00
Bertrik Sikken
0157c62418 ipod nano 1g: enable readout of battery current through ADC channel 4066_ISTAT
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30204 a1c6a512-1295-4272-9138-f99709370657
2011-07-24 17:32:50 +00:00
Amaury Pouly
fa0f17d9b0 imx233/fuze+: move page table to dram
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30201 a1c6a512-1295-4272-9138-f99709370657
2011-07-23 13:48:01 +00:00
Amaury Pouly
eb90d95693 imx233/fuze+: huge rework
- enable MMU
-rework lcd frame buffer
- add rtc/adc/power stubs (or not)
- fix a few MMC related defines (hopefully)
- implement cache handling for DMA
- more SD work
- add keymap (based on clip)
- add virtual buttons
- update linker scripts
- big step toward apps actually compiling

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30200 a1c6a512-1295-4272-9138-f99709370657
2011-07-23 11:45:22 +00:00
Amaury Pouly
06c94740e5 imx233/fuze+: prepare target to enable MMU
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30199 a1c6a512-1295-4272-9138-f99709370657
2011-07-23 11:45:18 +00:00
Amaury Pouly
82f70b8efd imx233/fuze+: add SD detection support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30196 a1c6a512-1295-4272-9138-f99709370657
2011-07-22 15:45:58 +00:00
Amaury Pouly
85c32dbd12 imx233/fuze+: add pin irq support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30195 a1c6a512-1295-4272-9138-f99709370657
2011-07-22 15:45:50 +00:00
Amaury Pouly
7d1d4c6f07 imx233/fuze+: implement gpio interrupts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30194 a1c6a512-1295-4272-9138-f99709370657
2011-07-22 15:45:46 +00:00
Amaury Pouly
792dd33047 imx233/fuze+: gives bootloader argument to main
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30193 a1c6a512-1295-4272-9138-f99709370657
2011-07-22 15:45:42 +00:00
Thomas Martitz
c2a6214ecc Android: Fix crash on start up.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30190 a1c6a512-1295-4272-9138-f99709370657
2011-07-22 06:50:41 +00:00
Bertrik Sikken
2f620b8af3 ipod nano 1g: enable LCD invert
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30182 a1c6a512-1295-4272-9138-f99709370657
2011-07-20 22:05:16 +00:00
Bertrik Sikken
1f72825444 ipod nano 1g: show lcd type debug info, make more room for iap debug info
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30181 a1c6a512-1295-4272-9138-f99709370657
2011-07-20 21:21:31 +00:00
Thomas Martitz
b2f52477df Android: Change headphone detection to call into native.
Making a JNI call from tick tasks is not permitted as the underlying thread
is not attached to the Java VM. This is an error and crashes in the emulator
(which has stricter JNI checks enabled by default).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30173 a1c6a512-1295-4272-9138-f99709370657
2011-07-19 23:44:56 +00:00
Frank Gevaerts
b8bfa84d1b Fix "variable 'result' set but not used" warning
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30172 a1c6a512-1295-4272-9138-f99709370657
2011-07-19 21:06:30 +00:00
Frank Gevaerts
6c5c3495ca Disable ipod video battery capacity default detection for bootloader and simulator
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30171 a1c6a512-1295-4272-9138-f99709370657
2011-07-19 20:55:59 +00:00
Frank Gevaerts
aa27d47782 Set the default battery capacity for ipod video properly depending on detected RAM size.
Also set up a callback for the battery capacity setting (for all players) so changes take effect without having to reboot.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30170 a1c6a512-1295-4272-9138-f99709370657
2011-07-19 20:48:16 +00:00
Marcin Bukat
31b7ecb09b rk27xx - use more correct function to map between percived lightness and PWM fill factor when setting backlight brightness
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30168 a1c6a512-1295-4272-9138-f99709370657
2011-07-19 18:29:30 +00:00
Marcin Bukat
5d9b230168 rk27xx - implement cache_commit_discard(). Cache is still not enabled in crt0.S
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30167 a1c6a512-1295-4272-9138-f99709370657
2011-07-19 06:49:03 +00:00
Marcin Bukat
f1c7fba5a4 rk27xx - add missing interrupt source
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30166 a1c6a512-1295-4272-9138-f99709370657
2011-07-18 22:30:53 +00:00
Marcin Bukat
8fba4fb937 rk27xx - fix (hopefully) adc readings
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30164 a1c6a512-1295-4272-9138-f99709370657
2011-07-18 22:00:17 +00:00
Thomas Martitz
33de9cdaef Android: Refactor some of the glue code.
* Cleanup RockboxService.java by moving the battery and
  headphone monitors to separate classes and detaching their instances
* Move those monitors and RockboxTelephony.java into a new
  monitors subdirectory
* Call those monitors all the same from native code by creating
  the objects there

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30160 a1c6a512-1295-4272-9138-f99709370657
2011-07-18 21:02:47 +00:00
Thomas Martitz
1b7ff725c6 Revert "Introduce bsearch() and use it in tagtree.c."
It was committed by accident (it's on FS still).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30157 a1c6a512-1295-4272-9138-f99709370657
2011-07-18 18:57:50 +00:00