Commit graph

797 commits

Author SHA1 Message Date
Michael Sevakis
6510973223 Give playback engine better control over the codec. Codec simply follows commands and doesn't concern itself with audio state. Get track change notification in on the actual last buffer insert of the track because now audio simply waits for a track change notify from PCM on the last track and it must be sent reliably. This is still at an intermediate stage but works. Codecs and plugins become incompatible.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29387 a1c6a512-1295-4272-9138-f99709370657
2011-02-23 14:31:13 +00:00
Magnus Holmgren
efba46f980 FS#11933: Check for external album art if embedded album art fails to load.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29319 a1c6a512-1295-4272-9138-f99709370657
2011-02-16 18:06:50 +00:00
Michael Sevakis
bdec638b9b Always do proper mp3entry copying instead of using bufread directly. Add bufreadid3() helper.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29279 a1c6a512-1295-4272-9138-f99709370657
2011-02-10 22:03:39 +00:00
Michael Sevakis
edfff8a5ef audio_peek_track should copy the struct mp3entry instead of pointing directly into the buffer. Despite the dire warning, caller does in fact yield/sleep and its usage is too nonlocalized to control that reliably.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29275 a1c6a512-1295-4272-9138-f99709370657
2011-02-10 10:26:07 +00:00
Thomas Martitz
86cab2e27a Disable buffering codecs (and code generally) on RaaA.
It's not useful to do it since you need to write back the code to disk to be able to load it from memory, it also requires writing to an executable directory.
Keep it for the simulator for the sake of simulating.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29261 a1c6a512-1295-4272-9138-f99709370657
2011-02-09 20:27:23 +00:00
Thomas Martitz
f577a6a22c Embedded album art support in MP3/ID3v2 tags.
- Support is limited to non-desync jpeg in id3v2 tags. Other formats (hopefully) follow in the future.
- Embedded album art takes precedence over files in album art files.
- No additional buffers are used, the jpeg is read directly from the audio file.

Flyspray: FS#11216
Author: Yoshihisa Uchida and I

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29259 a1c6a512-1295-4272-9138-f99709370657
2011-02-09 20:13:13 +00:00
Michael Hohmuth
7141ff4513 Add option to resume next track on automatic track change
Move autoresume setting into its own menu.  Add option to customize
which tracks should be resumed on automatic track change.  Tracks can
be selected based on their their file location or genre tag
(comma-separated list of filename / genre substrings).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29251 a1c6a512-1295-4272-9138-f99709370657
2011-02-08 20:31:35 +00:00
Michael Hohmuth
4844142e16 Do not update resume information and do not log statistics when a
track is interrupted within the first 15 seconds.

Regard a rewind to 0:00 as a track restart (updating resume position /
playback statistics before the rewind and starting the 15 s delay).

This allows skipping forward across an unplayed track without changing
its resume offset.  Also, it is possible to skip backward to the
previous track after rewinding to the current track to 0:00 (pressing
Left twice) without losing the current track's resume position.

Initially contributed by Dave Slusher

Caveats:

* Works only for SWCODEC
* Skipping forward without altering the resume position does not work
  when skip to outro has been turned on.
* The 15-second window in which the resume offset will not be updated
  should start at the initial resume position, not at 0:00.  This
  would allow skipping over partially played tracks without altering
  the resume position.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29250 a1c6a512-1295-4272-9138-f99709370657
2011-02-08 20:31:27 +00:00
Michael Giacomelli
66e8fc0f0d Commit part of FS#11748 by Michael Hohmuth. Adds support for automatically resuming any song that is not played to completion at any point later in time, regardless of how many intermediate tracks are played. This is accomplished by expanding the database to record incompletely played tracks. Currently, the feature is simply on or off, in which case all tracks automatically resume, or they do not. The remainder of patches in the task expand this feature by allowing only certain file to automatically resume, only resuming in certain circumstances, etc but are not included until we reach agreement on what should be included. Additionally, the manual will need to be updated once we agree on the available settings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28942 a1c6a512-1295-4272-9138-f99709370657
2011-01-02 02:49:13 +00:00
Jonathan Gordon
3dc5f59625 Accept FS#11721 by Michael Hohmuth
Fix Runtime statistics data not gathered when playback stops


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28644 a1c6a512-1295-4272-9138-f99709370657
2010-11-23 00:13:14 +00:00
Rafaël Carré
589490c6c5 don't cast to int when not needed
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27954 a1c6a512-1295-4272-9138-f99709370657
2010-08-30 23:08:12 +00:00
Rafaël Carré
99207d6475 panicf() is declared in panic.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27952 a1c6a512-1295-4272-9138-f99709370657
2010-08-30 23:02:35 +00:00
Rafaël Carré
634028385d audio_reset_buffer: check audiobuffer size not only in DEBUG builds
(DEBUG builds do not work/build anyway)
Also use a shorter message

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27951 a1c6a512-1295-4272-9138-f99709370657
2010-08-30 22:57:02 +00:00
Magnus Holmgren
113764d9c0 Fix FS#11175. playlist_peek() wasn't thread safe (due to a static filename buffer), so frequent calls from the main thread would cause the audio thread to buffer the wrong track.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27773 a1c6a512-1295-4272-9138-f99709370657
2010-08-11 19:01:50 +00:00
Rafaël Carré
2494afccc4 playback.c: don't assume cacheline size is 16 bytes
ideally all targets should define CACHEALIGN_BITS, for now we default it
to 16 bytes if it's not specified

