summaryrefslogtreecommitdiffstats
path: root/apps/pcmbuf.h
AgeCommit message (Collapse)AuthorFilesLines
2017-04-06Fix a problem with audio not starting on a list of short filesMichael Sevakis1-0/+1
Forced audio start was left out when a third codec attempts to start a second track transition. Only one pending transition is allowed at a time. There wouldn't be enough PCM in the buffer to trigger audio playback and audio would just return without giving the pcm buffer a kick. Fixes FS#13100 - Player failed on short tracks Change-Id: I338b0b12022c591930451fd5ed26a2a73008835f
2017-01-05Playback: Fix problems with crossfade on short tracks.Michael Sevakis1-3/+0
Addresses issues brought up in this thread: http://forums.rockbox.org/index.php/topic,51605.0.html While we're at it, improve the quality with a sample-level fader. Change-Id: I73dde60d6858a1c9042812e26d490739e3906a1e
2013-07-06Enable setting of global output samplerate on certain targets.Michael Sevakis1-0/+2
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>
2012-04-27Fix up some more type stuff in pcmbuf.c.Michael Sevakis1-1/+1
(Never seem to find it all at once :-) Change-Id: I4b3d145c6d90be13f9afc8a72d8d87a92de88d88
2012-02-20pcmbuf minor cleaningMichael Sevakis1-10/+12
Group functions a bit better and expunge some obsolete function prototypes. Change-Id: Ifaf8a265dbe0a9f081e524b2e646e2dc50c6aa43
2011-08-28Commit work started in FS#12153 to put timing/position information in PCMMichael Sevakis1-10/+19
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 Sevakis1-0/+1
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 Sevakis1-1/+2
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 Sevakis1-1/+9
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 Sevakis1-0/+1
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 Goode1-0/+2
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 Goode1-1/+1
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 Goode1-7/+11
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 Goode1-45/+24
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23538 a1c6a512-1295-4272-9138-f99709370657
2009-11-05pcmbuf: better latency calculation, added debug codeJeffrey Goode1-1/+1
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 Goode1-2/+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-1/+0
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 Goode1-1/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22832 a1c6a512-1295-4272-9138-f99709370657
2009-08-18FS#10199: Adds limiter DSP functionJeffrey Goode1-0/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22394 a1c6a512-1295-4272-9138-f99709370657
2009-06-17Commit FS#10335 from Jeffrey Goode.Dan Everton1-0/+1
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 Stenberg1-6/+0
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 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-04-19Removed unused function get_pcmbuf_descsize from pcmbuf.cBertrik Sikken1-1/+0
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 Bavin1-1/+1
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-1/+1
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 Sevakis1-3/+3
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 Chapman1-1/+1
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 Sevakis1-3/+7
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 Sevakis1-4/+4
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 Sevakis1-1/+1
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 Pekkarinen1-1/+0
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 Bavin1-0/+1
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 Chapman1-1/+1
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 Malesinski1-0/+6
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 Low1-0/+4
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 Low1-5/+1
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 Low1-4/+3
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 Low1-2/+1
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 Low1-15/+30
* 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 Pekkarinen1-0/+1
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 Pekkarinen1-1/+1
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 Low1-2/+1
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 Pekkarinen1-1/+1
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 Pekkarinen1-0/+5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7412 a1c6a512-1295-4272-9138-f99709370657
2005-08-28Fixed iriver cpu boosting problems.Miika Pekkarinen1-0/+1
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 Pekkarinen1-0/+7
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 Pekkarinen1-1/+1
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 Pekkarinen1-4/+2
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 Pekkarinen1-0/+50
function calls (audiobuffer -> pcmbuf etc.). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7131 a1c6a512-1295-4272-9138-f99709370657