Commit graph

33 commits

Author SHA1 Message Date
Thomas Martitz
5296af838c Buflib: Clarification about invalid handles
* Enhance allocation function comments to better state the return value and what an invalid value is
* Change clients to check for "< 0" instead of "<= 0" or "== 0"
* Return -1 or -2 depending on the exact failure in buflib_alloc_ex.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30469 a1c6a512-1295-4272-9138-f99709370657
2011-09-07 23:16:29 +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
Frank Gevaerts
00c0221800 Make scrobbler_flush_cache() static
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30235 a1c6a512-1295-4272-9138-f99709370657
2011-08-01 19:43:13 +00:00
Thomas Jarosch
3ced180f5d Treat unknown RaaA platforms like SDL for last.FM scrobbler log file. Fix yellow
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29315 a1c6a512-1295-4272-9138-f99709370657
2011-02-15 21:32:53 +00:00
Thomas Jarosch
81614c428c RaaA: Fix last.FM scrobbler log file location
The .scrobbler.log or .scrobbler-timeless.log file
resides in the USB mass storage area. The exact location
differs for every RaaA platform.

The SDL platform sticks it in ROCKBOX_DIR for now.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29314 a1c6a512-1295-4272-9138-f99709370657
2011-02-15 21:13:03 +00:00
Thomas Martitz
9c0b2479f7 Rockbox as an application: add get_user_file_path().
For RaaA it evaluates user paths at runtime. For everything but codecs/plugins it will give the path under $HOME/.config/rockbox.org if write access is needed or if the file/folder in question exists there (otherwise it gives /usr/local/share/rockbox).
This allows for installing themes under $HOME as well as having config.cfg and other important files there while installing the application (and default themes) under /usr/local.

On the DAPs it's a no-op, returing /.rockbox directly.

Not converted to use get_user_file_path() are plugins themselves, because RaaA doesn't build plugins yet.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27656 a1c6a512-1295-4272-9138-f99709370657
2010-08-01 16:15:27 +00:00
Thomas Martitz
35e8b1429a Rockbox as an application: Replace many occurences of #ifdef SIMULATOR with #if (CONFIG_PLATFORM & PLATFORM_HOSTED) (or equivalently).
The simulator defines PLATFORM_HOSTED, as RaaA will do (RaaA will not define SIMULATOR).
The new define is to (de-)select code to compile on hosted platforms generally.