Since the buffer is already aligned in playback.c no need to align it
again in buffering.c

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27073 a1c6a512-1295-4272-9138-f99709370657
2010-06-23 04:34:18 +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
Jonathan Gordon
b8d98fcc19 Change cuesheet handling so the id3 info is not spoofed anymore. If something wants the subtracks info it is easy to get to. This makes next track display in the skins show the next subtrack if we are in a cuesheet
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26611 a1c6a512-1295-4272-9138-f99709370657
2010-06-06 06:28:40 +00:00
Jonathan Gordon
7d5e0d7375 FS#11263 - Radio Art support! %C and %Cl tags work in the radio screen and Base Skin when the radio is running.
put your station images in .rockbox/fmpresets/<preset name>.bmp or .jpg. Must be in preset mode and the preset name must match the filename


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26078 a1c6a512-1295-4272-9138-f99709370657
2010-05-16 11:13:42 +00:00
Jonathan Gordon
1bd072c92d FS#10853 - Skin support in the radio screen! Check CustomWPS for the new tags
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25964 a1c6a512-1295-4272-9138-f99709370657
2010-05-12 10:38:00 +00:00
Magnus Holmgren
d38093de2f FS#11099 - Rewind before resume
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25706 a1c6a512-1295-4272-9138-f99709370657
2010-04-24 14:10:28 +00:00
Jonathan Gordon
6c175effc5 drop the playlist viewer stack usage by reading straiught off the buffer instead of copying it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25661 a1c6a512-1295-4272-9138-f99709370657
2010-04-17 12:02:02 +00:00
Andree Buschmann
c736696390 Minor clean up in playback.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25178 a1c6a512-1295-4272-9138-f99709370657
2010-03-14 18:25:42 +00:00
Andree Buschmann
c18e80e127 Implement resume for alac codec.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25169 a1c6a512-1295-4272-9138-f99709370657
2010-03-14 16:05:12 +00:00
Magnus Holmgren
75e105a6a3 Make the buffer low-level watermark (and the related anti-skip setting) work again. Update the buffering 'base handle' as new tracks start playing, since this is needed to determine how much playable data is left in the buffer. Should fix the buffering problem reported in the forums (http://forums.rockbox.org/index.php?topic=24014.0), and also makes the usefl line in the buffering thread debug screen useful again.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24968 a1c6a512-1295-4272-9138-f99709370657
2010-02-28 13:02:02 +00:00
Thomas Martitz
df79ac2f9d Fix FS#11004 - Buffering crashes when skipping back from end of song.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24755 a1c6a512-1295-4272-9138-f99709370657
2010-02-18 15:38:30 +00:00
Jonathan Gordon
fea4689e91 Get rid of those horrible macros to protect against NULL reference when looking up the id3 info for tokens.
Change the way the wps playlist viewer gets the token values. All %i tokens are now supported (and a few others, experiment :) )


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24233 a1c6a512-1295-4272-9138-f99709370657
2010-01-15 07:20:56 +00:00
Jonathan Gordon
dc0ba917fa FS#10898 - Add a playlist viewer to the WPS. http://www.rockbox.org/wiki/CustomWPS#Playlist_viewer for an exaplanation how to use it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24220 a1c6a512-1295-4272-9138-f99709370657
2010-01-13 06:02:38 +00:00
Michael Giacomelli
ecd9bcf3cb Commit FS#10605 - stable playback on low memory swcodec targets by Matthias Schneider. Should allow stable playback on targets with less then 4MB of RAM and sofware decoding such as the Sandisk Clip, c200v2, m200v4 and probably others. Fixes several problems in buffering that occured when the files to be buffered weren't much smaller then the ring buffer size. Fixes a bug where move_handle would corrupt the audio buffer when trying to copy a handle that both wrapped around the highest address in the ring buffer and overlapped part of the source and desination ranges. Moves the decision in playback.c about when to update the current track handle from audio_check_new_track to after the metadata has been buffered. Corrects several other minor pieces of code. I've logged about 100 hours without a crash on various players with this patch but its possible it breaks some combination of players and features I haven't thought to test.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23680 a1c6a512-1295-4272-9138-f99709370657
2009-11-21 17:00:38 +00:00
Jeffrey Goode
db82be4390 Cleanup audio.h, related functions
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23651 a1c6a512-1295-4272-9138-f99709370657
2009-11-16 20:09:46 +00:00
Jeffrey Goode
ba9280d5f4 pcmbuf cleanup
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23649 a1c6a512-1295-4272-9138-f99709370657
2009-11-16 04:42:34 +00:00
Jeffrey Goode
664dc90e71 Crossfade: added a new option, rewrote decision logic, updated manual and menus. Translators please note that updated translations may be required for some crossfade menu items!
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23605 a1c6a512-1295-4272-9138-f99709370657
2009-11-11 00:48:17 +00:00
Jeffrey Goode
9e0953432a Crossfade: carved out crossfade related code with lots of HAVE_CORSSFADE conditionals, eliminated fade buffer on low memory targets
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23597 a1c6a512-1295-4272-9138-f99709370657
2009-11-10 03:46:08 +00:00
Jeffrey Goode
20db9cc39e Playback: removed duplicate functions
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23576 a1c6a512-1295-4272-9138-f99709370657
2009-11-09 05:43:19 +00:00
Jeffrey Goode
04b01e1831 pcmbuf: clarify and simplify crossfade code, etc.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23538 a1c6a512-1295-4272-9138-f99709370657
2009-11-05 21:59:36 +00:00
Jeffrey Goode
5ce8e2cb0d Clarify track transition code in pcmbuf and playback. No functional changes yet.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23506 a1c6a512-1295-4272-9138-f99709370657
2009-11-04 03:58:33 +00:00
Jeffrey Goode
8f04d5a1dc Playback.c: Eliminate repetitive watermark calculation when the buffer is idle. Also fix evil comment
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23487 a1c6a512-1295-4272-9138-f99709370657
2009-11-02 15:57:20 +00:00
Jeffrey Goode
582225967f Tweak logf statements
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23486 a1c6a512-1295-4272-9138-f99709370657
2009-11-02 15:50:56 +00:00
Jeffrey Goode
e8eefe98bf Code cleanup in codec_thread, playback and pcmbuf; more elegant solution to leftover samples
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23471 a1c6a512-1295-4272-9138-f99709370657
2009-11-01 19:39:23 +00:00
Jeffrey Goode
03c5cb6503 Fix yellow, defines
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23446 a1c6a512-1295-4272-9138-f99709370657
2009-10-31 19:49:58 +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
Thomas Martitz
1016ee4e80 Initial custom statusbar commit.
The custom statusbar can be used as a WPS for the main UI, using .(r)sbs files. It's using the skin engine and knows all tags the WPS also knows.
The default folder for .sbs is the wps folder to reuse images used in the WPS.
As it can be shown in the WPS also, it's useful to move shared parts to the custom statusbar in order to save skin buffer space.
There are a few restrictions/TODOs:
*) Peak meter doesn't redraw nicely(not frequent enough), as very frequent updates would slow the UI down as hell (some targets fight with it in the WPS already: FS#10686)
*) No touchregion support as the statusbar doesn't have any action handling (it won't fail to parse though).
*) Drawing stuff into the default VP is forbidden (loading images in it is not). You *need* to use viewports for the displaying stuff (parsing fails if no viewport is used).
*) Themes that don't use a custom ui viewport can be fixed up using the new %Vi tag to avoid nasty redraw effectts (you must not draw into it as well, it's used to fix up the ui viewport). %Vi describes the viewport that the lists can use without getting in the way of the statusbar.

