summaryrefslogtreecommitdiff
path: root/apps/playback.c
AgeCommit message (Collapse)Author
2008-12-25Commit FS#8624 by Linus Nielsen, Ryan Press, Craig Elliott, and Kenderes ↵Michael Giacomelli
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-13Keyclick fixup take two. It is only 88 samples (2msec) long so keep a small ↵Michael Sevakis
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-13PCM buffer beeping needs the audio buffer reset in order to work after ↵Michael Sevakis
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-13Fix FS#8660-Recording hardlocks with keyclick enabled and FS#9388-keyclicks ↵Michael Sevakis
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-10Use cookies for thread identification instead of pointers directly which ↵Michael Sevakis
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-07Meg F/X can beep and click using a hardware timer so let us try it out. To ↵Michael Sevakis
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-04playback: sanity check for pcmbuf_init() requirement (enabled in DEBUG)Rafaël Carré
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19331 a1c6a512-1295-4272-9138-f99709370657
2008-12-04Fix FS#8282 - if next-dir fails resume the old playlistJonathan Gordon
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19324 a1c6a512-1295-4272-9138-f99709370657
2008-12-01FS#8814 - remove the "restarting playback" splash because its pointless..Jonathan Gordon
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19286 a1c6a512-1295-4272-9138-f99709370657
2008-11-01Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do ↵Frank Gevaerts
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-10-26Try to fix FS#9502: end playback properly if no valid files were found in a ↵Magnus Holmgren
playlist. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18891 a1c6a512-1295-4272-9138-f99709370657
2008-10-22fix FS#8124 - pressing STOP after seeking while paused causes playback to ↵Jonathan Gordon
start again for a second or 2 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18860 a1c6a512-1295-4272-9138-f99709370657
2008-10-19Codec memory reorganizationNils Wallménius
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-16Accept FS#7482 by Klaas Bosteels - return the full path of a file which ↵Jonathan Gordon
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-16Accept FS#9480 - centralise and organise the events in the apps/ layer. Jonathan Gordon
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18819 a1c6a512-1295-4272-9138-f99709370657
2008-10-14Added #include pcm_record.hBjörn Stenberg
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18809 a1c6a512-1295-4272-9138-f99709370657
2008-10-07add HAVE_DISK_STORAGE, and use that instead of HAVE_FLASH_STORAGE when ↵Frank Gevaerts
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-08-15FS#9281 Rename of splash functions.Nils Wallménius
* 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-07-15Accept FS#8918: Voice multiple thumbnails and talk race fixes.Stéphane Doyon
-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-06-30Fix FS#8977. The issue was caused by multiple successive calls to ↵Nicolas Pennequin
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-29Fix FS#9110 and its maybe-dupes.Nicolas Pennequin
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-28Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg
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-05-05Restore Zagor's copyright from before the WPS tokenizer. I shouldn't have ↵Nicolas Pennequin
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-04-28Cleaned up playblack.h header file and usage of it.Bertrik Sikken
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17276 a1c6a512-1295-4272-9138-f99709370657
2008-04-16bufgetid3 should be used carefully, as it can return NULL.Nicolas Pennequin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17143 a1c6a512-1295-4272-9138-f99709370657
2008-04-16Fix FS#8902 (NSF files get skipped). The cause was too strict metadata ↵Nicolas Pennequin
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-15audio_current_track: take wps_offset into account when no buffered metadata ↵Nicolas Pennequin
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-15Some bugfixes after r17109:Nicolas Pennequin
* 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-15Remove a global variable which is (hopefully) not needed. Also fixes a very ↵Steve Bavin
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-14A rather big change to how tracks are loaded: there are now two parts to the ↵Nicolas Pennequin
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-14Revert what was left of r17018 until I find a better way. It had quirks in ↵Nicolas Pennequin
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-14FS#8882: Fix the bug where skipping backwards with Ogg files could result in ↵Nicolas Pennequin
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-12Commit FS#8822 by Magnus Holmgren. Fixes resuming previously playing WMA ↵Michael Giacomelli
files after a reboot. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17090 a1c6a512-1295-4272-9138-f99709370657
2008-04-07Bring the WPS playlist index display into sync with the track being played ↵Nicolas Pennequin
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-06Enable nocache sections using the linker. PP5022/4 must use SW_CORELOCK now ↵Michael Sevakis
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-03Fix FS#8513 (Playback occasionally repeats a track when rebuffering occurs) ↵Nicolas Pennequin
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-03Migrate the buffering code to the new events system.Nicolas Pennequin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16950 a1c6a512-1295-4272-9138-f99709370657
2008-04-03Fix an issue introduced by r16930 where rebuffering would happen one track ↵Nicolas Pennequin
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-03Move audio_set_elapsed to mpa.c, as recommended by the TODO note. Please ↵Nicolas Pennequin
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-02Fix a possible (though unlikely) deadlock condition spotted by jhMikeS. It ↵Nicolas Pennequin
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-02Fix for FS#8601 by pondlife: the disk no longer spins up on a track change ↵Nicolas Pennequin
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-03-30Fixes FS#8597 (dropouts while crossfading) via keeping CPU boosted while ↵Andree Buschmann
crossfading is active. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16889 a1c6a512-1295-4272-9138-f99709370657
2008-03-29Fix sim warnings.Nicolas Pennequin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16881 a1c6a512-1295-4272-9138-f99709370657
2008-03-29Boost the audio thread while it's filling the buffer. In the audio and the ↵Nicolas Pennequin
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-29Use queue_empty instead of queue_peek again now that we don't care about the ↵Nicolas Pennequin
event type anymore. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16876 a1c6a512-1295-4272-9138-f99709370657
2008-03-29Move codec_get_file_pos somewhere else like the comment said should be done. ↵Michael Sevakis
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-28Track playback filling state with a state-machine approach. There shouldn't ↵Nicolas Pennequin
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-28Revert my earlier const madness, we'll keep the parameter lists simple.Steve Bavin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16863 a1c6a512-1295-4272-9138-f99709370657
2008-03-28Oops, another pondlife puddle of red.Steve Bavin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16862 a1c6a512-1295-4272-9138-f99709370657
2008-03-28The const police raid playback.c, should be no change to behaviour.Steve Bavin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16860 a1c6a512-1295-4272-9138-f99709370657