Commit graph

497 commits

Author SHA1 Message Date
Brandon Low
dcca586a9b Improve upon my hackity hack from before by separating audio into two types: that which may be large and can be streamed and that which is small and cannot be streamed. While modifying types, allow codecs to split across the buffer wrap and dig out/move around the code that reads a codec off of the buffer to facilitate that simple sounding change.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15408 a1c6a512-1295-4272-9138-f99709370657
2007-11-02 14:06:48 +00:00
Nicolas Pennequin
7f79564abc Accept FS#8053 by Bertrik Sikken: playback.c and mpeg.c simplification by removal of last_track argument in track_(un)buffer callback.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15384 a1c6a512-1295-4272-9138-f99709370657
2007-10-31 13:43:50 +00:00
Nicolas Pennequin
9d05e50c6e Fix a file descriptor leak that happened with large directories of small files with some invalid ones.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15379 a1c6a512-1295-4272-9138-f99709370657
2007-10-30 18:01:49 +00:00
Brandon Low
7030279dd2 Fix a logf warning
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15375 a1c6a512-1295-4272-9138-f99709370657
2007-10-30 15:09:16 +00:00
Nicolas Pennequin
be6e85dc59 Revert r15360: It didn't completely fix the problem and it's a bit dirty. A better solution has to be found.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15373 a1c6a512-1295-4272-9138-f99709370657
2007-10-30 13:19:04 +00:00
Nicolas Pennequin
30d3d36513 Invalidate prevtrack_id3 on all track skips to prevent next track info from being displaying for a split second after skipping to the previous track.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15361 a1c6a512-1295-4272-9138-f99709370657
2007-10-29 15:10:54 +00:00
Nicolas Pennequin
aecca6693f Update "elapsed" and "offset" in the mp3entries on the main buffer in the corresponding codec callbacks.
This should fix FS#8040.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15360 a1c6a512-1295-4272-9138-f99709370657
2007-10-29 15:10:30 +00:00
Nicolas Pennequin
d400e23e38 Prefix the error constants with ERR_
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15359 a1c6a512-1295-4272-9138-f99709370657
2007-10-29 14:15:59 +00:00
Steve Bavin
c985903084 Oops, sucky workaround wasn't meant to be committed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15357 a1c6a512-1295-4272-9138-f99709370657
2007-10-29 13:57:29 +00:00
Steve Bavin
7707f7fac9 Tiny bit of code policing: remove unneeded variable and spaces at end-of-line.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15356 a1c6a512-1295-4272-9138-f99709370657
2007-10-29 13:55:34 +00:00
Nicolas Pennequin
7807279eaf Add #defines for error values. Makes the code easier to read.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15348 a1c6a512-1295-4272-9138-f99709370657
2007-10-28 15:54:10 +00:00
Nicolas Pennequin
1839edf64a Add queue_peek to the kernel (written by Mike Sevakis), and use it to improve upon my previous commit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15336 a1c6a512-1295-4272-9138-f99709370657
2007-10-27 18:08:18 +00:00
Nicolas Pennequin
41add08c5e Prevent the audio queue from getting flooded with fill buffer messages.
The low buffer callback is registred by  instead of the function it calls to prevent a loop.
audio_check_new_track() also makes more sense because that's where tracks are made useless by a skip.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15335 a1c6a512-1295-4272-9138-f99709370657
2007-10-27 15:35:51 +00:00
Michael Sevakis
3c1d2069dd Make voice and codec queues private so they don't receive system messages. The audio thread controls them just fine. Important so codec stack-stealing plugins don't crash when system events are broadcast. Simpler too.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15333 a1c6a512-1295-4272-9138-f99709370657
2007-10-27 12:11:45 +00:00
Brandon Low
14b6f437bb Make buffering initialization versus reset separate functions to avoid double initializing threads or mutexes more easily
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15327 a1c6a512-1295-4272-9138-f99709370657
2007-10-27 04:16:41 +00:00
Nicolas Pennequin
d08131a117 * Only call bufgetcodec once
* Fix/Improve some queue logf messages
* Complete buffering_init


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15325 a1c6a512-1295-4272-9138-f99709370657
2007-10-27 01:25:47 +00:00
Brandon Low
0652663367 Simple fix which should improve track change performance slightly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15324 a1c6a512-1295-4272-9138-f99709370657
2007-10-27 00:13:10 +00:00
Steve Bavin
530abe84fd Code police: static internal functions.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15314 a1c6a512-1295-4272-9138-f99709370657
2007-10-26 09:39:05 +00:00
Nicolas Pennequin
14da611cd3 Check the audio queue for new messages while filling the buffer with tracks. This cuts down the long wait for a skip (or any other action) while adding a large number of tracks to the buffer.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15309 a1c6a512-1295-4272-9138-f99709370657
2007-10-25 22:52:40 +00:00
Nicolas Pennequin
3e3c43c747 Finally commit Metadata on Buffer!
buffering.c and buffering.h implement the new buffering API. playback.c is translated to that API. For more information about the whole concept, see http://www.rockbox.org/wiki/MetadataOnBuffer.
There should be no major visible changes, but most existing bugs remain (though fixing them should be easier now that playback.c is a bit less complex) and there probably will be new ones. Please report any problem!
Next step is to adapt cuesheet support, which is partly disabled here, and of course fix as much bugs as possible.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15306 a1c6a512-1295-4272-9138-f99709370657
2007-10-25 21:27:45 +00:00
Nicolas Pennequin
fb70952228 logf changes:
* Disable logf by default and allow per-file enabling with "#define LOGF_ENABLE". To enable globally add that define in the config.h file.
* Transform logf calls into DEBUGF calls when ROCKBOX_HAS_LOGF isn't defined, so that they get printed to the console in the sim.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15291 a1c6a512-1295-4272-9138-f99709370657
2007-10-24 22:06:36 +00:00
Steve Bavin
32a9575130 FS#7994 - Rename talk.c API, make talk_disable() affect all talking (not just menus), hopefully save some space.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15206 a1c6a512-1295-4272-9138-f99709370657
2007-10-19 15:31:42 +00:00
Stéphane Doyon
e5ba649d85 Fix a problem that caused stale pcm data to be played subsequent to a
voice shutup.

