Commit graph

106 commits

Author SHA1 Message Date
Bertrik Sikken
66cf3a3329 Clean up some #includes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20238 a1c6a512-1295-4272-9138-f99709370657
2009-03-08 16:10:40 +00:00
Michael Sevakis
6c399b8254 Use DMA for audio playback on PP502x (FS#9910 + some further mods). I can't say at this point about any change in battery life but it frees up a percent or two of CPU cycles as measured in the buffering screen. No change in recording transfers yet. Testing seemed to check out so put it out for general use and see what happens.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20052 a1c6a512-1295-4272-9138-f99709370657
2009-02-19 20:40:03 +00:00
Michael Sevakis
e86ece4d34 Fix too-soon frequency unboost when pcm buffer crosses watermark from the low side. It's supposed to stay boosted until full again. Also align the static beep buffer to 4 bytes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20017 a1c6a512-1295-4272-9138-f99709370657
2009-02-16 18:45:43 +00:00
Michael Sevakis
94537f954e Gigabeat S: Implement an SDMA API and use it in the PCM driver. Some other miscellaneous adjustments to recording and PCM buffer to accomodate use of physical addresses and cache coherency.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19949 a1c6a512-1295-4272-9138-f99709370657
2009-02-08 22:32:41 +00:00
Björn Stenberg
ff498519d0 Red build fix.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19744 a1c6a512-1295-4272-9138-f99709370657
2009-01-10 21:38:56 +00:00
Björn Stenberg
6427d127aa Calculate watermark from bitrate and harddisk spinup time.
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
2009-01-10 21:10:56 +00:00
Michael Sevakis
26bf32c8aa Check that PCM is playing/recording *after* getting the current position from the hardware layer.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19435 a1c6a512-1295-4272-9138-f99709370657
2008-12-14 11:42:47 +00:00
Michael Sevakis
93572e2a9e Keyclick fixup take two. It is only 88 samples (2msec) long so keep a small static buffer around for beeps less than or equal to keyclick duration. This way it operates no matter the buffer state and still won't interfere with alternate PCM operations like recording or plugin playback.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19415 a1c6a512-1295-4272-9138-f99709370657
2008-12-13 06:01:08 +00:00
Michael Sevakis
5e73f9ff20 Fix FS#8660-Recording hardlocks with keyclick enabled and FS#9388-keyclicks too late. Introduce audio_buffer_state to check whether PCM buffer is useable or disabled (trashed).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19411 a1c6a512-1295-4272-9138-f99709370657
2008-12-13 01:32:39 +00:00
Michael Sevakis
f2f394793c Fix red and a couple other things I somehow missed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19378 a1c6a512-1295-4272-9138-f99709370657
2008-12-10 09:11:43 +00:00
Michael Sevakis
8cfbd3604f Use cookies for thread identification instead of pointers directly which 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-12-10 08:57:10 +00:00
Michael Sevakis
89da4328a0 Meg F/X can beep and click using a hardware timer so let us try it out. To match things up better, fix PCM beeping to give correct frequency (and get a pointer wrap bug too). Do some minor adjustments to compensate for corrections.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19355 a1c6a512-1295-4272-9138-f99709370657
2008-12-07 00:07:47 +00:00
Nils Wallménius
c616520dc5 Style police, place opening braces for function definitions on new lines
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19312 a1c6a512-1295-4272-9138-f99709370657
2008-12-03 12:04:52 +00:00
Michael Sevakis
0e97b1a1eb Fix FS#9507 - video audio is not played if song is paused. Audio was not being unmuted by playback.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19308 a1c6a512-1295-4272-9138-f99709370657
2008-12-02 23:30:10 +00:00
Daniel Stenberg
2acc0ac542 Updated our source code header to explicitly mention that we are GPL v2 or
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-06-28 18:10:04 +00:00
Michael Sevakis
405e90eecf PCM buffer muting doesn't seem benificial for wm8978 so turn it off.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17384 a1c6a512-1295-4272-9138-f99709370657
2008-05-05 14:52:07 +00:00
Bertrik Sikken
7f4a713af4 Removed unused function get_pcmbuf_descsize from pcmbuf.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17175 a1c6a512-1295-4272-9138-f99709370657
2008-04-19 23:08:13 +00:00
Steve Bavin
b24ed65faf Simplify pcmbuf_beep() a little, should be no functional change but it seems to mysteriously change the PortalPlayer 'keyclick beep of death' problem into a 'barely-there keyclick' problem.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16947 a1c6a512-1295-4272-9138-f99709370657
2008-04-03 14:24:37 +00:00
Andree Buschmann
21870cfd9b Fixes FS#8651 (noise and/or crash while crossfading). Latest ARM-asm submit for dsp showed we had a possible alignment issue with pcm-buffer when using crossfade.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16890 a1c6a512-1295-4272-9138-f99709370657
2008-03-30 10:11:31 +00:00
Steve Bavin
135cc757bd Revert my earlier const madness, we'll keep the parameter lists simple.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16863 a1c6a512-1295-4272-9138-f99709370657
2008-03-28 12:51:33 +00:00
Steve Bavin
c9df8fd87b The const police raid playback.c, should be no change to behaviour.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16860 a1c6a512-1295-4272-9138-f99709370657
2008-03-28 11:24:24 +00:00
Michael Sevakis
27cf677339 Add a complete priority inheritance implementation to the scheduler (all 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-03-25 02:34:12 +00:00
Nicolas Pennequin
ca55f133de Fix typo.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16026 a1c6a512-1295-4272-9138-f99709370657
2008-01-08 14:33:17 +00:00
Michael Sevakis
99617d71ba Make speex the new voice format for SWCODEC targets (non-Archos). Remove 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-11-18 17:12:19 +00:00
Michael Sevakis
88c4748a4b Couple more tiny changes. :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15639 a1c6a512-1295-4272-9138-f99709370657
2007-11-16 14:49:17 +00:00
Michael Sevakis
18330a050c Missed a couple changes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15638 a1c6a512-1295-4272-9138-f99709370657
2007-11-16 14:34:15 +00:00
Michael Sevakis
5398125fb3 Use sized data types for audio data in the pcm buffer. Speed up the clipping routine.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15636 a1c6a512-1295-4272-9138-f99709370657
2007-11-16 14:26:05 +00:00
Michael Sevakis
6077e5b7c8 Unify PCM interface just above the hardware driver level for all targets including the sims. Perform lockout of audio callback when changing states. Weird new playback or recording trouble? Check before and after this revision first though things seem quite sound.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15006 a1c6a512-1295-4272-9138-f99709370657
2007-10-06 22:27:27 +00:00
Michael Sevakis
3bec38e442 SWCODEC: Get rid of unneeded pcm_mute() calls. Leave the only ones that seem to be needed for WM codecs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13704 a1c6a512-1295-4272-9138-f99709370657
2007-06-24 20:36:58 +00:00
Michael Sevakis
e1dd10ddfb SWCODEC: Get rid of extra swap buffer and get back 512K of RAM or 100K if 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-03-19 22:04:17 +00:00
Michael Sevakis
938593b1d5 Put the sims in their place.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12650 a1c6a512-1295-4272-9138-f99709370657
2007-03-06 21:00:45 +00:00
Michael Sevakis
b425de71df Fix problem with recording screen creep and bag a bigfoot. Voice clips aren't long enough now to untrigger the thread boost that was supposed to be applied to the codec thread. The voice thread was needlessly boosting the codec thread and leaving it boosted which explains the encoders' ability to flood the output buffer when everything else was stopped in its tracks. Check which thread is calling pcmbuf_under_watermark and only initiate the boost when it's the codec thread. Always return the codec thread to its usual priority in pcmbuf_play_stop.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12649 a1c6a512-1295-4272-9138-f99709370657
2007-03-06 20:32:13 +00:00
Michael Sevakis
aba6ca0881 Fix resampling clicking as much as possible at the moment. 1) Upsampling 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
2007-02-07 00:51:50 +00:00
Jens Arnold
2597a13497 Next round of static'ing and related fixes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11836 a1c6a512-1295-4272-9138-f99709370657
2006-12-25 14:01:47 +00:00
Miika Pekkarinen
e3b0937a4a Priority overriding was not working correctly.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11573 a1c6a512-1295-4272-9138-f99709370657
2006-11-22 10:46:38 +00:00
Michael Sevakis
bf65676226 Removed muting from pcm buffer during starts, stops and pauses for tlv320 and uda1380. Far less in the way of pops now. Voice during FM radio playback keeps radio steady. If it is determined that other audio codecs don't benefit from this remove the muting code and defines altogether. Saving the state and not resetting more than needed seems to prevent popping more effectively than muting at DMA starts and stops. Voice can click a little if truncating a clip (not annoyingly though) but that should be handled by a DSP fade out over a few ms instead-- a side benefit would be a general DSP fade rather than using volume control.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11538 a1c6a512-1295-4272-9138-f99709370657
2006-11-16 05:33:42 +00:00
Michael Sevakis
5dd0775924 Calculation was wrong in pcmbuf_is_same_size such that is would almost certainly return false.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11460 a1c6a512-1295-4272-9138-f99709370657
2006-11-07 19:30:48 +00:00
Michael Sevakis
0f5cb94aa4 Big Patch adds primarily: Samplerate and format selection to recording for 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-11-06 18:07:30 +00:00
Miika Pekkarinen
7058752789 Removed ugly boosting solutions from playback code and let scheduler
handle unboosting instead.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11226 a1c6a512-1295-4272-9138-f99709370657
2006-10-15 11:57:52 +00:00
Steve Bavin
10befc8e6e Don't unboost CPU in an ISR
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11224 a1c6a512-1295-4272-9138-f99709370657
2006-10-15 11:03:26 +00:00
Brandon Low
1f3360f021 Just take out some out-of-date TODOs from playback.c and put a big FIXME in pcmbuf.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11217 a1c6a512-1295-4272-9138-f99709370657
2006-10-13 20:48:23 +00:00
Steve Bavin
d49c810ec9 Add CPU boost tracker to see where boosts are coming from
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11125 a1c6a512-1295-4272-9138-f99709370657
2006-10-05 10:07:03 +00:00
Steve Bavin
d5dcb49f17 Fix for crossfade crashes if in or out delay are zero
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11078 a1c6a512-1295-4272-9138-f99709370657
2006-09-27 15:23:10 +00:00
Steve Bavin
081281f6a1 Fix a crash and CPU being left boosted when using voice - FS#6024
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11053 a1c6a512-1295-4272-9138-f99709370657
2006-09-26 07:19:43 +00:00
Miika Pekkarinen
815684aced FS#5992 Reworked playback.c to fix voice bugs by Steve Bavin. Fixed to
work with the new scheduler and handled properly and fast the track
skipping.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10966 a1c6a512-1295-4272-9138-f99709370657
2006-09-17 08:34:42 +00:00
Miika Pekkarinen
a85044bf9e New scheduler, with priorities for swcodec platforms. Frequent task
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-16 16:18:11 +00:00
Dave Chapman
0a7ded3e29 Memory size checks in .c/.h files should use MEM, not MEMORYSIZE
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10557 a1c6a512-1295-4272-9138-f99709370657
2006-08-13 09:19:24 +00:00
Tomasz Malesinski
28910e7e17 Various lower limits and sizes for targets with 1MB of RAM (Iriver iFP7xx).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10556 a1c6a512-1295-4272-9138-f99709370657
2006-08-12 23:01:52 +00:00
Miika Pekkarinen
f3add92841 Adjusted buffer watermarks for better crossfade and playback stability.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10416 a1c6a512-1295-4272-9138-f99709370657
2006-08-02 18:35:24 +00:00
Miika Pekkarinen
c9a1b4e9aa Correctly enable crossfade mixmode only when not skipping tracks
manually.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9926 a1c6a512-1295-4272-9138-f99709370657
2006-05-14 14:08:26 +00:00