Otherwise, it behaves like the classic statusbar, it can be configured in the theme settings, and can be turned off in the wps using %wd.

Note to translaters: When translating LANG_STATUSBAR_CUSTOM, please consider using the same translation as for LANG_CHANNEL_CUSTOM if it's compatible. They could be combined later then.

Flyspray: FS#10566
Author: myself

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23258 a1c6a512-1295-4272-9138-f99709370657
2009-10-19 15:28:15 +00:00
Thomas Martitz
e9c10189e9 Rework albumart buffering internally to allow for mutliple albumart sizes.
Playback now has a few albumart slots. Anything (most importantly: skins)  can obtain such a slot.
The slot has fields for the size which is passed to bufopen then to image_load to buffer the albumart with the proper size.
Currently there's 1 slot. We can increase it for remotes if we want. Custom statusbar will increase it.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23209 a1c6a512-1295-4272-9138-f99709370657
2009-10-16 19:14:41 +00:00
Maurus Cuelenaere
6bfce3bf63 Remove unused defines
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22470 a1c6a512-1295-4272-9138-f99709370657
2009-08-23 00:25:55 +00:00
Bertrik Sikken
0307cd16a0 Remove some unused #includes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22183 a1c6a512-1295-4272-9138-f99709370657
2009-08-06 08:20:06 +00:00
Thomas Martitz
3b75c86d74 A bit mroe wps/skin engine cleanup so that the structs the wps uses can be static:
-add wrappers wps_data_load() and wps_data_init() so that other code doesn't need the structs for that
-change (and rename) gui_sync_wps_uses_albumart() to take points to be filled as parameter to get the AA size of a wps

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22139 a1c6a512-1295-4272-9138-f99709370657
2009-08-03 15:06:30 +00:00
Mohamed Tarek
5f5d105755 Change the naming scheme for codecs found in different containers.
Like changing AFMT_AAC to AFMT_MP4_AAC and AFMT_RAAC to AFMT_RM_AAC.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22066 a1c6a512-1295-4272-9138-f99709370657
2009-07-27 12:13:22 +00:00
Jonathan Gordon
e96da7e52f Get cuesheets working again (hopefully fixes FS#10460), on swcodec only read the cuesheet from the buffer once
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22012 a1c6a512-1295-4272-9138-f99709370657
2009-07-23 05:23:54 +00:00
Jonathan Gordon
c46669a230 fix FS#10453 - the cuesheet changes broke playback on swcodec, rework it so it uses the audio buffer instead of a temp buffer from the start (which also removes one pretty big memcpy)
also remove the audio_filename from the cuesheet struct as its useless


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21982 a1c6a512-1295-4272-9138-f99709370657
2009-07-20 15:50:26 +00:00
Jonathan Gordon
24b136f62d rework cuesheet support:
swcodec: search for a .cue during buffering (with the possibility of adding embedded cuesheets later)
hwcodec: search for a .cue when the id3 info for the current track is requested for the first time (disk should be spining so non issue)

major beenfit from this is simplofy cuesheet handling code a bit... if mp3entry.cuesheet != NULL then there is a valid cuesheet.. no need to worry about if its enabled and preloaded.
There is the possibility of putting the next/prev subtrack handling inside the playback code (as well as the id3 updating stuff (see FS#9789 for more info), but thats probably not a good idea.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21978 a1c6a512-1295-4272-9138-f99709370657
2009-07-20 05:18:18 +00:00
Nils Wallménius
3d4701a6e4 FS#10080
* Move strncpy() from core to the pluginlib
* Introduce strlcpy() and use that instead in most places (use memcpy in a few) in core and some plugins
* Drop strncpy() from the codec api as no codec used it
* Bump codec and plugin api versions


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21863 a1c6a512-1295-4272-9138-f99709370657
2009-07-14 13:57:45 +00:00
Thomas Martitz
16e339d087 Bugfix for FS#10157 - "inaccurate seeking while paused" by Jeffrey Goode.
The pcmbuffer wasn't reset after subsequent seeks (i.e. all but the first one) when seeking while paused. This caused the buffer to be filled only once and so the wrong sound was played upon resuming. Now we make sure the pcmbuffer is always reset when not playing (a more detailed explaination is in the task).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21570 a1c6a512-1295-4272-9138-f99709370657
2009-06-29 19:24:48 +00:00
Thomas Martitz
8c5c92dc2c FS#10377 - "PCM buffer remainder is played under too many conditions" by Jeffrey Goode.
Prevents playing the remainder of the pcmbuf on manual stop, as it isn't needed in this case. Now the remainder is only played when the music automatically plays out.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21569 a1c6a512-1295-4272-9138-f99709370657
2009-06-29 19:13:50 +00:00
Dan Everton
d52c6614c5 Commit FS#10335 from Jeffrey Goode.
Ensure that the PCM buffer is flushed at the end of the last track in a
playlist.



git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21316 a1c6a512-1295-4272-9138-f99709370657
2009-06-17 08:47:51 +00:00
Thomas Martitz
fc0c2fb546 Fix FS#10101 and FS#8999. Buffering was stopped prematurely if a manual track skip occured in between, leaving the CPU boosted, because audio_fill_file_buffer() returned if a new track was requested no matter of the filling state. Now keep buffering if it's currently filling the buffer.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21244 a1c6a512-1295-4272-9138-f99709370657
2009-06-10 17:15:10 +00:00
Bertrik Sikken
0023943439 Fix duplicate #includes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20977 a1c6a512-1295-4272-9138-f99709370657
2009-05-17 14:50:19 +00:00
Boris Gjenero
7f94a9d02f In audio_current_track(), don't overwrite thistrack_id3 when it is being used by the codec. This fixes divide by zero errors when selecting other files while a FLAC file is playing. See FS#10102.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20764 a1c6a512-1295-4272-9138-f99709370657
2009-04-21 03:33:39 +00:00
Boris Gjenero
745e35c2d9 Fix red introduced in r20747
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20749 a1c6a512-1295-4272-9138-f99709370657
2009-04-19 20:01:36 +00:00
Boris Gjenero
b71aad65f5 Add anti-skip buffer time when calculating watermark. This fixes the "Anti-Skip Buffer" setting. Since the minimum and default value is 5 seconds, this is relevant even when that setting isn't changed. It prevents playback pauses on the 5G iPod, and it should also prevent pauses on other SWCODEC hard drive based players, including FS#10115.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20747 a1c6a512-1295-4272-9138-f99709370657
2009-04-19 19:38:56 +00:00
Jonathan Gordon
140c7e6f66 fix FS#10102 (progress doesnt get updated on the first track of a boot) and hopefully dont introduce any extra wierdness...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20705 a1c6a512-1295-4272-9138-f99709370657
2009-04-14 00:44:05 +00:00
Boris Gjenero
265d855031 Remove unnecessary copying of current track id3 data back into the buffer. It was used before when track_unbuffer_callback existed, but now PLAYBACK_EVENT_TRACK_FINISH takes care of this.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20638 a1c6a512-1295-4272-9138-f99709370657
2009-04-07 05:32:38 +00:00
Jonathan Gordon
843c7efaf8 FS9795 - some playback cleanup.
* Use events to notify things when the track has changed instead of the nasty has_track_changed()
* Event for when the mp3entry for the next track is avilable (which allows alot more tags to be static which means less redrawing in the WPS)
* virtually guarentee that the mp3entry sturct returned by audio_current/next_track() is going to be valid for the duration of the current track. The only time it wont be now is during the time between the codec finishing the previous track and the next track actually starting (~2s), but this is not an issue as long as it is called again when the TRACK_CHANGED event happens (or just use the pointer that gives)
It is still possible to confuse the WPS with the next tracks id3 info being displayed but this should fix itself up faster than it used to (and be harder to do)



git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20633 a1c6a512-1295-4272-9138-f99709370657
2009-04-06 00:39:43 +00:00
Bertrik Sikken
66cf3a3329 Clean up some #includes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20238 a1c6a512-1295-4272-9138-f99709370657
2009-03-08 16:10:40 +00:00
Antonius Hellmann
76be948199 Correct comment and log message for failed AlbumArt bitmap loading.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20150 a1c6a512-1295-4272-9138-f99709370657
2009-03-01 07:46:08 +00:00
Antonius Hellmann
5355f34c55 Bugfix: If AlbumArt bitmap loading fails, dont try loading it over and over again, but simply ignore AlbumArt in this case.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20149 a1c6a512-1295-4272-9138-f99709370657
2009-03-01 07:39:57 +00:00
Thomas Martitz
6a67539780 Remove some unused code. bufopen for TYPE_ID3 can only return ERR_BUFFER_FULL (or a valid id of course) and no other error anyway.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20143 a1c6a512-1295-4272-9138-f99709370657
2009-02-28 20:08:30 +00:00
Frank Gevaerts
2c59de52d0 make audio_get_buffer() properly invalidate the buffer (FS#9935, fix by Nicolas Pennequin)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20106 a1c6a512-1295-4272-9138-f99709370657
2009-02-25 22:50:43 +00:00
Thomas Martitz
25b4334654 Now that filling is supposed to be reliable we can safely calculate the watermark at the end of buffering, not after every single track.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20095 a1c6a512-1295-4272-9138-f99709370657
2009-02-23 22:52:15 +00:00
Thomas Martitz
d7dee56b86 Set filling properly when codec doesn't fit too.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20094 a1c6a512-1295-4272-9138-f99709370657
2009-02-23 22:50:08 +00:00
Thomas Martitz
5e1bab1cd8 Fix two rare bugs which caused playback to not unboost. The filling state was not set properly, if there was no space left for the handle for albumart or audio data. but for the handle for metadata. This also adds specific checks for ERR_BUFFER_FULL and appropriate logf messages.
This also appears to fix the constant boosting part of FS#8999 (at least I couldn't reproduce). It does certainly not fix that buffering is stucked.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20093 a1c6a512-1295-4272-9138-f99709370657
2009-02-23 21:09:30 +00:00
Antonius Hellmann
56f4723d19 Check for buffer low condition in AlbumArt bitmap loading to assure correct AA display for all tracks.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20092 a1c6a512-1295-4272-9138-f99709370657
2009-02-23 16:21:05 +00:00
Michael Sevakis
21f0c9a282 Make basic cache functions into calls, and get rid of CACHE_FUNCTION_WRAPPERS and CACHE_FUNCTIONS_AS_CALL macros. Rename flush/invalidate_icache to cpucache_flush/invalidate. They're inlined only if an implementation isn't provided by defining HAVE_CPUCACHE_FLUSH/INVALIDATE.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19971 a1c6a512-1295-4272-9138-f99709370657
2009-02-11 12:55:51 +00:00
Bertrik Sikken
91948d12aa FS#9638 - temp_cue is unused and wasting memory.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19890 a1c6a512-1295-4272-9138-f99709370657
2009-01-31 19:41:29 +00:00
Björn Stenberg
53a76de82b Increased default watermark from 3 to 5 seconds.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19751 a1c6a512-1295-4272-9138-f99709370657
2009-01-11 23:21:31 +00:00
Björn Stenberg
6427d127aa Calculate watermark from bitrate and harddisk spinup time.
Use a smaller PCM buffer on targets with 2MB or less ram.
(FS#9703)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19743 a1c6a512-1295-4272-9138-f99709370657
2009-01-10 21:10:56 +00:00
Michael Sevakis
42d88cbafa Better just do some cache maintenence there for good luck.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19685 a1c6a512-1295-4272-9138-f99709370657
2009-01-05 10:48:50 +00:00
Michael Sevakis
2054627caa Have the codec thread do callbacks instead of messing with the stack which is much simpler and safer. Remove threads array from plugin API since it now serves no purpose. Up minimum API version and sort.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19684 a1c6a512-1295-4272-9138-f99709370657
2009-01-05 10:31:19 +00:00
Michael Giacomelli
70e9c7aed3 Commit FS#8624 by Linus Nielsen, Ryan Press, Craig Elliott, and Kenderes Tamas. Adds preliminary support for numerous accessories that use the ipod serial port on the dock connector. See IpodAccessories for a list of tested devices.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19585 a1c6a512-1295-4272-9138-f99709370657
2008-12-25 01:46:16 +00:00
Michael Sevakis
93572e2a9e Keyclick fixup take two. It is only 88 samples (2msec) long so keep a small static buffer around for beeps less than or equal to keyclick duration. This way it operates no matter the buffer state and still won't interfere with alternate PCM operations like recording or plugin playback.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19415 a1c6a512-1295-4272-9138-f99709370657
2008-12-13 06:01:08 +00:00
Michael Sevakis
826688e699 PCM buffer beeping needs the audio buffer reset in order to work after operations that trash the buffer or keyclick won't be audible until playback is restarted.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19413 a1c6a512-1295-4272-9138-f99709370657
2008-12-13 02:48:36 +00:00
Michael Sevakis
5e73f9ff20 Fix FS#8660-Recording hardlocks with keyclick enabled and FS#9388-keyclicks too late. Introduce audio_buffer_state to check whether PCM buffer is useable or disabled (trashed).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19411 a1c6a512-1295-4272-9138-f99709370657
2008-12-13 01:32:39 +00:00
Michael Sevakis
8cfbd3604f Use cookies for thread identification instead of pointers directly which gives a buffer against wrongly identifying a thread when the slot is recycled (which has been nagging me for awhile). A slot gets 255 uses before it repeats. Everything gets incompatible so a full update is required.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19377 a1c6a512-1295-4272-9138-f99709370657
2008-12-10 08:57:10 +00:00
Michael Sevakis
89da4328a0 Meg F/X can beep and click using a hardware timer so let us try it out. To match things up better, fix PCM beeping to give correct frequency (and get a pointer wrap bug too). Do some minor adjustments to compensate for corrections.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19355 a1c6a512-1295-4272-9138-f99709370657
2008-12-07 00:07:47 +00:00
Rafaël Carré
fb11a838eb playback: sanity check for pcmbuf_init() requirement (enabled in DEBUG)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19331 a1c6a512-1295-4272-9138-f99709370657
2008-12-04 20:36:41 +00:00
Jonathan Gordon
7bc50d1aa5 Fix FS#8282 - if next-dir fails resume the old playlist
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19324 a1c6a512-1295-4272-9138-f99709370657
2008-12-04 09:23:43 +00:00
Jonathan Gordon
8c23a36312 FS#8814 - remove the "restarting playback" splash because its pointless..
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19286 a1c6a512-1295-4272-9138-f99709370657
2008-12-01 12:08:29 +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
Magnus Holmgren
1b9991c229 Try to fix FS#9502: end playback properly if no valid files were found in a playlist.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18891 a1c6a512-1295-4272-9138-f99709370657
2008-10-26 20:15:10 +00:00
Jonathan Gordon
7b77910de4 fix FS#8124 - pressing STOP after seeking while paused causes playback to start again for a second or 2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18860 a1c6a512-1295-4272-9138-f99709370657
2008-10-22 09:59:42 +00:00
Nils Wallménius
2f50cd58b9 Codec memory reorganization
Based on a patch by Tomasz Malesinski
* Merge Codec buffer and Malloc buffer into one large buffer.
* The new merged buffer is now 1MB on targets with lots of memory.
* Renamed codec_get_memory to codec_get_buffer and made it behave more. 
like plugin_get_buffer.
* Bumped Codec api and min api versions.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18834 a1c6a512-1295-4272-9138-f99709370657
2008-10-19 12:35:53 +00:00
Jonathan Gordon
00a228fefb Accept FS#7482 by Klaas Bosteels - return the full path of a file which doesnt have valid tags yet (and use the end of the filename for the title) instead of before which was only using the filename
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18820 a1c6a512-1295-4272-9138-f99709370657
2008-10-16 11:11:45 +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
f30430f9a3 Added #include pcm_record.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18809 a1c6a512-1295-4272-9138-f99709370657
2008-10-14 12:15:14 +00:00
Frank Gevaerts
46573019a5 add HAVE_DISK_STORAGE, and use that instead of HAVE_FLASH_STORAGE when checking for an actual disk (i.e. related to spindown, skipping,...)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18735 a1c6a512-1295-4272-9138-f99709370657
2008-10-07 19:37:33 +00:00
Nils Wallménius
01729e7a18 FS#9281 Rename of splash functions.
* Remove gui_splash()
* Rename gui_syncsplash() to splashf() and remove its voice 
capabilities.
* Rename the internal splash() to splash_internal() and introduce an 
externally visible splash() that handles simple splashing  without 
printf functionality e.g. splash(HZ, ID2P(LANG_FOO)); or splash(HZ, 
"foo"); if a LANG_* id is passed it will be voiced.
* Adjust all places that called gui_syncsplash() to use the correct 
variant from above.
* Export both new functions to plugins and adjust places calling 
rb->splash() to use the correct variant so that we now have naming 
consistency between the core and plugins.
* Fix one latent bug that would cause my sim to crash with the above 
changes and correct P2STR and P2ID macros, thanks to pondlife.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18282 a1c6a512-1295-4272-9138-f99709370657
2008-08-15 08:27:39 +00:00
Stéphane Doyon
c893affeef Accept FS#8918: Voice multiple thumbnails and talk race fixes.
-Allows loading multiple thumbnails back-to-back in the one thumbnail buffer.
-Mutex to prevent race conditions with talk queue indices and
thumbnail buffer state.
-Synchronous shutup.
-Shutup is a noop if no voice is queued.
-mp3_play_stop() does nothing until the audio thread is ready.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18046 a1c6a512-1295-4272-9138-f99709370657
2008-07-15 14:06:11 +00:00
Nicolas Pennequin
f69982bb0b Fix FS#8977. The issue was caused by multiple successive calls to audio_load_track() happening before the corresponding calls to audio_finish_load_track(), resulting in disappearing tracks. I added the track_load_started boolean flag as a means to prevent audio_load_track() from doing anything if a call to audio_finish_load_track is pending.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17891 a1c6a512-1295-4272-9138-f99709370657
2008-06-30 16:20:46 +00:00
Nicolas Pennequin
0441afecd7 Fix FS#9110 and its maybe-dupes.
The issue happened when the value of 'filling' was STATE_FINISHED: the low_buffer_callback wouldn't do anything even when there would still be data remaining to be buffered, leading to a shortage of audio data. Only making the callback act even when filling is STATE_FINISHED (the simple fix) isn't right because of cases when the last track in the playlist is fully buffered. Therefore I added a new state to distinguish between when the last track is fully buffered (STATE_FINISHED) and when it isn't (STATE_END_OF_PLAYLIST).


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17875 a1c6a512-1295-4272-9138-f99709370657
2008-06-29 11:50:41 +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
Nicolas Pennequin
ef5fa8eaf5 Restore Zagor's copyright from before the WPS tokenizer. I shouldn't have removed it. Also add mine in playback.c, alongside Slasheri's.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17368 a1c6a512-1295-4272-9138-f99709370657
2008-05-05 09:40:22 +00:00
Bertrik Sikken
c97e503a10 Cleaned up playblack.h header file and usage of it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17276 a1c6a512-1295-4272-9138-f99709370657
2008-04-28 14:13:13 +00:00
Nicolas Pennequin
2cf6345a0e bufgetid3 should be used carefully, as it can return NULL.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17143 a1c6a512-1295-4272-9138-f99709370657
2008-04-16 16:41:35 +00:00
Nicolas Pennequin
de026dcede Fix FS#8902 (NSF files get skipped). The cause was too strict metadata checking (the NSF metadata parser doesn't fill the 'length' field). Hopefully there won't be any problems with that anymore.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17142 a1c6a512-1295-4272-9138-f99709370657
2008-04-16 16:18:05 +00:00
Nicolas Pennequin
babd3beee3 audio_current_track: take wps_offset into account when no buffered metadata is available, and avoid using playlist_peek, which hits on the disk when dircache isn't enabled. This should make skipping nicer.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17128 a1c6a512-1295-4272-9138-f99709370657
2008-04-15 20:59:47 +00:00
Nicolas Pennequin
b36d3c0be2 Some bugfixes after r17109:
* Fix FS#8893 by plugging a file descriptor leak in audio_load_track.
* Fix a possible null pointer dereference by not allowing audio_current_track to return NULL.
* Make audio_current_track return prevtrack_id3 only during an automatic track skip. Fixes the wrong metadata being displayed for a short time after a backwards skip.
-Cette ligne, et les suivantes ci-dessous, seront ignorées--

M    apps/playback.c


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17126 a1c6a512-1295-4272-9138-f99709370657
2008-04-15 19:20:57 +00:00
Steve Bavin
e50202c5c4 Remove a global variable which is (hopefully) not needed. Also fixes a very minor bug where restarting playback after a playlist ends would play the final 3 seconds again.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17117 a1c6a512-1295-4272-9138-f99709370657
2008-04-15 12:38:17 +00:00
Nicolas Pennequin
4e2de44b44 A rather big change to how tracks are loaded: there are now two parts to the process and metadata loading is done by the buffering thread (except for the first unbuffered track). The audio thread now calls audio_load_track, and once the metadata is loaded, the buffering thread sends an event which will make the audio thread call audio_finish_load_track. This one then takes care of the rest of the loading.
This method makes skipping noticeably faster for unbuffered tracks, and especially backwards.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17109 a1c6a512-1295-4272-9138-f99709370657
2008-04-14 16:17:47 +00:00
Nicolas Pennequin
a5ad74ffca Revert what was left of r17018 until I find a better way. It had quirks in some cases, and doesn't play well with what I'm about to commit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17108 a1c6a512-1295-4272-9138-f99709370657
2008-04-14 15:51:40 +00:00
Nicolas Pennequin
3c9625969b FS#8882: Fix the bug where skipping backwards with Ogg files could result in a skip forward (FS#8508). The problem was introduced by a one-line change in r16025, so we revert it. At the time I thought that line had become useless but obviously I was wrong. Thanks to Greg Erwin for finding the fix.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17107 a1c6a512-1295-4272-9138-f99709370657
2008-04-14 10:52:16 +00:00
Michael Giacomelli
9a946f6022 Commit FS#8822 by Magnus Holmgren. Fixes resuming previously playing WMA files after a reboot.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17090 a1c6a512-1295-4272-9138-f99709370657
2008-04-12 19:52:31 +00:00
Nicolas Pennequin
977069a41d Bring the WPS playlist index display into sync with the track being played by using the index field of the ID3 info struct instead of directly asking the playlist code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17018 a1c6a512-1295-4272-9138-f99709370657
2008-04-07 13:43:09 +00:00
Michael Sevakis
05099149f1 Enable nocache sections using the linker. PP5022/4 must use SW_CORELOCK now with shared variables in DRAM (it seems swp(b) is at least partially broken on all PP or I'm doing something very wrong here :\). For core-shared data use SHAREDBSS/DATA_ATTR. NOCACHEBSS/DATA_ATTR is available whether or not single core is forced for static peripheral-DMA buffer allocation without use of the UNCACHED_ADDR macro in code and is likely useful on a non-PP target with a data cache (although not actually enabled in config.h and the .lds's in this commit).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16981 a1c6a512-1295-4272-9138-f99709370657
2008-04-06 04:34:57 +00:00
Nicolas Pennequin
fe9eb68ec0 Fix FS#8513 (Playback occasionally repeats a track when rebuffering occurs) and hopefully others by essentially reverting r16019, parts of r16425 and most bugfix followups. This means we're back to having a desynchronized playlist index in the WPS. audio_check_new_track() needs a serious rework before we can make improvements in that area without breaking things.
playlist_checkend() isn't used anymore but I'm not removing it for now because it might prove useful later on.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16955 a1c6a512-1295-4272-9138-f99709370657
2008-04-03 21:40:07 +00:00
Nicolas Pennequin
33f522de8b Migrate the buffering code to the new events system.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16950 a1c6a512-1295-4272-9138-f99709370657
2008-04-03 17:51:53 +00:00
Nicolas Pennequin
a3ed95247c Fix an issue introduced by r16930 where rebuffering would happen one track too early because track were counted after moving to the next one instead of before.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16948 a1c6a512-1295-4272-9138-f99709370657
2008-04-03 15:30:42 +00:00
Nicolas Pennequin
73a71a4712 Move audio_set_elapsed to mpa.c, as recommended by the TODO note. Please correct me if affecting ci->id3->elapsed directly (ie without using ci->set_elapsed) is wrong.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16945 a1c6a512-1295-4272-9138-f99709370657
2008-04-03 12:13:03 +00:00
Nicolas Pennequin
bb40e6ed15 Fix a possible (though unlikely) deadlock condition spotted by jhMikeS. It would involve both the buffering and the audio thread sending synchronous messages to one another.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16931 a1c6a512-1295-4272-9138-f99709370657
2008-04-02 17:18:15 +00:00
Nicolas Pennequin
03b54c29d7 Fix for FS#8601 by pondlife: the disk no longer spins up on a track change when dircache is disabled. This issue was introduced by me in r16019 by adding a call to playlist_peek() in audio_check_new_track(). This fix adds a new playlist API call to work around the problem until we find a better solution. There are also a few simplifications and comment corrections.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16930 a1c6a512-1295-4272-9138-f99709370657
2008-04-02 17:04:59 +00:00
Andree Buschmann
63acf3eb16 Fixes FS#8597 (dropouts while crossfading) via keeping CPU boosted while crossfading is active.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16889 a1c6a512-1295-4272-9138-f99709370657
2008-03-30 10:08:08 +00:00
Nicolas Pennequin
12b6c847c5 Fix sim warnings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16881 a1c6a512-1295-4272-9138-f99709370657
2008-03-29 17:40:04 +00:00
Nicolas Pennequin
732df386af Boost the audio thread while it's filling the buffer. In the audio and the buffering threads, only cancel cpu boost when not filling.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16880 a1c6a512-1295-4272-9138-f99709370657
2008-03-29 17:28:30 +00:00
Nicolas Pennequin
b71cbd599b Use queue_empty instead of queue_peek again now that we don't care about the event type anymore.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16876 a1c6a512-1295-4272-9138-f99709370657
2008-03-29 13:32:37 +00:00
Michael Sevakis
4855e734f3 Move codec_get_file_pos somewhere else like the comment said should be done. Codec API version increment was needed so update all codecs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16874 a1c6a512-1295-4272-9138-f99709370657
2008-03-29 06:36:53 +00:00
Nicolas Pennequin
f68147e5eb Track playback filling state with a state-machine approach. There shouldn't be any change in behaviour but things are simpler.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16868 a1c6a512-1295-4272-9138-f99709370657
2008-03-28 20:18:53 +00:00
Steve Bavin
135cc757bd Revert my earlier const madness, we'll keep the parameter lists simple.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16863 a1c6a512-1295-4272-9138-f99709370657
2008-03-28 12:51:33 +00:00
Steve Bavin
3d0b7c6901 Oops, another pondlife puddle of red.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16862 a1c6a512-1295-4272-9138-f99709370657
2008-03-28 11:43:08 +00:00
Steve Bavin
c9df8fd87b The const police raid playback.c, should be no change to behaviour.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16860 a1c6a512-1295-4272-9138-f99709370657
2008-03-28 11:24:24 +00:00
Steve Bavin
76691030da Oops, more red. That can't be static yet.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16803 a1c6a512-1295-4272-9138-f99709370657
2008-03-25 19:46:35 +00:00
Steve Bavin
38ed901284 A little more consting/staticing, no functional change.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16801 a1c6a512-1295-4272-9138-f99709370657
2008-03-25 19:26:00 +00:00
Michael Sevakis
27cf677339 Add a complete priority inheritance implementation to the scheduler (all mutex ownership and queue_send calls are inheritable). Priorities are differential so that dispatch depends on the runnable range of priorities. Codec priority can therefore be raised in small steps (pcmbuf updated to enable). Simplify the kernel functions to ease implementation and use the same kernel.c for both sim and target (I'm tired of maintaining two ;_). 1) Not sure if a minor audio break at first buffering issue will exist on large-sector disks (the main mutex speed issue was genuinely resolved earlier). At this point it's best dealt with at the buffering level. It seems a larger filechunk could be used again. 2) Perhaps 64-bit sims will have some minor issues (finicky) but a backroll of the code of concern there is a 5-minute job. All kernel objects become incompatible so a full rebuild and update is needed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16791 a1c6a512-1295-4272-9138-f99709370657
2008-03-25 02:34:12 +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
6ab1c90513 FS#8707 - Enable "Load to RAM" (HAS_TC_RAMCACHE) compilation without Directory Cache (HAS_DIRCACHE).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16594 a1c6a512-1295-4272-9138-f99709370657
2008-03-09 20:33:19 +00:00
Jens Arnold
8c6920e343 Revert accidental tree commit. Sorry for that.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16574 a1c6a512-1295-4272-9138-f99709370657
2008-03-08 23:50:55 +00:00
Jens Arnold
d1ed7c37b1 No need to have \n here. panicf() won't output it anyway.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16570 a1c6a512-1295-4272-9138-f99709370657
2008-03-08 23:34:43 +00:00
Miika Pekkarinen
d8204fa11e Simplified the playback engine more and removed unnecessary code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16552 a1c6a512-1295-4272-9138-f99709370657
2008-03-08 08:05:29 +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
Nicolas Pennequin
0fd6a04eee Pragmatic fix for FS#8681 (logf breaks scrobbling). The correct fix is a better event mechanism but scrobbling is currently the only track_changed_event consumer so I'll wait til I have more time.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16520 a1c6a512-1295-4272-9138-f99709370657
2008-03-04 22:35:51 +00:00
Magnus Holmgren
c8d2a2458d Fix FS#8675: Last song in playlist ends prematurely.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16518 a1c6a512-1295-4272-9138-f99709370657
2008-03-04 18:56:37 +00:00
Steve Bavin
018de3591c Slightly simpler mechanism to avoid Q_AUDIO_FILL_BUFFER floods.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16497 a1c6a512-1295-4272-9138-f99709370657
2008-03-03 12:01:29 +00:00
Steve Bavin
bda6f573da Fix odd behaviour when rebuffering occurs during playback. This is hopefully the last nail in the coffins of FS#8455 and FS#8513, but I'll let some FLAC and Ogg users be the judge of that.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16459 a1c6a512-1295-4272-9138-f99709370657
2008-02-29 23:27:55 +00:00
Michael Sevakis
f38274f2f9 Use a safe way to get pcm buffer track change notifications to the audio thread.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16450 a1c6a512-1295-4272-9138-f99709370657
2008-02-28 22:37:46 +00:00
Magnus Holmgren
00b722ff22 Fix bookmark resume when a track is playing.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16445 a1c6a512-1295-4272-9138-f99709370657
2008-02-28 17:40:31 +00:00
Nicolas Pennequin
3987166a0a Fix auto dir change happening one track too early (another followup of r16425).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16430 a1c6a512-1295-4272-9138-f99709370657
2008-02-26 20:29:52 +00:00
Nicolas Pennequin
a36dbaa2c4 Fix not being able to skip to the last track in a playlist.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16426 a1c6a512-1295-4272-9138-f99709370657
2008-02-26 17:55:18 +00:00
Nicolas Pennequin
b834e25d71 Attempt to make manual track skips more responsive and more robust
* Immediately update the playlist index on manual track skip
* Try to minimise the number of calls to audio_fill_file_buffer

Hopefully fixes FS#8320.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16425 a1c6a512-1295-4272-9138-f99709370657
2008-02-26 17:15:35 +00:00
Nicolas Pennequin
f730133e04 Factor out duplicate code from audio_prev and audio_next
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16424 a1c6a512-1295-4272-9138-f99709370657
2008-02-26 17:15:33 +00:00
Nicolas Pennequin
ea9e02b442 Make audio_next_track use the wps_offset value.
This removes the delay between the current track title change and the next
track title change in the WPS on a track skip.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16423 a1c6a512-1295-4272-9138-f99709370657
2008-02-26 17:15:30 +00:00
Magnus Holmgren
68f9e6bfee When starting playback, prevent the codec from starting to decode too early, which would cause rebuffering (slowing things down) and incorrect playlist index. Hopefully fixes a bunch of playback-related bugs, such as FS#8520, FS#8525, FS#8555 and possibly FS#8511.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16392 a1c6a512-1295-4272-9138-f99709370657
2008-02-23 17:46:33 +00:00
Nicolas Pennequin
ca243ce494 Fix FS#5797 (Codec failure with directory skip when in file browser, with dircache enabled). Marking the tree context to be reloaded too early would cause the new playlist to contain files that don't exist (correct directory but wrong filenames), in turn causing the codec failures. The fix is to call reload_directory() after the playlist has been created.
I also added a sanity check to avoid loading an unknown codec, which was happening as a consequence of this issue.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16039 a1c6a512-1295-4272-9138-f99709370657
2008-01-09 20:37:36 +00:00