Observed when moving through a few voiced items in very quick succession.

This is for the case where music playback is not in progress, only voice
is playing.  The first few samples of audio data for voicing the first
skipped item make it to the pcm buffer, but the shutup comes before
enough pcm data has accumulated to actually start pcm playback. The
condition at the top of voice_on_voice_stop() is therefore false,
pcmbuf_play_stop() is not called, and the beginning of the interrupted
utterance is left to wait in the pcm buffer. That data will end up
prepended to the following voice clip to be played, causing a kind of
stuttering effect.

The fix is to remove the condition on pcm_is_playing() in
voice_on_voice_stop(): always clear the pcm data, it's harmless if there
wasn't any.

Thanks to jhMikeS for his assistance.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15176 a1c6a512-1295-4272-9138-f99709370657
2007-10-18 00:17:15 +00:00
Michael Sevakis
a9b2fb5ee3 Finally full multicore support for PortalPlayer 502x targets with an eye towards the possibility of other types. All SVN targets the low-lag code to speed up blocking operations. Most files are modified here simple due to a name change to actually support a real event object and a param change to create_thread. Add some use of new features but just sit on things for a bit and leave full integration for later. Work will continue on to address size on sensitive targets and simplify things if possible. Any PP target having problems with SWP can easily be changed to sw corelocks with one #define change in config.h though only PP5020 has shown an issue and seems to work without any difficulties.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15134 a1c6a512-1295-4272-9138-f99709370657
2007-10-16 01:25:17 +00:00
Steve Bavin
4d34457cd0 Thanks to Nico_P, struct track_info can now be internal to playback.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14947 a1c6a512-1295-4272-9138-f99709370657
2007-10-02 07:47:43 +00:00
Michael Sevakis
035529c487 Enable auto reply for queue messages sent with queue_send. It's only nescessary to use queue_reply to return a value other than zero or to return a result before waiting on the queue again.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14923 a1c6a512-1295-4272-9138-f99709370657
2007-09-30 17:23:13 +00:00
Tomasz Malesinski
8f8dbf4742 Fix disabling voice.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14821 a1c6a512-1295-4272-9138-f99709370657
2007-09-22 22:47:12 +00:00
Thom Johansen
294ec1d110 Remove the ID3 tag version priority setting on the grounds of it being pretty pointless. ID3v2 tags are superior to ID3v1 tags, and needs less seeking around to find.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14750 a1c6a512-1295-4272-9138-f99709370657
2007-09-19 10:40:55 +00:00
Nils Wallménius
441fa76a6d Fix flushing of voice during playback, patch in FS#6239 by Stephane Doyon and Daniel Dalton
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14517 a1c6a512-1295-4272-9138-f99709370657
2007-08-29 15:11:19 +00:00
Nicolas Pennequin
6a92e475ac Make get_metadata act on a struct mp3entry rather than a struct track_info.
This should make it easy to use a buffer handle to put the ID3 data in.
The changes in get_metadata are mostly search and replace. The only thing
it actually used to do on the struct track_info was set taginfo_ready to
true.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14326 a1c6a512-1295-4272-9138-f99709370657
2007-08-14 11:56:13 +00:00
Nils Wallménius
5b76936a44 Accept FS#6159 'Add voice to roughly 100 splash screens and yes-no menus' by Stephane Doyon with some minor tweaks by me. Rerun 'configure' and do a 'make clean' before rebuilding your voice files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14213 a1c6a512-1295-4272-9138-f99709370657
2007-08-06 13:08:36 +00:00
Steve Bavin
2129d0f5e3 Formatting consistency and fix further case of FS#6266 if user starts new playlist while paused.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14145 a1c6a512-1295-4272-9138-f99709370657
2007-08-02 13:19:35 +00:00
Nils Wallménius
0bfa3e76ce Disable 'Disk spindown' and 'Anti skip buffer' settings and some related stuff for flash storage targets as they make no sense
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14110 a1c6a512-1295-4272-9138-f99709370657
2007-08-01 08:50:44 +00:00
Michael Sevakis
ec2d2c47a0 Hopefully fix the problems with voice not cancelling its CPU boost.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14094 a1c6a512-1295-4272-9138-f99709370657
2007-07-31 10:00:50 +00:00
Steve Bavin
93b3fb334b FS#6266 - flush PCM buffers if the user skips while paused. FixesFS#5747.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14090 a1c6a512-1295-4272-9138-f99709370657
2007-07-31 07:57:59 +00:00
Steve Bavin
cbed7a2cd2 Fix problem where follow playlist picks the next track, not the current one (FS#7244). Hopefully also fixes the wrong filename being displayed on the WPS (FS#7248).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13805 a1c6a512-1295-4272-9138-f99709370657
2007-07-06 20:49:40 +00:00
Peter D'Hoye
e596a80e8d Yet another fine scrobbling patch by Robert Keevil that fixes FS #5495: audio_set_track_changed_event() skips first track in playlist
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13701 a1c6a512-1295-4272-9138-f99709370657
2007-06-24 19:20:27 +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
Nils Wallménius
c7f9ca4067 Accept FS#7264 'Build with -Os switch for coldfire targets'.
Introduces MEM_FUNCTION_WRAPPERS(api) macro which adds wrappers 
functions to a plugin to make plugins link correctly when gcc
calls mem* functions directly.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13625 a1c6a512-1295-4272-9138-f99709370657
2007-06-13 15:35:07 +00:00
Michael Sevakis
4597ebe24b Plugins that play sound must be sure to set inputs and outputs on audio muxed targets. Add strict adherence to the interface protocols. Make sure playback sets the playback output as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13604 a1c6a512-1295-4272-9138-f99709370657
2007-06-10 02:10:47 +00:00
Michael Sevakis
2d48d0ffa6 Straighten out some audio path APIs and misc. audio stuff. Having recording is not a prerequisite to having input/output source selection which is probably most useful when adding a audio input features like FM to a new port without forcing recording to be implemented first.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13599 a1c6a512-1295-4272-9138-f99709370657
2007-06-08 23:42:04 +00:00
Dave Chapman
7b1d90a851 Seeking and resume support for Monkey's Audio
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13597 a1c6a512-1295-4272-9138-f99709370657
2007-06-08 22:35:26 +00:00
Nicolas Pennequin
6579818b43 Add the possibility to store cuesheets in /.rockbox/cue. The code will look for a cuesheet there in case there wasn't one in the same folder as the audio file. This is to reduce the clutter created by one cuesheet per audio file in some places.
Also some duplicate code was replaced by a function call.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13508 a1c6a512-1295-4272-9138-f99709370657
2007-05-28 23:18:31 +00:00
Nils Wallménius
f31e123133 Remove unused function and unused header
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13424 a1c6a512-1295-4272-9138-f99709370657
2007-05-19 19:54:11 +00:00
Michael Sevakis
77771b0a43 How'd I miss that I'd left LOGFQUEUES enabled in my pre-commit diff? :/
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13365 a1c6a512-1295-4272-9138-f99709370657
2007-05-09 03:48:52 +00:00
Michael Sevakis
e486ed0453 SWCODEC Playback: Put a stop to the resume deadlock however crudely. Clean some unused lines out that no longer compatible.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13364 a1c6a512-1295-4272-9138-f99709370657
2007-05-09 03:44:44 +00:00
Michael Sevakis
a21871ceaa Fix errors. LOGFQUEUE should take formatting parameters now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13363 a1c6a512-1295-4272-9138-f99709370657
2007-05-08 23:13:46 +00:00
Michael Sevakis
d9839bc8a6 Silly fix for a silly comment mistake.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13362 a1c6a512-1295-4272-9138-f99709370657
2007-05-08 22:59:25 +00:00
Michael Sevakis
1c59b101df SWCODEC Playback: Seriously mess with it and get rid of (at least some ;) race conditions.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13361 a1c6a512-1295-4272-9138-f99709370657
2007-05-08 22:56:12 +00:00
Michael Sevakis
e88078f9f5 Playback: Ensure some state coherency. paused implies playing and pause actions are bypassed if not playing. stopped implies not playing and not paused. Starting playback transistions to playing and not paused.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13360 a1c6a512-1295-4272-9138-f99709370657
2007-05-08 16:19:13 +00:00