summaryrefslogtreecommitdiff
path: root/apps/plugins/pitch_detector.c
AgeCommit message (Collapse)Author
2012-03-03Revise the PCM callback system after adding multichannel audio.Michael Sevakis
Additional status callback is added to pcm_play/rec_data instead of using a special function to set it. Status includes DMA error reporting to the status callback. Playback and recording callback become more alike except playback uses "const void **addr" (because the data should not be altered) and recording uses "void **addr". "const" is put in place throughout where appropriate. Most changes are fairly trivial. One that should be checked in particular because it isn't so much is telechips, if anyone cares to bother. PP5002 is not so trivial either but that tested as working. Change-Id: I4928d69b3b3be7fb93e259f81635232df9bd1df2 Reviewed-on: http://gerrit.rockbox.org/166 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested-by: Michael Sevakis <jethead71@rockbox.org>
2011-12-08AS3525v1/v2:Michael Sevakis
Fix problems with volume of recorded material by converting 14-bit samples to 16-bit. Remove duplicate samples from recorded data and support proper samplerate since ADC runs 1/2 the codec clock. Support monitoring mono on both output channels by feeding data manually to I2SOUT under the right conditions. DMA is no longer used for recording since frames must be processed as described above but it does allow full-duplex audio. Miscellaneous change includes a proper constant (HW_SAMPR_DEFAULT) to reset the hardware samplerate when recording is closed. PP5024 and AS3525 have different default recording rates (22kHz and 44kHz respectively) but both have half-speed ADC. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31180 a1c6a512-1295-4272-9138-f99709370657
2011-05-01Fix further 'variable set but not used' warnings reported from GCC 4.6.0.Andree Buschmann
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29809 a1c6a512-1295-4272-9138-f99709370657
2011-03-02RaaA: Fix write locations of pluginsThomas Jarosch
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29506 a1c6a512-1295-4272-9138-f99709370657
2011-01-24* Rename backlight_force_on to backlight_ignore_timeout to make it clear ↵Teruaki Kawashima
what the function does. * Add backlight_force_on() which forces to turn on backlight even when the setting is set to Off. use this in lamp. No functional change except lamp. See aslo FS#9883. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29128 a1c6a512-1295-4272-9138-f99709370657
2011-01-14pitch_detector: add the key transposition feature which makes the plugin ↵Alexander Levin
better usable with/for transposing instruments (FS#11752 by Robert Horn) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29052 a1c6a512-1295-4272-9138-f99709370657
2011-01-11pitch_detector: bring the name of the settings file in line with the plugin nameAlexander Levin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29031 a1c6a512-1295-4272-9138-f99709370657
2011-01-08Revert r29004 putting the original comment back (sorry to fml for this :)Mustapha Senhaji
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29006 a1c6a512-1295-4272-9138-f99709370657
2011-01-08pitch detector: Fix a typo in a comment.Mustapha Senhaji
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29004 a1c6a512-1295-4272-9138-f99709370657
2011-01-07pitch_detector: remove a double 'break'Alexander Levin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28995 a1c6a512-1295-4272-9138-f99709370657
2011-01-07pitch_detector: the menu function already returns a bool, so use the return ↵Alexander Levin
value directly git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28994 a1c6a512-1295-4272-9138-f99709370657
2010-11-21Use MEM_ALIGN_ATTR in pitch detector plugin.Andree Buschmann
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28636 a1c6a512-1295-4272-9138-f99709370657
2010-10-15Pitch detector: do not break profiling builds.Nils Wallménius
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28283 a1c6a512-1295-4272-9138-f99709370657
2010-09-14pitch_detector: don't use a struct with only one memberRafaël Carré
use fixed point type (fixed == int32_t) directly git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28072 a1c6a512-1295-4272-9138-f99709370657
2010-09-07pitch_detector: build with -std=gnu99Rafaël Carré
casts in const tables declaration seesm to confuse gcc into thinking the initializers are not constant Also merge struct declaration and typedef git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28020 a1c6a512-1295-4272-9138-f99709370657
2010-08-30Plugins: modify IRAM copying codeRafaël Carré
Move to plugin_crt0.c, plugins don't need PLUGIN_IRAM_* macros anymore IRAM is no longered zeroed before copying (as it is at the same address than BSS) -> Fix FS#11581 Use cpucache_invalidate() (and not cpucache_flush), needed for self-modifying code on cached IRAM git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27948 a1c6a512-1295-4272-9138-f99709370657
2010-08-28pitch_detector: use lcd_putsxyf(), not lcd_putsf()Rafaël Carré
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27922 a1c6a512-1295-4272-9138-f99709370657
2010-08-28pitch detector: remove more unused functions for sim buildsRafaël Carré
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27920 a1c6a512-1295-4272-9138-f99709370657
2010-08-28pitch detector: remove unused functions for sim buildsRafaël Carré
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27919 a1c6a512-1295-4272-9138-f99709370657
2010-08-28pitch_detector: cleanupRafaël Carré
- cosmetics: remove trailing white space - mark all functions and variables as static - merge struct definition and declaration when possible - rename tuner_settings -> settings (because it's shorter) - remove unused enums - don't give pointer to settings struct as argument since there is only one struct, same for the settings filename - fix error cases in settings load: reset settings when loading failed close file when it hasn't the right size - inline small load/save functions only used once - remove unused print_char_xy - inline print_str and print_int_xy, and use lcd_putsf (added to the plugin API) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27918 a1c6a512-1295-4272-9138-f99709370657
2010-08-28pitch_detector: avoid a division by zero when changing 'lowest frequency' ↵Rafaël Carré
setting git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27917 a1c6a512-1295-4272-9138-f99709370657
2010-08-24Second try: Introduce plugin_crt0.c that every plugin links.Thomas Martitz
It handles exit() properly, calling the handler also when the plugin returns normally (also make exit() more standard compliant while at it). It also holds PLUGIN_HEADER, so that it doesn't need to be in each plugin anymore. To work better together with callbacks passed to rb->default_event_handler_ex() introduce exit_on_usb() which will call the exit handler before showing the usb screen and exit() after it. In most cases rb->default_event_handler_ex() was passed a callback which was manually called at all other return points. This can now be done via atexit(). In future plugin_crt0.c could also handle clearing bss, initializing iram and more. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27873 a1c6a512-1295-4272-9138-f99709370657
2010-08-23Revert "Introduce plugin_crt0.c that every plugin links."Thomas Martitz
Too much errors and no time to fix them now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27863 a1c6a512-1295-4272-9138-f99709370657
2010-08-23Introduce plugin_crt0.c that every plugin links.Thomas Martitz
It handles exit() properly, calling the handler also when the plugin returns normally (also it makes exit() more standard compliant while at it). It also holds PLUGIN_HEADER, so that it doesn't need to be in each plugin anymore. To work better together with callbacks passed to rb->default_event_handler_ex introduce exit_on_usb() which will call the exit handler before showing the usb screen and exit() after it. In most cases it was passed a callback which was manually called at all other return points. This can now be done via atexit(). In future plugin_crt0.c could also handle clearing bss, initializing iram and more. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27862 a1c6a512-1295-4272-9138-f99709370657
2010-06-26e200v1/c200v1: Implement limited samplerate switching. Rates 24kHz and below ↵Michael Sevakis
are being a bear as far as minor crackling at higher amplitude-- leave them out for the time being since no solution is currently evident. 48, 44, 32 (rec rates 24, 22, 16) seem perfectly fine. I'm betting c200 is ok to include because it uses the same setup as e200. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27139 a1c6a512-1295-4272-9138-f99709370657
2010-05-24Make PCM->driver interface about as simple as it will get. Registered ↵Michael Sevakis
callback, zero data, alignment and stops are handled entirely inside pcm.c; driver merely calls fixed pcm.c callback. Remove pcm_record_more and do it just like playback; the original reason behind it isn't very practical in general. Everything checks out on supported targets. There wer some compat changes I can't check out on many unsupoorted but if there's a problem it will be a minor oops. Plugins become incompatible due to recording tweak-- full update. Sorted API. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26253 a1c6a512-1295-4272-9138-f99709370657
2010-05-20S#10387 - Rework pluginlib actionsThomas Martitz
It changes pluginlib actions to contain only a single and simple context (and other one for remote directional buttons), consisting of 7(9) buttons: up/down/left/right, select OR short select and long select, exit and cancel (plus 2 for scrollwheel targets). This ensures contexts don't clash with other contexts and simplifies them, at the expense of reduced versatility. However, the versatility made it largely unusable due to the great number of targets. This should allow for using pluginlib actions safely for the most simple plugins (e.g. almost all demos). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26202 a1c6a512-1295-4272-9138-f99709370657
2010-05-14Give pitch_detector the IRAMming it deserves.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26018 a1c6a512-1295-4272-9138-f99709370657
2010-05-14Cache align the pitch detector audiobuffer where needed. Some other misc. ↵Michael Sevakis
changes to try to make sure everything builds. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26011 a1c6a512-1295-4272-9138-f99709370657
2010-05-14Fix some sim warnings.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26006 a1c6a512-1295-4272-9138-f99709370657
2010-05-14pitch_detector: Use continuous recording, even if the algorithm is too slow ↵Michael Sevakis
for that and record a whole buffer even if the min frequency is higher. Use the minimum samplerate that allows C-4186 to be detected (usually 11.025kHz, which can reduce computational load to 1/16 compared to 44.1kHz). Get rid of 64-bit multiplies when calculating input RMS value. Stop audio playback when entering plugin. Better backlight and CPU frequency handling. audio_sample_type->int16_t. simpler buffer size rounding. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26005 a1c6a512-1295-4272-9138-f99709370657
2010-05-13fix pitch_detector: recording will stop itself if the callback returns <0Rafaël Carré
stopping recording 2 times might have harmful effects git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26002 a1c6a512-1295-4272-9138-f99709370657
2010-05-06Make creat() posix compliant API-wise. Shouldn't affect the core as it's ↵Thomas Martitz
wrapped via a static inline. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25843 a1c6a512-1295-4272-9138-f99709370657
2010-03-29pitch_detector: fix builds on monochrome targets, remove an unused variableRafaël Carré
Add icons for Clip, copied from c200 icons git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25397 a1c6a512-1295-4272-9138-f99709370657
2009-12-05Fix division by 0 by clamping freq value a little higher, some minor style ↵Nils Wallménius
and whitespace changes git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23850 a1c6a512-1295-4272-9138-f99709370657
2009-10-04Don't assume AUDIO_SRC_MIC always exists.Dave Chapman
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22907 a1c6a512-1295-4272-9138-f99709370657
2009-09-20Clarify the unit of note frequencyAlexander Levin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22760 a1c6a512-1295-4272-9138-f99709370657
2009-09-20Pitch Detector: group note related data togetherAlexander Levin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22758 a1c6a512-1295-4272-9138-f99709370657
2009-09-20Pitch Detector: use special functions for choosing bool valuesAlexander Levin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22755 a1c6a512-1295-4272-9138-f99709370657
2009-09-20Pitch Detector: add the possibility to set the reference frequency of A ↵Alexander Levin
(last part of FS#8768) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22753 a1c6a512-1295-4272-9138-f99709370657
2009-09-12UI improvements for the pitch detector (ongoing work by David Johnston from ↵Alexander Levin
FS#8768) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22685 a1c6a512-1295-4272-9138-f99709370657
2009-09-08New plugin: pitch detector (FS#8768) by Michael Lechner and David JohnstonAlexander Levin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22663 a1c6a512-1295-4272-9138-f99709370657