summaryrefslogtreecommitdiffstats
path: root/apps/playback.h
AgeCommit message (Collapse)AuthorFilesLines
2020-07-24[3/4] Completely remove HWCODEC supportSolomon Peachy1-3/+0
'swcodec' is now always set (and recording_swcodec for recording-capable units) in feature.txt so the manual and language strings don't need to all be fixed up. Change-Id: Ib2c9d5d157af8d33653e2d4b4a12881b9aa6ddb0
2018-10-18Fix playback.c audio_track_count() warningWilliam Wilgus1-1/+1
changes return to unsigned int to match underlying aliased function Change-Id: I7015c7ad929344441249aa7c4f2af361142fcaf4
2017-11-24Do playback restarts the proper wayMichael Sevakis1-1/+10
It isn't necessary to explicitly stop and restart playback to force it to update something that must cause rebuffering. Change-Id: I6ff5394fcafc7374af67ef9fbf9022bb4a79b773
2013-12-23playback,talk: Share audiobuffer via core_alloc_maximum().Thomas Martitz1-6/+0
This fixes the radioart crash that was the result of buffering.c working on a freed buffer at the same time as buflib (radioart uses buffering.c for the images). With this change the buffer is owned by buflib exclusively so this cannot happen. As a result, audio_get_buffer() doesn't exist anymore. Callers should call core_alloc_maximum() directly. This buffer needs to be protected as usual against movement if necessary (previously it was not protected at all which cased the radioart crash), To get most of it they can adjust the willingness of the talk engine to give its buffer away (at the expense of disabling voice interface) with the new talk_buffer_set_policy() function. Change-Id: I52123012208d04967876a304451d634e2bef3a33
2013-07-13Get rid of some superfluous single-purpose functions in playback.Michael Sevakis1-4/+0
* Remove explicit tracking of elapsed time of previous track. * Remove function to obtain auto skip flag. * Most playback events now carry the extra information instead and pass 'struct track_event *' for data. * Tweak scrobbler to use PLAYBACK_EVENT_TRACK_FINISH, which makes it cleaner and removes the struct mp3entry. Change-Id: I500d2abb4056a32646496efc3617406e36811ec5
2013-07-12Fix whitespace in files for following commit.Michael Sevakis1-1/+1
Change-Id: I4adb8a152e9b99fcd26d95da7334d7d0cbe2a036
2013-05-31Refactor audio thread to run both recording and playback.Michael Sevakis1-63/+1
Eliminates the pcmrec thread and keeps playback and recording engine operation mutually-exclusive. audio_thread.c contains the audio thread which branches to the correct engine depending upon the request. It also handles the main audio initialization. Moves pcm_init into main.c just before dsp_init because I don't want that one in audio_init in the new file. (Also makes revision df6e1bc pointless ;) Change-Id: Ifc1db24404e6d8dd9ac42d9f4dfbc207aa9a26e1
2013-03-24Change audio_set_cuesheet parameter from int to bool (fixes cppcheck warning)Bertrik Sikken1-1/+1
Change-Id: Icb31c8bd8605aca27765a94b609c41f1f706426f
2011-12-14FS#12378 : Remove various unused code, and comment out some unused code and ↵Boris Gjenero1-1/+0
data for reference or future use. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31256 a1c6a512-1295-4272-9138-f99709370657
2011-09-01Shuffle some functions around so that interfacing with playback.c in ↵Michael Sevakis1-1/+0
particular isn't required. Though playback does finish the audio init, pcm doesn't care who does it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30403 a1c6a512-1295-4272-9138-f99709370657
2011-08-14GSoC/Buflib: Replace all direct accesses to audiobuf with buffer API functions.Thomas Martitz1-1/+0
Namely, introduce buffer_get_buffer() and buffer_release_buffer(). buffer_get_buffer() aquires all available and grabs a lock, attempting to call buffer_alloc() or buffer_get_buffer() while this lock is locked will cause a panicf() (doesn't actually happen, but is for debugging purpose). buffer_release_buffer() unlocks that lock and can additionally increment the audiobuf buffer to make an allocation. Pass 0 to only unlock if buffer was used temporarily only. buffer_available() is a replacement function to query audiobuflen, i.e. what's left in the buffer. Buffer init is moved up in the init chain and handles ipodvideo64mb internally. Further changes happened to mp3data.c and talk.c as to not call the above API functions, but get the buffer from callers. The caller is the audio system which has the buffer lock while mp3data.c and talk mess with the buffer. mpeg.c now implements some buffer related functions of playback.h, especially audio_get_buffer(), allowing to reduce #ifdef hell a tiny bit. audiobuf and audiobufend are local to buffer.c now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30308 a1c6a512-1295-4272-9138-f99709370657
2011-04-27Get rid of a committed #define from kernel.h that didn't make the final cut. ↵Michael Sevakis1-1/+0
Put voice_wait in voice_thread.h where it ought. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29787 a1c6a512-1295-4272-9138-f99709370657
2011-04-27Commit FS#12069 - Playback rework - first stages. Gives as thorough as ↵Michael Sevakis1-20/+58
possible a treatment of codec management, track change and metadata logic as possible while maintaining fairly narrow focus and not rewriting everything all at once. Please see the rockbox-dev mail archive on 2011-04-25 (Playback engine rework) for a more thorough manifest of what was addressed. Plugins and codecs become incompatible. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29785 a1c6a512-1295-4272-9138-f99709370657
2011-04-07Fix red and yellow. Move resume_index from mp3entry to playlist_info struct. ↵Andree Buschmann1-1/+0
Bump codec api. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29691 a1c6a512-1295-4272-9138-f99709370657
2011-04-07Fix regressions of r29682. Update playlist index resume position when ↵Andree Buschmann1-0/+1
playlist changes (e.g. shuffling, inserting, removing, ...). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29690 a1c6a512-1295-4272-9138-f99709370657
2011-02-23Give playback engine better control over the codec. Codec simply follows ↵Michael Sevakis1-1/+4
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-09Embedded album art support in MP3/ID3v2 tags.Thomas Martitz1-0/+7
- 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
2009-11-16mpeg.h/c cleanupJeffrey Goode1-8/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23652 a1c6a512-1295-4272-9138-f99709370657
2009-11-16Cleanup audio.h, related functionsJeffrey Goode1-0/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23651 a1c6a512-1295-4272-9138-f99709370657
2009-11-16pcmbuf cleanupJeffrey Goode1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23649 a1c6a512-1295-4272-9138-f99709370657
2009-11-10Crossfade: carved out crossfade related code with lots of HAVE_CORSSFADE ↵Jeffrey Goode1-1/+3
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-09Playback: removed duplicate functionsJeffrey Goode1-2/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23576 a1c6a512-1295-4272-9138-f99709370657
2009-11-05pcmbuf: clarify and simplify crossfade code, etc.Jeffrey Goode1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23538 a1c6a512-1295-4272-9138-f99709370657
2009-11-04Clarify track transition code in pcmbuf and playback. No functional changes yet.Jeffrey Goode1-0/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23506 a1c6a512-1295-4272-9138-f99709370657
2009-11-01Code cleanup in codec_thread, playback and pcmbuf; more elegant solution to ↵Jeffrey Goode1-0/+1
leftover samples git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23471 a1c6a512-1295-4272-9138-f99709370657
2009-10-31FS#10739: playback.c code splitJeffrey Goode1-8/+43
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23444 a1c6a512-1295-4272-9138-f99709370657
2009-10-16Rework albumart buffering internally to allow for mutliple albumart sizes.Thomas Martitz1-3/+26
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-08-03A bit mroe wps/skin engine cleanup so that the structs the wps uses can be ↵Thomas Martitz1-1/+1
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-01-05Have the codec thread do callbacks instead of messing with the stack which ↵Michael Sevakis1-0/+2
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
2008-12-25Commit FS#8624 by Linus Nielsen, Ryan Press, Craig Elliott, and Kenderes ↵Michael Giacomelli1-1/+1
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-07-15Accept FS#8918: Voice multiple thumbnails and talk race fixes.Stéphane Doyon1-1/+1
-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-28Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg1-2/+4
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-04Accept FS#6188: study mode.Stéphane Doyon1-2/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17355 a1c6a512-1295-4272-9138-f99709370657
2008-04-28Cleaned up playblack.h header file and usage of it.Bertrik Sikken1-14/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17276 a1c6a512-1295-4272-9138-f99709370657
2008-04-27Updated use of events.h header file.Bertrik Sikken1-1/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17267 a1c6a512-1295-4272-9138-f99709370657
2008-03-28Revert my earlier const madness, we'll keep the parameter lists simple.Steve Bavin1-3/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16863 a1c6a512-1295-4272-9138-f99709370657
2008-03-28The const police raid playback.c, should be no change to behaviour.Steve Bavin1-2/+20
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16860 a1c6a512-1295-4272-9138-f99709370657
2008-03-20CODEC_IDX_{AUDIO,VOICE} are already defined in apps/dsp.hAntoine Cellerier1-3/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16725 a1c6a512-1295-4272-9138-f99709370657
2008-03-16Implement the playback event handling as a system-wide multi-purpose event ↵Miika Pekkarinen1-13/+1
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-08Fixed yellow.Miika Pekkarinen1-3/+7
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16551 a1c6a512-1295-4272-9138-f99709370657
2008-03-07Rewritten playback event handling. Should fix runtime statistics gathering.Miika Pekkarinen1-3/+9
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16546 a1c6a512-1295-4272-9138-f99709370657
2007-10-31Accept FS#8053 by Bertrik Sikken: playback.c and mpeg.c simplification by ↵Nicolas Pennequin1-4/+2
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-25Finally commit Metadata on Buffer!Nicolas Pennequin1-2/+2
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-02Thanks to Nico_P, struct track_info can now be internal to playback.cSteve Bavin1-17/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14947 a1c6a512-1295-4272-9138-f99709370657
2007-08-06Accept FS#6159 'Add voice to roughly 100 splash screens and yes-no menus' by ↵Nils Wallménius1-0/+1
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-05-07Revert the addition of the steal_codec_stack function. Replace by accessing ↵Dave Chapman1-1/+0
the threads structure to grab the codec stack. Maybe a better solution exists. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13349 a1c6a512-1295-4272-9138-f99709370657
2007-05-07Use a separate thread in test_codec, with the same (IRAM) stack as the main ↵Dave Chapman1-0/+1
codec thread. Add a function to the plugin API to steal the codec thread, which test_codec copies and then restores. Now libmad can be benchmarked. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13347 a1c6a512-1295-4272-9138-f99709370657
2007-05-07Initial version of a test_codec plugin (viewer). This loads the audio file ↵Dave Chapman1-0/+1
into the audio buffer and decodes it as fast as it can via a locally implemented version of the codec API. Intended for use when optimising codecs - so isn't built by default. Remember to add it to both plugins/SOURCES and viewers.config to enable it. Currently the codec is run in the main thread which means mpa.codec doesn't work - it requires more stack than is available on the main thread. The solution will be to create a new thread in the plugin which steals the main codec thread's IRAM stack, but that's not done yet. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13345 a1c6a512-1295-4272-9138-f99709370657
2007-05-07Minor header file cleanup - try and include the minimal number of files, and ↵Dave Chapman1-2/+0
only where they are needed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13344 a1c6a512-1295-4272-9138-f99709370657
2007-03-19SWCODEC: Get rid of extra swap buffer and get back 512K of RAM or 100K if ↵Michael Sevakis1-2/+0
the players RAM is <= 1MB. Make any needed changes to things to stabilize and facilitate this including removing flattening out initialization. Comment some things heavily. Fix a few logfs I didn't want to see the compiler complaining about. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12843 a1c6a512-1295-4272-9138-f99709370657