summaryrefslogtreecommitdiff
path: root/apps/plugins/mpegplayer/audio_thread.c
AgeCommit message (Collapse)Author
2013-07-06Enable setting of global output samplerate on certain targets.Michael Sevakis
Replaces the NATIVE_FREQUENCY constant with a configurable frequency. The user may select 48000Hz if the hardware supports it. The default is still 44100Hz and the minimum is 44100Hz. The setting is located in the playback settings, under "Frequency". "Frequency" was duplicated in english.lang for now to avoid having to fix every .lang file for the moment and throwing everything out of sync because of the new play_frequency feature in features.txt. The next cleanup should combine it with the one included for recording and generalize the ID label. If the hardware doesn't support 48000Hz, no setting will be available. On particular hardware where very high rates are practical and desireable, the upper bound can be extended by patching. The PCM mixer can be configured to play at the full hardware frequency range. The DSP core can configure to the hardware minimum up to the maximum playback setting (some buffers must be reserved according to the maximum rate). If only 44100Hz is supported or possible on a given target for playback, using the DSP and mixer at other samperates is possible if the hardware offers them. Change-Id: I6023cf0c0baa8bc6292b6919b4dd3618a6a25622 Reviewed-on: http://gerrit.rockbox.org/479 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-05-05Purge the usage of DSP_SWITCH_FREQUENCY.Michael Sevakis
DSP_SWITCH_FREQUENCY has been deprecated and the same enumerated value as DSP_SET_FREQUENCY since major DSP revisions were committed. This task should have been performed much earlier but, oh well, do it now. Change-Id: I3f30d651b894136a07c7e17f78fc16a7d98631ff
2012-05-09Rename HAVE_PITCHSCREEN to HAVE_PITCHCONTROLNils Wallménius
Also move the definition to config.h Change-Id: I36bb5020c5e06b2344292bc05e8c13ccc7a6a1ff Reviewed-on: http://gerrit.rockbox.org/234 Reviewed-by: Nils Wallménius <nils@rockbox.org>
2012-04-29Fundamentally rewrite much of the audio DSP.Michael Sevakis
Creates a standard buffer passing, local data passing and messaging system for processing stages. Stages can be moved to their own source files to reduce clutter and ease assimilation of new ones. dsp.c becomes dsp_core.c which supports an engine and framework for effects. Formats and change notifications are passed along with the buffer so that they arrive at the correct time at each stage in the chain regardless of the internal delays of a particular one. Removes restrictions on the number of samples that can be processed at a time and it pays attention to destination buffer size restrictions without having to limit input count, which also allows pcmbuf to remain fuller and safely set its own buffer limits as it sees fit. There is no longer a need to query input/output counts given a certain number of input samples; just give it the sizes of the source and destination buffers. Works in harmony with stages that are not deterministic in terms of sample input/output ratio (like both resamplers but most notably the timestretch). As a result it fixes quirks with timestretch hanging up with certain settings and it now operates properly throughout its full settings range. Change-Id: Ib206ec78f6f6c79259c5af9009fe021d68be9734 Reviewed-on: http://gerrit.rockbox.org/200 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested-by: Michael Sevakis <jethead71@rockbox.org>
2011-03-05Change the thread api a bit.Thomas Martitz
* Remove THREAD_ID_CURRENT macro in favor of a thread_self() function, this allows thread functions to be simpler. * thread_self_entry() shortcut for kernel.c. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29521 a1c6a512-1295-4272-9138-f99709370657
2011-01-07Put illustrative switch case back, because it clarifies intention...maybe ;).Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28985 a1c6a512-1295-4272-9138-f99709370657
2011-01-07MPEGPlyaer: A bit of audio mutation. Remove a useless thread state. Take ↵Michael Sevakis
some control over the buffer away from the audio thread itself. Some atomicity corrections. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28984 a1c6a512-1295-4272-9138-f99709370657
2010-09-17Make disabling HAVE_PITCHSCREEN actually work without breaking the buildFrank Gevaerts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28102 a1c6a512-1295-4272-9138-f99709370657
2010-08-01mpegplayer mad: apply r27655 fixRafaël Carré
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27659 a1c6a512-1295-4272-9138-f99709370657
2010-06-29r27159 broke mpegplayer but not the mpa codec because its libmad init wasn't ↵Michael Sevakis
also updated to be compatible with the changes. Fix that. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27171 a1c6a512-1295-4272-9138-f99709370657
2010-05-15Eliminate %zd tag in printf format strings, replace them with %ld. The %z ↵Jeffrey Goode
formatter kept generating type mismatch warnings. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26040 a1c6a512-1295-4272-9138-f99709370657
2010-05-14Fix various size_t related warnings and errorsFrank Gevaerts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26035 a1c6a512-1295-4272-9138-f99709370657
2009-11-09Make the codecs use more IRAM on S5L870x, as we have plenty of it.Michael Sparmann
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23594 a1c6a512-1295-4272-9138-f99709370657
2009-08-15FS#10526: mpegplayer audio out of sync, reverts r22280Jeffrey Goode
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22321 a1c6a512-1295-4272-9138-f99709370657
2009-08-12FS#10504: Make mpegplayer audio thread use correct sample countJeffrey Goode
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22280 a1c6a512-1295-4272-9138-f99709370657
2009-07-11Fix plugins for the changed pitch scale from r21781Jens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21794 a1c6a512-1295-4272-9138-f99709370657
2009-01-05Have the codec thread do callbacks instead of messing with the stack which ↵Michael Sevakis
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-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-11-20New makefile solution: A single invocation of 'make' to build the entire ↵Björn Stenberg
tree. Fully controlled dependencies give faster and more correct recompiles. Many #include lines adjusted to conform to the new standards. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19146 a1c6a512-1295-4272-9138-f99709370657
2008-09-20Commit FS#9318 - MP3 synthesis filter on COP. Loads the MP3 synth filer on ↵Michael Giacomelli
to the CoProcessor on all PortalPlayer devices, resulting in an ~90% speedup according to test_codec on the Sansa. Real world improvement is somewhat less, but still considerable. Allows MP3 decoding at 30MHz without boosting, or use of more DSP/EQ with less boosting/skipping, thus improving battery life. Minor changes to mpegplayer to retain compatibility with libmad changes. Should be no significant changes for other targets or codecs. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18557 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-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-03-25Add a complete priority inheritance implementation to the scheduler (all ↵Michael Sevakis
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-02-01mpegplayer: Use the core DSP to process audio. Removes the sample rate ↵Michael Sevakis
restriction on audio and any mpeg audio samplerate may be used. Use the global sound settings for audio output with the option to force any one of the processing stages off. All are forced off by default. I didn't personally care to fully duplicate the Sound Settings menu which would have been needed since using the core one would affect settings globally and exactly the same configuration probably isn't desired since the CPU load for video playback is much greater. Rebalance the threading to compensate with some expense to buffering speed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16194 a1c6a512-1295-4272-9138-f99709370657
2008-01-03Initial WVS for mpegplayer. Adjusts to the user's preferred font and uses ↵Michael Sevakis
FF/RW preferences set for playback. Picked a random color for the base WVS color but it could be configured. Some engine tweaks to accomodate it since certain nescessities are clearer now. Fix a clipped YUV output bug in the SIM. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15991 a1c6a512-1295-4272-9138-f99709370657
2007-12-29mpegplayer: Make playback engine fully seekable and frame-accurate and split ↵Michael Sevakis
into logical parts. Be sure to have all current features work. Actual UI for seeking will be added soon. Recommended GOP size is about 15-30 frames depending on target or seeking can be slow with really long GOPs (nature of MPEG video). More refined encoding recommendations for a particular player should be posted soon. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15977 a1c6a512-1295-4272-9138-f99709370657