Should be no functional change to targets or the simulator.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27019 a1c6a512-1295-4272-9138-f99709370657
2010-06-21 16:53:00 +00:00
Thomas Martitz
50a6ca39ad Move c/h files implementing/defining standard library stuff into a new libc directory, also standard'ify some parts of the code base (almost entirely #include fixes).
This is to a) to cleanup firmware/common and firmware/include a bit, but also b) for Rockbox as an application which should use the host system's c library and headers, separating makes it easy to exclude our files from the build.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25850 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 21:04:40 +00:00
Thomas Martitz
0a1d7c28b7 Make open() posix compliant api-wise. A few calls (those with O_CREAT) need the additional optional mode parameter so add it. Impact for the core is almost zero, as open() is a wrapper macro for the real open function which doesn't take the variable parameter.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25844 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 17:35:13 +00:00
Jeffrey Goode
5cbf4a5289 Fix yellow, again
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23447 a1c6a512-1295-4272-9138-f99709370657
2009-10-31 19:57:52 +00:00
Jeffrey Goode
9a4420bf96 FS#10739: playback.c code split
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23444 a1c6a512-1295-4272-9138-f99709370657
2009-10-31 19:17:36 +00:00
Thomas Martitz
774bacc692 Correct wrong usage of event callbacks all over the place. It's not supposed to return anything, and should take a data parameter.
Fixing it because correcting the event api prototypes causes many warnings.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23301 a1c6a512-1295-4272-9138-f99709370657
2009-10-20 21:54:44 +00:00
Frank Gevaerts
2f8a0081c6 Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do that, it also introduces sd_*, nand_*, and mmc_*.
This should be a good first step to allow multi-driver targets, like the Elio (ATA/SD), or the D2 (NAND/SD).


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18960 a1c6a512-1295-4272-9138-f99709370657
2008-11-01 16:14:28 +00:00
Jonathan Gordon
71898e5c54 Accept FS#9480 - centralise and organise the events in the apps/ layer.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18819 a1c6a512-1295-4272-9138-f99709370657
2008-10-16 10:38:03 +00:00
Björn Stenberg
51b45d5602 Split id3.c/h into metadata.c/h and metadata/mp3.c. Updated all references. Moved mp3data.c/h from firmware to apps.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18814 a1c6a512-1295-4272-9138-f99709370657
2008-10-15 06:38:51 +00:00
Robert Keevil
2c170356f3 FS#9139 - support for ver 1.1 scrobbler log files. Upload any old files first - uploading software may need updating, see the LastFMLog wiki page
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18732 a1c6a512-1295-4272-9138-f99709370657
2008-10-07 18:39:44 +00:00
Daniel Stenberg
2acc0ac542 Updated our source code header to explicitly mention that we are GPL v2 or
later. We still need to hunt down snippets used that are not. 1324 modified
files...
http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-06-28 18:10:04 +00:00
Bertrik Sikken
5c5e849196 Remove racy call to unregister_ata_idle_func and remove unnecessary check before calling register_ata_idle_func. Should fix FS#8993 - Freeze on shutting down.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17647 a1c6a512-1295-4272-9138-f99709370657
2008-05-28 18:12:13 +00:00
Bertrik Sikken
16c8f060e6 Protect scrobbler_shutdown against multiple invocations, preventing double unregister of ata_idle callback. Probable fix for FS#8993 - Freeze on shutting down.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17533 a1c6a512-1295-4272-9138-f99709370657
2008-05-15 23:02:22 +00:00
Nils Wallménius
fd1e1b7706 Slight clean up and binsize save
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17122 a1c6a512-1295-4272-9138-f99709370657
2008-04-15 18:10:22 +00:00
Jonathan Gordon
a67e5d89ef It makes more sense for the callback registrar to decide if its a "oneshot" then the callback caller.
(Doing it this way means playback could(/should?) registar a disk spinup callback at init which is called every spinup without needing to be reregistered)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16685 a1c6a512-1295-4272-9138-f99709370657
2008-03-17 05:22:53 +00:00
Miika Pekkarinen
19c6e66c13 Implement the playback event handling as a system-wide multi-purpose event system. Unified mpeg.c and playback.c audio event handling. Converted ata_idle_notify to use the new event handling system also.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16682 a1c6a512-1295-4272-9138-f99709370657
2008-03-16 13:55:16 +00:00
Miika Pekkarinen
f98f76e415 Fixed red. HWCODEC platforms still use the old api.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16550 a1c6a512-1295-4272-9138-f99709370657
2008-03-08 00:02:51 +00:00
Miika Pekkarinen
2ccdc48ee9 Rewritten playback event handling. Should fix runtime statistics gathering.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16546 a1c6a512-1295-4272-9138-f99709370657
2008-03-07 22:56:51 +00:00
Peter D'Hoye
12d2d0fbc2 A patch by Robert Keevil that's been in the tracker way to long, fixes FS #6213: Audioscrobbler incorrectly submits last song
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13699 a1c6a512-1295-4272-9138-f99709370657
2007-06-24 18:46:04 +00:00
Jens Arnold
2c7b127dd7 Set CONFIG_RTC to 0 for non-RTC targets, and check with #if to profit from -Wundef. No code change.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12811 a1c6a512-1295-4272-9138-f99709370657
2007-03-16 23:47:03 +00:00
Robert Kukla
ae08eeb4ff remove runtime detection of h1x0 series RTC MOD, but leave driver code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12554 a1c6a512-1295-4272-9138-f99709370657
2007-03-03 00:11:20 +00:00
Robert Kukla
50b5ee4781 FS#6419 - driver for H1x0 series RTC Mod with runtime detection
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12520 a1c6a512-1295-4272-9138-f99709370657
2007-02-28 13:20:36 +00:00
Jonathan Gordon
26d8dce20a Accept FS#6644 - use the ata_idle_nofity stuff for the last.fm logging
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12267 a1c6a512-1295-4272-9138-f99709370657
2007-02-11 05:34:14 +00:00
Linus Nielsen Feltzing
cf8251281c Removed executable flag
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11966 a1c6a512-1295-4272-9138-f99709370657
2007-01-09 23:22:14 +00:00
Linus Nielsen Feltzing
f309f818ce Put the CVS revision in the CLIENT string in the scrobbler log file
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11270 a1c6a512-1295-4272-9138-f99709370657
2006-10-19 10:25:10 +00:00
Linus Nielsen Feltzing
da153da0be Patch #5166 by Robert Keevil - Last.fm logging
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11269 a1c6a512-1295-4272-9138-f99709370657
2006-10-19 09:42:58 +00:00