summaryrefslogtreecommitdiff
path: root/firmware/pcm_record.c
AgeCommit message (Collapse)Author
2007-06-08Straighten out some audio path APIs and misc. audio stuff. Having recording ↵Michael Sevakis
is not a prerequisite to having input/output source selection which is probably most useful when adding a audio input features like FM to a new port without forcing recording to be implemented first. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13599 a1c6a512-1295-4272-9138-f99709370657
2007-04-25Make recording complain about every little file I/O problem (error on ↵Michael Sevakis
close() failure and fsync() failure). Why? I guess we will find out the disk is full about 1/2 sector sooner on average when the file APIs actually detect this correctly. :/ git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13262 a1c6a512-1295-4272-9138-f99709370657
2007-03-31Recording queue should be set to IRQ safe mode as well.Miika Pekkarinen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12983 a1c6a512-1295-4272-9138-f99709370657
2007-03-29Accept FS#6918 - Remove Nested Functions by Tim Ross. Adjust some names. ↵Michael Sevakis
Hunt down and remove the remaining ones in the recording system as well. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12955 a1c6a512-1295-4272-9138-f99709370657
2007-03-20More logf fixes. speex.c wants to format 64bit args so I didn't change that ↵Michael Sevakis
one nor add any formatting for that. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12858 a1c6a512-1295-4272-9138-f99709370657
2007-03-05More catching up on old work. Refine audio interface setup on Coldfire. Stop ↵Michael Sevakis
the funky glitching on the iAudio stuff when starting recording esp. at 88.2kHz. (probably due to the bidi interface). iRivers don't seem to care what you do. TLV320 still seems to have a little trouble selecting it's filters correctly for 88.2kHz or it could be some odd phasing effect. Get rid of the horrible reset parameter in pcm_apply_settings as it can decide for itself. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12618 a1c6a512-1295-4272-9138-f99709370657
2007-03-04Dual core support for PP502x players (iPod G4 and later, iriver h10, Sansa - ↵Daniel Ankers
iPod G3 will be coming soon.) This allows threads to be run on either core provided that all communications between the cores is done using uncached memory. There should be no significant change in battery life from doing this. Documentation (on the RockboxKernel wiki page) will follow shortly. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12601 a1c6a512-1295-4272-9138-f99709370657
2007-02-16Fix errors I hope.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12333 a1c6a512-1295-4272-9138-f99709370657
2007-02-16SWCODEC Recording: Improve buffer handling by 1) Lowering watermark for ↵Michael Sevakis
flushing 2) Flushing down to a low watermark instead of a fixed number of chunks 3) Allowing in-process automatic flushes to be interrupted so file splits and stops can be marked in a timely manner (especially important when approaching 2GB limit) 4) Flush small amounts if buffer is filled during a split to protect integrity of streams 5) Boost both pcmrec and codec threads then thread priority boost is needed so that encoder doesn't fail to run and keep up with incoming data git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12332 a1c6a512-1295-4272-9138-f99709370657
2007-01-31Finish putting all the code and data that depends upon ↵Michael Sevakis
HAVE_PRIORITY_SCHEDULING into the #ifdef blocks git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12163 a1c6a512-1295-4272-9138-f99709370657
2006-12-25Make recording compile without priority schedulingBrandon Low
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11837 a1c6a512-1295-4272-9138-f99709370657
2006-12-19Convert queues to use intptr_t for event data and return values as most of ↵Michael Sevakis
the time pointer are not passed and it should make some things a bit cleaner. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11818 a1c6a512-1295-4272-9138-f99709370657
2006-12-17SWCODEC recording: More cleanup of stuff after queue additions and audio ↵Michael Sevakis
driver unification. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11783 a1c6a512-1295-4272-9138-f99709370657
2006-12-17SWCODEC: More recording simplifications and less UI hanging in some cases ↵Michael Sevakis
using queue_send. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11781 a1c6a512-1295-4272-9138-f99709370657
2006-12-16Commit the kinds of changes that queue_send is mean for.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11778 a1c6a512-1295-4272-9138-f99709370657
2006-12-10Place all recording functionality on pcmrec thread to serialize all ↵Michael Sevakis
recording operations. Button mash problems should be ruled out of pcm_record.c. Add additional lightweight checks by default and display any warnings that occurred during recording in first line of recording screen when they occur by blinking back and forth from warning display to normal line (Warning: <hex bitmask>). Warnings are cleared when beginning a new recording so write the number down if you see it and file a report. Add heavier checks when PCMREC_PARANOID is defined in the player config header (encoders and pcm_record must be aware of the define since it changes the chunk header format). These checks are mainly concerned with things that may cause skipping but also add unwanted overhead for normal operation. Best used with logf enabled. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11705 a1c6a512-1295-4272-9138-f99709370657
2006-12-07SWCODEC Recording: 1) Fix minor bug of not subtracting line aligment ↵Michael Sevakis
adjustment from buffer size. 2) Handle stop and pause better and let pcmrec thread lock the DMA as that could cause prerecording to get disabled internally 3) Make sure to snapshot DMA write index to ensure compiler doesn't perform multiple access when calculating available data (probably just paranoia on my part) 4) Handle USB connect in recording thread a little better by resetting hardware to defaults after closing 5) Make power managment stop recording properly when powering off (ie. no yield() from interrupt handler! :) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11685 a1c6a512-1295-4272-9138-f99709370657
2006-12-06Small change to PCM recording API for low latency effects. Latency can be as ↵Michael Sevakis
low as 14 samples from input to output including the FIFOs (ColdFire) but 16 is more reasonable an expectation if only tranferring one sample per interrupt (\!). May convert PCM playback to use the same method as it can still be used in the old manner with some slight mods but has the potential to enable new features since it is more flexible. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11668 a1c6a512-1295-4272-9138-f99709370657
2006-12-05Removed the cpu boost tracking debug feature for now because ofMiika Pekkarinen
different kind of problems. Better implementation can be done later. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11665 a1c6a512-1295-4272-9138-f99709370657
2006-11-29PCM: A few tiny changes. 1) Recording a) Flush all pending files if filename ↵Michael Sevakis
queue is full or else perpetual flushing of 1 will occur at low bitrates and short split times. b) #ifdef out currently unused bits and save little less than 1/2K 2) Cleanup some declarations. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11623 a1c6a512-1295-4272-9138-f99709370657
2006-11-23iRiver/iAudio: Added audio_set_recording gain and sound_default to plugin ↵Michael Sevakis
API. Simplified plugin recording by target/-ing some audio functions. UDA1380 records with WSPLL as a result. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11577 a1c6a512-1295-4272-9138-f99709370657
2006-11-22Audio bugfixes. Should wait for voice codec to reload before returning ↵Michael Sevakis
buffer when stealing voice. Certain variables that get or may get used during an IRQ should be declared 'volatile'. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11572 a1c6a512-1295-4272-9138-f99709370657
2006-11-13H100/General: HAL for S/PDIF and refinement/bufixes in optical output ↵Michael Sevakis
powering/source selection. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11523 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-05Add CPU boost tracker to see where boosts are coming fromSteve Bavin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11125 a1c6a512-1295-4272-9138-f99709370657
2006-09-20Forgot to remove a must_boost reference. Unboost after fsyncMichael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11008 a1c6a512-1295-4272-9138-f99709370657
2006-09-20Make sure CPU is boosted when writing recorded dataMichael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11007 a1c6a512-1295-4272-9138-f99709370657
2006-09-16New scheduler, with priorities for swcodec platforms. Frequent taskMiika Pekkarinen
switching should be more efficient and tasks are stored in linked lists to eliminate unnecessary task switching to improve performance. Audio should no longer skip on swcodec targets caused by too CPU hungry UI thread or background threads. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10958 a1c6a512-1295-4272-9138-f99709370657
2006-09-02Display bitrate (Q value for Archos), samplerate, channels and recording ↵Martin Scarratt
format (M = MP3) in the statusbar in the recording screen. This is all new info for archos targets and I-river targets now have this info on the remote as well as the main screen git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10856 a1c6a512-1295-4272-9138-f99709370657
2006-08-28Added FS#2939 Encoder Codec Interface + Codecs by Antonius Hellmann with ↵Michael Sevakis
additional FM Recording support and my modifications git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10789 a1c6a512-1295-4272-9138-f99709370657
2006-07-21Patch #5347 by Rani Hod - Adds FM radio and recording features to the iAudio X5.Linus Nielsen Feltzing
Also includes a rewrite of the Coldfire I2C driver to include both read and write. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10272 a1c6a512-1295-4272-9138-f99709370657
2006-06-30For iriver recording: do not boost while recording unless source is spdif. ↵Peter D'Hoye
When saving to disk, boost if needed. Decreased max file size a bit for safety. Increases runtime while recording analog sources. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10159 a1c6a512-1295-4272-9138-f99709370657
2006-05-14Iriver: Moved the handling of the UDA1380 split gain (analog preamp + ↵Jens Arnold
decimator gain) into the UDA driver. * All: Settings structure sorted & cleaned up. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9927 a1c6a512-1295-4272-9138-f99709370657
2006-05-12H1x0: Obey SPDIF power setting for monitoring SPDIF recordings as far as ↵Jens Arnold
possible. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9923 a1c6a512-1295-4272-9138-f99709370657
2006-05-12Iriver recording: Always route the signals through the coldfire audio ↵Jens Arnold
interface for monitoring. Advantages: (H1x0) Enables parallel analog and SPDIF monitoring of both analog or SPDIF sources. When recording from SPDIF, the SPDIF monitor signal is pure pass-through. (all) Digital clipping is now audible in the analog monitor signal. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9918 a1c6a512-1295-4272-9138-f99709370657
2006-05-11Optical S/PDIF recording and monitoring for Iriver H1x0. Removed unsupported ↵Thom Johansen
recording options on Iriver. Sample rate displayed in recording screen reflects the real S/PDIF sample rate when doing S/PDIF recording. Testing would be appreciated. Thanks to Jens Arnold for fixing the DMA hang issue. Will reset settings! git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9916 a1c6a512-1295-4272-9138-f99709370657
2006-04-30Recording buffer offset must be passed on to the firmware calls, not the ↵Peter D'Hoye
other way around. Should fix yellow builds. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9842 a1c6a512-1295-4272-9138-f99709370657
2006-04-30The recording buffer should not try to use the voice buffer, so map our ↵Peter D'Hoye
buffer after it. On swcodec targets, recording always uses this buffer so always notify the others that we did. Fixes bug 4754. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9841 a1c6a512-1295-4272-9138-f99709370657
2006-03-09Yet another recording peakmeter sensitivity fix: only reset peak values ↵Peter D'Hoye
after they've been read git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8985 a1c6a512-1295-4272-9138-f99709370657
2006-03-09Fix by Jvo Studer for bugreport #4799. Recorded bytes counter wasn't updated ↵Peter D'Hoye
with pre-recording bytes, causing an issue when file-splitting because of maximum filesize limit. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8979 a1c6a512-1295-4272-9138-f99709370657
2006-03-01Stop mixing signed and unsigned when dealing with audioPeter D'Hoye
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8876 a1c6a512-1295-4272-9138-f99709370657
2006-02-27Oops: clipping detection optimization broke pre-recordingPeter D'Hoye
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8861 a1c6a512-1295-4272-9138-f99709370657
2006-02-26Store recorded peak values in short; this should fix an issue where clipping ↵Peter D'Hoye
wasn't always detected. Also removed an obsolete function. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8852 a1c6a512-1295-4272-9138-f99709370657
2006-02-24use all recorded samples for peak metering and clipping detectionPeter D'Hoye
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8837 a1c6a512-1295-4272-9138-f99709370657
2005-12-23Committed the pre-recording patch for iriver (#1387531 by Peter D'Hoye).Miika Pekkarinen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8287 a1c6a512-1295-4272-9138-f99709370657
2005-12-15H300 FM radio support, with help from Peter D'HoyeLinus Nielsen Feltzing
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8237 a1c6a512-1295-4272-9138-f99709370657
2005-12-02Fixed recording peak meters to always work. Now it should be easy toMiika Pekkarinen
add pre-recording support too. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8126 a1c6a512-1295-4272-9138-f99709370657
2005-12-02Fixed ui lag while writing recorded data to disk.Miika Pekkarinen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8122 a1c6a512-1295-4272-9138-f99709370657
2005-12-02iRiver recording changes:Andy
- Added Peakmeter in recording screen - Fix for stop bug - Fix for playback peakmeter not working after recording git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8120 a1c6a512-1295-4272-9138-f99709370657
2005-11-12Removed monitor option from audio_set_recording_options and the global ↵Andy
setting rec_monitor. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7821 a1c6a512-1295-4272-9138-f99709370657