summaryrefslogtreecommitdiff
path: root/lib/rbcodec/dsp (follow)
Commit message (Collapse)AuthorAge
* iBasso DX50/DX90: Major code cleanup and reorganization.Udo Schläpfer2015-02-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reorganization - Separated iBasso devices from PLATFORM_ANDROID. These are now standlone hosted targets. Most device specific code is in the firmware/target/hosted/ibasso directory. - No dependency on Android SDK, only the Android NDK is needed. 32 bit Android NDK and Android API Level 16. - Separate implementation for each device where feasible. Code cleanup - Rewrite of existing code, from simple reformat to complete reimplementation. - New backlight interface, seperating backlight from touchscreen. - Rewrite of device button handler, removing unneeded code and fixing memory leaks. - New Debug messages interface logging to Android adb logcat (DEBUGF, panicf, logf). - Rewrite of lcd device handler, removing unneeded code and fixing memory leaks. - Rewrite of audiohw device handler/pcm interface, removing unneeded code and fixing memory leaks, enabling 44.1/48kHz pthreaded playback. - Rewrite of power and powermng, proper shutdown, using batterylog results (see http://gerrit.rockbox.org/r/#/c/1047/). - Rewrite of configure (Android NDK) and device specific config. - Rewrite of the Android NDK specific Makefile. Misc - All plugins/games/demos activated. - Update tinyalsa to latest from https://github.com/tinyalsa/tinyalsa. Includes - http://gerrit.rockbox.org/r/#/c/993/ - http://gerrit.rockbox.org/r/#/c/1010/ - http://gerrit.rockbox.org/r/#/c/1035/ Does not include http://gerrit.rockbox.org/r/#/c/1007/ due to new backlight interface and new option for hold switch, touchscreen, physical button interaction. Rockbox needs the iBasso DX50/DX90 loader for startup, see http://gerrit.rockbox.org/r/#/c/1099/ The loader expects Rockbox to be installed in /mnt/sdcard/.rockbox/. If /mnt/sdcard/ is accessed as USB mass storage device, Rockbox will exit gracefully and the loader will restart Rockbox on USB disconnect. Tested on iBasso DX50. Compiled (not tested) for iBasso DX90. Compiled (not tested) for PLATFORM_ANDROID. Change-Id: I5f5e22e68f5b4cf29c28e2b40b2c265f2beb7ab7
* fix surround & pbe dsp crashChiwen Chang2015-01-30
| | | | | | check handle before clean up buffer in flush(). Change-Id: I36a130c45c9f5dce97aa723ef98922b6935ead75
* fix pbe/haas surround dsps: surround_enabled, redo flush functions.Chiwen Chang2015-01-22
| | | | | | | | surround_enabled was never true, end up dsp_surround_flush didn't work; Thats why a cracking noise occurs in right channel when moving track positions. redo pbe/surround flush in a much simpler way suits the current single buffer style. Change-Id: I394054ddfb164b82c90b3dcf49df4442db87d8d2
* three new DSPsChiwen Chang2015-01-19
| | | | | | | | | | | | | | | perceptual bass enhancement - a bbe-ish group delay corrction with Biophonic EQ boost. - precut auditory fatigue reduction -reduce signal in frequency that may trigger temporary threshold shift haas surround -frequency between f(x1) and f(x2) is always bypassed. -can apply to side only. Change-Id: Icb6355ce9b1c99bf2c58c9385c3c411c0ae209d3
* DSP Compressor: Sidechain, Exponential Atk/RlsRyan Billing2013-12-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an improvement to the current compressor which I have added to my own Sansa Fuze V2 build. I am submitting here in case others find it interesting. Features added to the existing compressor: Attack, Look-ahead, Sidechain Filtering. Exponential attack and release characteristic response. Benefits from adding missing features: Attack: Preserve perceived "brightness" of tone by letting onset transients come through at a higher level than the rest of the compressed program material. Look-ahead: With Attack comes clipping on the leading several cycles of a transient onset. With look-ahead function, this can be pre-emptively mitigated with a slower gain change (less distortion). Look-ahead limiting is implemented to prevent clipping while keeping gain change ramp to an interval near 3ms instead of instant attack. The existing compressor implementation distorts the leading edge of a transient by causing instant gain change, resulting in log() distortion. This sounds "woofy" to me. Exponential Attack/Release: eMore natural sounding. On attack, this is a true straight line of 10dB per attack interval. Release is a little different, however, sounds natural as an analog compressor. Sidechain Filtering: Mild high-pass filter reduces response to low frequency onsets. For example, a hard kick drum is less likely to make the whole of the program material appear to fade in and out. Combined with a moderate attack time, such a transient will ride through with minimal audible artifact. Overall these changes make dynamic music sound more "open", more natural. The goal of a compressor is to make dyanamic music sound louder without necessarily sounding as though it has been compressed. I believe these changes come closer to this goal. Enjoy. If not, I am enjoying it Change-Id: I664eace546c364b815b4dc9ed4a72849231a0eb2 Reviewed-on: http://gerrit.rockbox.org/626 Tested: Purling Nayuki <cyq.yzfl@gmail.com> Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
* Fix FS#12889 : Audible pop right after setting Repeat/ShuffleMichael Sevakis2013-08-16
| | | | | | | | | The quickscreen calls settings_apply() and the crossfeed code wasn't checking that the right crossfeed was set before updating the filter for the custom setting, which was overwriting the Meier crossfeed data (custom and Meier share the same data space). Change-Id: Ifaa2f46fe062d4497681a2dd0d5068ec906c96a3
* Enable setting of global output samplerate on certain targets.Michael Sevakis2013-07-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Remove old EQ presets.Michael Giacomelli2013-06-21
| | | | | | | | | | | The old presets never made sense for Rockbox's EQ. They were apparently copied from some other software. We have a parametric EQ, that means that EQ bands can be made wider or narrower. Putting two identical bands side by side just wastes battery life and adds rounding error. Replacement presets are on gerrit but they need more work. In the mean time, users should probably not be using these. Change-Id: I85213100129fafd3ac0fa1a9438cb4d651bb94cb
* Missed removing a couple unwanted includes in previous commit.Michael Sevakis2013-05-27
| | | | | | Get those too. Change-Id: Id2a39afe7a61d6ec0cea38633b94fe1b7122204f
* Remove explicit config.h and system.h includes from DSP code.Michael Sevakis2013-05-27
| | | | | | | Replace with rbcodecconfig.h and platform.h includes. Remove now- unneeded ones as well. Change-Id: I6111b71e90bf86d9fe272a7916f2d34a5c6dd724
* Remove dsp_callback because DSP is now library code, not app code.Michael Sevakis2013-05-23
| | | | | | Yep, nope, not necessary anymore. Just call functions directly. Change-Id: I21dc35f8d674c2a9c8379b7cebd5613c1f05b5eb
* Introduce new hermite polynomial resampler.Michael Sevakis2013-05-16
| | | | | | | | | | | | | | | Uses the Catmull-Rom case of Hermite cubic splines. Vastly improves the quality and accuracy of audio resampling with a rather minor additional overhead compared to the previous linear implementation. ARM and Coldfire assembly implementations included. Change-Id: Ic45d84bc66c5b312ef373198297a952167a4be26 Reviewed-on: http://gerrit.rockbox.org/304 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested-by: Michael Sevakis <jethead71@rockbox.org>
* Rename all the "lin_resample..." stuff to simply "resample_...".Michael Sevakis2013-05-07
| | | | Change-Id: I79f44f0dcc1b23b33a5040795220713660a1d18a
* Purge the usage of DSP_SWITCH_FREQUENCY.Michael Sevakis2013-05-05
| | | | | | | | 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
* Fix missed optimization opportunity in dsp_process.Michael Sevakis2013-05-04
| | | | | | | | | Input type can only change once per call because the DSP parameters are only copied at the start and input is always taken from the src buffer which means sample input format switching can be once per call instead of once per loop. Change-Id: Ifa3521753428fb0e6997e4934f24a3b915628cc7
* Cleanup and simplify latest DSP code incarnation.Michael Sevakis2013-05-04
| | | | | | | | | | | | | | Some things can just be a bit simpler in handling the list of stages and some things, especially format change handling, can be simplified for each stage implementation. Format changes are sent through the configure() callback. Hide some internal details and variables from processing stages and let the core deal with it. Do some miscellaneous cleanup and keep things a bit better factored. Change-Id: I19dd8ce1d0b792ba914d426013088a49a52ecb7e
* Straighten out the mad twisted state of sound.c and related areas.Michael Sevakis2013-04-15
| | | | | | | | | | | | | | | | | | This is going right in since it's long overdue. If anything is goofed, drop me a line or just tweak it yourself if you know what's wrong. :-) Make HW/SW codec interface more uniform when emulating HW functionality on SWCODEC for functions such as "audiohw_set_pitch". The firmware-to- DSP plumbing is in firmware/drivers/audiohw-swcodec.c. "sound_XXX" APIs are all in sound.c with none in DSP code any longer. Reduce number of settings definitions needed by each codec by providing defaults for common ones like balance, channels and SW tone controls. Remove need for separate SIM code and tables and add virtual codec header for hosted targets. Change-Id: I3f23702bca054fc9bda40f49824ce681bb7f777b
* Implement universal in-PCM-driver software volume control.Michael Sevakis2013-04-11
| | | | | | | | | | | | | | | | | | | | | | Implements double-buffered volume, balance and prescaling control in the main PCM driver when HAVE_SW_VOLUME_CONTROL is defined ensuring that all PCM is volume controlled and level changes are low in latency. Supports -73 to +6 dB using a 15-bit factor so that no large-integer math is needed. Low-level hardware drivers do not have to implement it themselves but parameters can be changed (currently defined in pcm-internal.h) to work best with a particular SoC or to provide different volume ranges. Volume and prescale calls should be made in the codec driver. It should appear as a normal hardware interface. PCM volume calls expect .1 dB units. Change-Id: Idf6316a64ef4fb8abcede10707e1e6c6d01d57db Reviewed-on: http://gerrit.rockbox.org/423 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested-by: Michael Sevakis <jethead71@rockbox.org>
* EQ settings: Rework the settings to clean up the config file.Jonathan Gordon2013-02-09
| | | | | | | | | | | | | | | | | | | Instead of 3 cfg lines per eq band there is now a single line for each: <config name>: <cutoff/center freq>, <q>, <gain> In addition, the config value names make a bit more sense. The old settings are still readable but config.cfg and any new settings files will be written with the new config values. (The old settings will be removed completly sometime after the next stable release). Also a slight rework of the advanced EQ menu UI Change-Id: I9008658d36ded442a5f2f825916df42a3934cbef Reviewed-on: http://gerrit.rockbox.org/394 Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
* 10 Band EQ w/PresetsHayden Pearce2013-01-29
| | | | | | | | | | | - A 10 Band EQ for Rockbox w/ presets adapted from VLC - frequency stepping at 32, 64, 125, 250, 500 1K, 2K, 4K, 8K, 16K Change-Id: I85ad84d70a534edfc66c6ad9af8a76f022a02ec7 Reviewed-on: http://gerrit.rockbox.org/386 Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
* Fix FS#12794 - new EQ code does not compile for the Nokia N8x0Michael Sevakis2012-12-28
| | | | | | | | | The old GCC version currently required (sbox-arm-linux-gcc 3.4.4 release) apparently has trouble with function pointers used as static array initializers when using indexed initializers + ranges (ie. [A ... B] = fn). Change-Id: I494c2b607e4d93a9893264749d0ac257fb54ce3b
* New crossfeed algorithm for Rockbox: "Meier" crossfeedBertrik Sikken2012-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Emulates the basic "Meier" crossfeed (2 capacitors, 3 resistors) as discussed in http://www.meier-audio.homepage.t-online.de/passivefilter.htm This crossfeed blends a bit of low-pass filtered L signal into the R signal (and vice versa) while adding about 300 us delay to the crossfed-signal. A difference with the crossfeed already present in rockbox, is that this algorithm keeps the total spectrum flat (the one currently in rockbox accentuates low-frequency signals, making it sound a bit muffled). This implementation is quite lightweight, just 3 multiplies per left-right pair of samples. Has a default C implementation and optimized assembly versions for ARM and Coldfire. The crossfeed effect is quite subtle and is noticeable mostly one albums that have very strong left-right separation (e.g. one instrument only on the left, another only on the right). In the user interface, the new crossfeed option appears as "Meier" and is not configureable. The existing crossfeed is renamed to "Custom" as it allows itself to be customised. There is no entry for the user manual yet. Change-Id: Iaa100616fe0fcd7e16f08cdb9a7f41501973eee1
* Stop timestretch freezing things during format changes.Michael Sevakis2012-05-21
| | | | | | | | When it was inactive but enabled, the format change hook was dropping through to code that it shouldn't execute without it also being active in processing samples. Change-Id: Ie7899df0395d3f0d10f2bf2b55ea549dd06749a7
* Revert "Work in progress hermite resampler."Michael Giacomelli2012-05-20
| | | | This reverts commit f358228ea1bc66804e9ea12b65c2593c6c1fe8ee.
* Work in progress hermite resampler.Michael Giacomelli2012-05-20
| | | | | | Based on http://src.gnu-darwin.org/ports/multimedia/helixplayer/work/hxplay-1.0.7/audio/resampler/hermite.c Change-Id: Id87565a060aa2383701e7c2f3ea023c7555ad9ef
* dsp_arm: Fix up some .section directives to fix crash on app targets.Thomas Martitz2012-05-13
| | | | | | | This is needed on app targets as e.g. ".section .icode" leads to the code getting linked to incorrect locations (0x0 in this case). Change-Id: Ic28c5ae6d4f8001d211d685b5ca92d5ffff0c7b2
* TDSpeed: Fix crackling on some systemsNils Wallménius2012-05-12
| | | | | | | | Use memmove instead of memcpy for overlapping copy, fixes crackling in sims and warble on my system. Native targets seem to have been unaffected. Change-Id: I265d4ce373e224581bd2f5ba15c75b473ec231f2
* TDSpeed settings to setup call need to be recorded, always.Michael Sevakis2012-05-11
| | | | | | | | If the settings, like samplerate, were to go out of range where timestretch drops out of processing and then go back to the same as when they were valid, it would fail to switch back on by itelf. Change-Id: Ic5bcb268540b0db8e0483117b8a5a0ce5c5a9db0
* TDSpeed: Minor assembly optimization to frame fade on Coldfire.Michael Sevakis2012-05-11
| | | | | | | | Makes quite a huge difference to get rid of 64-bit math in a hot area. Cuts about 12 MHz. Generic routine generates good code on ARM and asm cuts no instructions there. Change-Id: I4ac647406006c42004f9f5ab396cbf4e85688854
* TDSpeed: Fix up samples consumed return (FS#12666) + other stuff like...Michael Sevakis2012-05-10
| | | | | | | | | Wrap up the the stereo case into loops and remove unused calculations hanging out in tdspeed_update(). A wee little bit of code style and column policing. Change-Id: I8dd3ab4b3e7e56b55dc00c00f3e32996228cc457
* Rename HAVE_PITCHSCREEN to HAVE_PITCHCONTROLNils Wallménius2012-05-09
| | | | | | | | 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>
* Tweak dsp_format_change_process (default format handler).Michael Sevakis2012-05-08
| | | | | | Just stop searching if the entry is found (as it should have been). Change-Id: Id968694e825282d58c8ca4a7789c236f98643a5f
* Consolidate some sample input code.Michael Sevakis2012-05-08
| | | | | | | Input functions have common setup sequences that can be placed into an inline function instead of repeating it all repeatedly. Change-Id: I9e62904ff0948651c64ddf160ed4400ed6dc81ff
* rbcodec: abstract tdspeed buffer allocationNils Wallménius2012-05-07
| | | | | | | | | | | | | Move code dealing with rockbox specific buflib allocations into a rockbox specific file and implement buffer allocation with malloc/free for warble/stand alone lib. Based on patch by Sean Bartell. Change-Id: I8cb85dad5890fbd34c1bb26abbb89c0b0f6b55cf Reviewed-on: http://gerrit.rockbox.org/144 Tested-by: Nils Wallménius <nils@rockbox.org> Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Reviewed-by: Nils Wallménius <nils@rockbox.org>
* Correct comments in lin_resample re: what is actually used by asm.Michael Sevakis2012-05-06
| | | | Change-Id: Idd457f3c645c5d469ebc6fab0bfc85e7b8dd56da
* Remove pointless IRAM allocation from voice DSP.Michael Sevakis2012-05-04
| | | | | | | | | It's always used in MONO mode and doesn't need the IRAM sample/ resample buffers and 1280 bytes can be freed. M5 can now have its PCM mixer downmix buffer in IRAM. Change-Id: I0af08be5b212b7dfe382bba588a6585eb328a038
* rbcodec: Hooks for target specific functions in dsp_process loopMichael Sevakis2012-05-03
| | | | | | | | | | Use them to move tick counting, yielding and coldfire macsr handling code to a rockbox specific file. Change-Id: Id7417dc98c08a342eba45ba56b044a276e50564b Reviewed-on: http://gerrit.rockbox.org/229 Tested-by: Nils Wallménius <nils@rockbox.org> Reviewed-by: Nils Wallménius <nils@rockbox.org>
* Make INITDATA_ATTR work on everything that has INIT_ATTR enabled for code.Michael Sevakis2012-05-01
| | | | Change-Id: If9936bfbbd3bc3eb2a3e3e290701b8517eabfb13
* Should've had dsp_replaygain_set_gains as static for now...Michael Sevakis2012-04-30
| | | | | | ...because currently gains are only set through dsp_configure. Change-Id: I2866473a82fdd5f41de4705b45928daa7e43f8eb
* Still need settings.h in dsp_misc.c for now for software volume.Michael Sevakis2012-04-30
| | | | Change-Id: I824e8f9935013f6e2a1db6ccd2db4bd406257057
* Make DSP's replaygain independent of global_settings.Michael Sevakis2012-04-30
| | | | | | | | | | Moves replaygain definitions to lib/rbcodec/dsp/dsp_misc.h. Intermediate functions in misc.c handle any adjustment and calling the rbcodec APIs. Change-Id: I9f03561bca9aedd13760cf19c4e19aa3c68e7024 Reviewed-on: http://gerrit.rockbox.org/140 Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
* Put the <string.h> channel_mode.c for memcpy.Michael Sevakis2012-04-29
| | | | | | Hmmm, how'd I miss that? Change-Id: I30d9a1b5f053aad069687aa0a01ebdf40a6b2d76
* Make rbcodec/dsp includes more specific.Michael Sevakis2012-04-29
| | | | Change-Id: Idb6af40df26f5b8499a40e8b98602261ef227044
* Make compressor_update static.Michael Sevakis2012-04-29
| | | | Change-Id: Ic29242b4c397e82c2bee3808492a2d0a9ffebbe6
* Lower IRAM footprint on ARM.Michael Sevakis2012-04-29
| | | | | | | Move a few functions to .text that probably don't see a huge benefit from being .icode. Will scrutinize later. Change-Id: I7bdffc326076c5cd7e6a1c57d25d31e653920327
* Fix 3g warning in dsp_arm.S (which showed as an error).Michael Sevakis2012-04-29
| | | | Change-Id: Iccbeca66e809413dda90fec36439b4a180b8a879
* Fix no newline at end warning.Michael Sevakis2012-04-29
| | | | Change-Id: I9edb1ebb34f91893b6290d7640fcdaede3434b40
* Fundamentally rewrite much of the audio DSP.Michael Sevakis2012-04-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Some whitespace correction in dsp_*.SMichael Sevakis2012-04-27
| | | | Change-Id: I6ee14c0adc9dd456c8a2d171952cbaedb3752428
* rbcodec refactoring: dsp_set_eq_coefsSean Bartell2012-04-27
| | | | | | | | | dsp_set_eq_coefs now has parameters for the band settings, so it doesn't need to access global_settings. Change-Id: I29ac19fc353b15a79cb25f0e45132aef0881e4c9 Reviewed-on: http://gerrit.rockbox.org/138 Reviewed-by: Nils Wallménius <nils@rockbox.org>