summaryrefslogtreecommitdiff
path: root/apps/pcmbuf.h
AgeCommit message (Collapse)Author
2011-08-28Commit work started in FS#12153 to put timing/position information in PCMMichael Sevakis
buffer chunks. * Samples and position indication is closely associated with audio data instead of compensating by a latency constant. Alleviates problems with using the elapsed as a track indicator where it could be off by several steps. * Timing is accurate throughout track even if resampling for pitch shift, whereas before it updated during transition latency at the normal 1:1 rate. * Simpler PCM buffer with a constant chunk size, no linked lists. In converting crossfade, a minor change was made to not change the WPS until the fade-in of the incoming track, whereas before it would change upon the start of the fade-out of the outgoing track possibly having the WPS change with far too much lead time. Codec changes are to set elapsed times *before* writing next PCM frame because time and position data last set are saved in the next committed PCM chunk. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30366 a1c6a512-1295-4272-9138-f99709370657
2011-08-23Fix FS#12238 - WPS delay on pause introduced by r30097 which was the excuse ↵Michael Sevakis
I wanted anyway to do a better PCM fade on stop/pause implementation. New fade is asynchronous tick-based. Restores skin update points in the WPS that were removed when fading mechanism was changed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30340 a1c6a512-1295-4272-9138-f99709370657
2011-06-29Commit FS#12150 - Fully-functional audio mixer - and finally whip old ↵Michael Sevakis
limitations about playback of voice and other sounds when paused. Channels are independent in state and amplitude. Fade on stop/pause is handled by the channel's volume control rather than global volume which means it now works from anywhere. Opens up the possibility of plugin sounds during music playback by merely adding an additional channel enum. If any PCM drivers were not properly modified, see one of the last comments in the task for a description of the simple change that is expected. Some params are tunable in firmware/export/pcm-mixer.h as well. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30097 a1c6a512-1295-4272-9138-f99709370657
2011-04-27Commit FS#12069 - Playback rework - first stages. Gives as thorough as ↵Michael Sevakis
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-02-23Give playback engine better control over the codec. Codec simply follows ↵Michael Sevakis
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
2009-11-10Crossfade: carved out crossfade related code with lots of HAVE_CORSSFADE ↵Jeffrey Goode
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-08pcmbuf: moved some functions around, no functional changes yetJeffrey Goode
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23565 a1c6a512-1295-4272-9138-f99709370657
2009-11-06pcmbuf: sorted functions into logical sections for readability. Tiny ↵Jeffrey Goode
changes, nothing functional git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23541 a1c6a512-1295-4272-9138-f99709370657
2009-11-05pcmbuf: clarify and simplify crossfade code, etc.Jeffrey Goode
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23538 a1c6a512-1295-4272-9138-f99709370657
2009-11-05pcmbuf: better latency calculation, added debug codeJeffrey Goode
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23537 a1c6a512-1295-4272-9138-f99709370657
2009-11-04Clarify track transition code in pcmbuf and playback. No functional changes yet.Jeffrey Goode
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 Goode
leftover samples git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23471 a1c6a512-1295-4272-9138-f99709370657
2009-09-25Replace limiter with dynamic range compressorJeffrey Goode
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22832 a1c6a512-1295-4272-9138-f99709370657
2009-08-18FS#10199: Adds limiter DSP functionJeffrey Goode
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22394 a1c6a512-1295-4272-9138-f99709370657
2009-06-17Commit FS#10335 from Jeffrey Goode.Dan Everton
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-01-10Calculate watermark from bitrate and harddisk spinup time.Björn Stenberg
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
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-19Removed unused function get_pcmbuf_descsize from pcmbuf.cBertrik Sikken
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17175 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-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
2007-11-18Make speex the new voice format for SWCODEC targets (non-Archos). Remove ↵Michael Sevakis
codec swapping and build speex voice decoding directly into the core binary. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15668 a1c6a512-1295-4272-9138-f99709370657
2007-05-10Code cleaning - remove some unnecessary defined(SIMULATOR) checksDave Chapman
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13369 a1c6a512-1295-4272-9138-f99709370657
2007-03-19SWCODEC: Get rid of extra swap buffer and get back 512K of RAM or 100K if ↵Michael Sevakis
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
2007-02-07Fix resampling clicking as much as possible at the moment. 1) Upsampling ↵Michael Sevakis
clicked because of size inaccuracies returned by DSP. Fix by simplifying audio system to use per-channel sample count from codec to pcm buffer. 2) Downsampling affected by 1) and was often starting passed the end of the data when not enough was available to generate an output sample. Fix by clamping input range to last sample in buffer and using the last sample value in the buffer. A perfect fix will require a double buffering scheme on the resampler to sufficient data during small data transients on both ends at all times of the down ratio on input and the up ratio on output. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12218 a1c6a512-1295-4272-9138-f99709370657
2006-11-06Big Patch adds primarily: Samplerate and format selection to recording for ↵Michael Sevakis
SWCODEC. Supprort for samplerates changing in playback (just goes with the recording part inseparably). Samplerates to all encoders. Encoders can be configured individually on a menu specific to the encoder in the recording menu. File creation is delayed until flush time to reduce spinups when splitting. Misc: statusbar icons for numbers are individual digits to display any number. Audio buffer was rearranged to maximize memory available to recording and properly reinitialized when trashed. ColdFire PCM stuff moved to target tree to avoid a complicated mess when adding samplerate switching. Some needed API changes and to neaten up growing gap between hardware and software codecs. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11452 a1c6a512-1295-4272-9138-f99709370657
2006-10-15Removed ugly boosting solutions from playback code and let schedulerMiika Pekkarinen
handle unboosting instead. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11226 a1c6a512-1295-4272-9138-f99709370657
2006-10-15Don't unboost CPU in an ISRSteve Bavin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11224 a1c6a512-1295-4272-9138-f99709370657
2006-08-13Memory size checks in .c/.h files should use MEM, not MEMORYSIZEDave Chapman
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10557 a1c6a512-1295-4272-9138-f99709370657
2006-08-12Various lower limits and sizes for targets with 1MB of RAM (Iriver iFP7xx).Tomasz Malesinski
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10556 a1c6a512-1295-4272-9138-f99709370657
2006-05-08Revert a previous change, works around the problem of freezing on ↵Brandon Low
stop-while-paused, and skipping with crossfade git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9889 a1c6a512-1295-4272-9138-f99709370657
2006-04-23Rework crossfade to properly follow pcmbuf chunks instaed of blindly ↵Brandon Low
inserting into the ring buffer git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9780 a1c6a512-1295-4272-9138-f99709370657
2006-04-22First commit of reworking voice to be mroe stable on swcodecBrandon Low
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9758 a1c6a512-1295-4272-9138-f99709370657
2006-02-22Fix some of the voice and beep bugs that people have noticed since my new ↵Brandon Low
pcmbuf code went in, reduce code duplication, and improve performance while I'm at it git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8775 a1c6a512-1295-4272-9138-f99709370657
2006-02-07Rework PCM bufferBrandon Low
* Linked list instead of static array buffer pointers * Variable sized chunks * Improved mix handling * Reduction in duplicated code * Reduced IRAM usage w/o sacrificing performance * Converted to almost entirely unsigned math * Add pause function to reduce pcm_* exposure to playback. This WILL break playback on the iPod until linuxstb makes a followup commit. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8612 a1c6a512-1295-4272-9138-f99709370657
2006-02-07Reduce latency when configuring the EQ.Miika Pekkarinen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8609 a1c6a512-1295-4272-9138-f99709370657
2006-01-27Don't use crossfader mix mode when skipping tracks manually.Miika Pekkarinen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8470 a1c6a512-1295-4272-9138-f99709370657
2006-01-21Continue to update playback status after decoding is complete (the progress ↵Brandon Low
bar makes it to 100%!) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8407 a1c6a512-1295-4272-9138-f99709370657
2005-11-06iRiver: New crossfader with more configuration capability. Might stillMiika Pekkarinen
have small bugs, but those will be fixed as soon as possible. Config block version bumped; please SAVE YOUR SETTINGS. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7765 a1c6a512-1295-4272-9138-f99709370657
2005-08-28Define empty macros for cpu boosting on targets with no such a feature.Miika Pekkarinen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7412 a1c6a512-1295-4272-9138-f99709370657
2005-08-28Fixed iriver cpu boosting problems.Miika Pekkarinen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7410 a1c6a512-1295-4272-9138-f99709370657
2005-08-20Initial voice ui support for software codec platforms. Added also aMiika Pekkarinen
beep when changing tracks. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7360 a1c6a512-1295-4272-9138-f99709370657
2005-07-22It's now possible to select the crossfading mode: "Off, Crossfade,Miika Pekkarinen
Mix". If set to mix, no fading is applied but tracks are mixed up. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7224 a1c6a512-1295-4272-9138-f99709370657
2005-07-21Crossfade (and pcm buffer size) length is now configurable.Miika Pekkarinen
Implemented anti-skip buffer setting for iriver also. Settings block bumped up, PLEASE SAVE YOUR SETTINGS BEFORE UPGRADING. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7210 a1c6a512-1295-4272-9138-f99709370657
2005-07-13Separated buffering stuff from pcm_playback to pcmbuf. Renamed someMiika Pekkarinen
function calls (audiobuffer -> pcmbuf etc.). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7131 a1c6a512-1295-4272-9138-f99709370657