path: root/firmware/sound.c
AgeCommit message (Collapse)AuthorFilesLines
2021-04-09Revert "sound: add sound_numdecimals() to round out the sound setting ↵Aidan MacDonald1-5/+0
query API" There is already a sound_numdecimals() function, according to Git it's been around since 2005. No need to add another one :). This reverts commit 92a0ab8789c622afecc47f3b399eda8abf26ee9e. Change-Id: I533ebf1763dd7a27346842982493d4550f05ad7c
2021-04-07FS#13272: Fix up volume_limit to respect decimilaztion.Solomon Peachy1-2/+2
Change-Id: Ib0e5ddcd660115f156ddb545e45bbe7da42f9709
2021-03-22Add new audiohw capability: POWER_MODE_CAPAidan MacDonald1-0/+13
This allows the user to make use of the DAC's power-saving abilities. The two modes are "high performance" and "battery saver". This feature is supported by the AK4376 DAC in the upcoming FiiO M3K port. The setting is only a manual toggle right now, but in the future it could be hooked up to the battery level (via another setting) so it can be toggled automatically when the battery gets too low. Change-Id: I482af6e2f969fcbdeb3411bd3ff91f866b12d027
2021-03-14sound: add sound_numdecimals() to round out the sound setting query APISolomon Peachy1-0/+5
A necessary prerequisite for fixing FS#13272 Change-Id: Ice288af39a4f08bea376f920d855932bdac69a52
2020-07-24[1/4] Remove SH support and all archos targetsSolomon Peachy1-76/+0
This removes all code specific to SH targets Change-Id: I7980523785d2596e65c06430f4638eec74a06061
2019-07-25Fix Red -- sound_current #_2William Wilgus1-0/+7
Change-Id: Iae31a5fd414708b4a222ba0b05b5828a8e0d19af
2019-07-25Fix Red -- sound_currentWilliam Wilgus1-1/+11
Remove dependency on settings.g for bootloader ifdef out AUDIOHW_HAVE_EQ Settings these should be indexing the global_settings.hw_eq_bands[AUDIOHW_EQ_BAND_NUM] struct Change-Id: I1d1a8556ef88ce43397b600261696dacdf372034
2019-07-25Add sound_current to plugin apiWilliam Wilgus1-0/+89
Adds: sound_current(int setting) returns the current sound setting from global_settings complements sound_max, sound_min and sound_default Change-Id: I35bd893753c958f808492906fe533edc51d5d57c
2018-09-20Get rid of the last remnants of HAVE_FUNCTIONAL_MODESolomon Peachy1-10/+0
Change-Id: I4f9339019884aceedc8c9d0ab779a2e32ace0288 Signed-off-by: Solomon Peachy <>
2018-07-28Add cleaned-up xDuoo X3 supportSolomon Peachy1-0/+10
Cleaned up, rebased, and forward-ported from the xvortex fork. (original credit to Change-Id: Ibcc023a0271ea81e901450a88317708c2683236d Signed-off-by: Solomon Peachy <>
2013-05-24Add DAC's oversampling filter roll-off selection to sound settings.Andrew Ryabinin1-0/+10
Change-Id: I1258ba50dd9308f49d97965562f3a423c9bfb785
2013-04-22Do some cleanup, adjustment and a couple fixes to recent sound changes.Michael Sevakis1-45/+64
* SOUND_x enum can be generated by audiohw_settings.h along with settings entries and sound_val2phys. * VOLUME_MIN and VOLUME_MAX are no longer necessary within sound.c. If you need them, they are for target-defined purposes. * Fix up SDL volume implementation in sdl.c. Move sim volume calculation code to pcm-sdl.c. * Min trigger tresholds were based upon VOLUME_MIN for some reason. These setting have nothing to do with playback volume. Since it is no longer present, set these at -89dB which is the minimum peak meter sensitivity setting. * Fix an oversight in wm8758.c. I forgot to add the dB->register conversion to audiohw_set_volume. Change-Id: Ie1df33f1793eee75e6793f16bc7bddd16edb7f75
2013-04-15Forget about fixedpoint.c in any HWCODEC bin.Michael Sevakis1-3/+4
It bloats to much just for one simple use. Just use a simple function for shifting sound setting decimal places. Change-Id: I1a7d37cce6ada3c6e6600dc0d301f354ffeff231
2013-04-15Fix some more errors and warnings from 0c7b787.Michael Sevakis1-7/+7
Change-Id: Ib67d0ab344e36964cadbcc982dc2afe35733770b
2013-04-15Straighten out the mad twisted state of sound.c and related areas.Michael Sevakis1-363/+126
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
2013-04-11Fix f5a5b94 errors. Employ SW volume for select targets on SIM.Michael Sevakis1-2/+4
Onda VX747 sim was missing a limits #define; #include limits.h in pcm_sw_volume.h. Simply use the software volume control for the SIM volume control rather than the SDL volume control when the target would have it natively. Change-Id: I8e924a2ff1b410f602452d2ea9b691efb82c931e
2013-04-11Implement universal in-PCM-driver software volume control.Michael Sevakis1-7/+8
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: Reviewed-by: Michael Sevakis <> Tested-by: Michael Sevakis <>
2012-04-29Make rbcodec/dsp includes more specific.Michael Sevakis1-2/+0
Change-Id: Idb6af40df26f5b8499a40e8b98602261ef227044
2011-12-24Initial commit of the Samsung YP-R0 port.Thomas Martitz1-2/+3
This port is a hybrid native/RaaA port. It runs on a embedded linux system, but is the only application. It therefore can implement lots of stuff that native targets also implement, while leveraging the underlying linux kernel. The port is quite advanced. User interface, audio playback, plugins work mostly fine. Missing is e.g. power mangement and USB (see SamsungYPR0 wiki page). Included in utils/ypr0tools are scripts and programs required to generate a patched firmware. The patched firmware has the rootfs modified to load Rockbox. It includes a early/safe USB mode. This port needs a new toolchain, one that includes glibc headers and libraries. can generate it, but e.g. codesourcey and distro packages may also work. Most of the initial effort is done by Lorenzo Miori and others (on ABI), including reverse engineering and patching of the original firmware, initial drivers, and more. Big thanks to you. Flyspray: FS#12348 Author: Lorenzo Miori, myself Merry christmas to ypr0 owners! :) git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-11-16Sandisk Sansa Connect port (FS #12363)Tomasz Moń1-1/+1
Included are drivers for buttons, backlight, lcd, audio and storage. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-10-18imx233/fuze+: add volume handling to sound.cAmaury Pouly1-1/+1
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-09-06rk27xx - adjust core files for rk27xx internal codecMarcin Bukat1-1/+1
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-03-14fix redMarcin Bukat1-2/+2
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-03-14WM8750/51 driver:Marcin Bukat1-1/+2
1) Set prescaler correctly when 3d enhancement in use. 2) Implement sound_val2phys so gains in recording screen are correct. 3) Minor cleanups. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-03-14slightly modified FS#11531 by me: WM8750/51 driver reworkMarcin Bukat1-1/+1
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-02-27Remove some unnecessary includesDave Chapman1-11/+0
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-01-21WM8978: sound.c weirdness strikes again. Prescaler values have to be in ↵Michael Sevakis1-1/+5
centibels. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-01-07Fix CS42L55 (iPod Classic) tone controlMichael Sparmann1-2/+2
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-01-06Fix volume control on iPod ClassicMichael Sparmann1-2/+3
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-10-31fix yellowMarcin Bukat1-6/+0
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-10-31Separate mas35xx lowlevel stuff. Move SH specific bits to target tree. ↵Marcin Bukat1-64/+21
FS#11189 by me. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-08-11Mark some local variables with 'static'.Nils Wallménius1-8/+8
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-08-02Rockbox as an application: Commit current Android port progress.Thomas Martitz1-1/+1
General state is: Rockbox is usable (plays music, saves configuration, touchscreen works too). Problems: - Playing music in the background (i.e. when switching to another app) doesn't work reliably, but I'm working on that now. - no cabbiev2 (only some preliminary files for it), no other default theme. - screen flickers sometimes if the updates are too frequent - no multi screen apk/package - strange behavior when a phone call comes in The java files (and the eclipse project) resides in android/, which is also supposed to be the build folder. I've put a small README in there for instructions. There are some steps needed after the make part, which are described there, and which eclipse mostly handles. But there ought to be some script/makefile rules which do that instead in the future. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-06-21Rockbox as an application: Replace many occurences of #ifdef SIMULATOR with ↵Thomas Martitz1-6/+6
#if (CONFIG_PLATFORM & PLATFORM_HOSTED) (or equivalently). The simulator defines PLATFORM_HOSTED, as RaaA will do (RaaA will not define SIMULATOR). The new define is to (de-)select code to compile on hosted platforms generally. Should be no functional change to targets or the simulator. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-05-15- Move uisimulator/sdl/*.[ch] into the target tree, under ↵Thomas Martitz1-84/+1
firmware/target/hosted/sdl, uisdl.c is split up across button-sdl.c and system-sdl.c. - Refactor the program startup. main() is now in main.c like on target, and the implicit application thread will now act as our main thread (previously a separate one was created for this in thread initialization). This is part of Rockbox as an application and is the first step to make an application port from the uisimulator. In a further step the sim bits from the sdl build will be separated out. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-05-15Gigabeat S: Fully enable access to hardware tone controls and 3-D effect ↵Michael Sevakis1-13/+334
feature. Under the hood, it's designated a hardware equalizer since it is one. Implement code framework for hardware EQ in general. Menu aspect is well abstracted and so the UI and strings can be changed around if taste doesn't quite suit. So far the emphasis is distinction of the UI labelling from the software EQ so that it's clear the settings are for a different thing. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-05-11r25940 oops. No, no, no, that wasn't quite right. Must be truthful about the ↵Michael Sevakis1-2/+2
level in decidecibels for subsequent code. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-05-11MRobe100, HD200, Gigabeat F/X (anything with wm8750 or wm8751). Properly ↵Michael Sevakis1-4/+3
prescale bass and treble controls to avoid clipping. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-04-26Add MPIO HD200 port - changed filesMarcin Bukat1-5/+6
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-04-25Fix yellowsThomas Martitz1-1/+1
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-04-25Remove lots of simulator-speficic #ifdef'ing in sound.c to allow for DSP ↵Thomas Martitz1-128/+17
effects in the sims, e.g. for bass and treble (targets that do those effects in HW don't simulate using dsp). git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-04-13Fix minor mistake in tone control code: UDA1341 was added to the wrong part ↵Torne Wuff1-4/+7
of the conditional (it has hw bass/treble but not prescaling, like the other wm codecs listed) and TSC2100 has no hw tone controls at all so is already covered by HAVE_SW_TONE_CONTROLS. Comment has been clarified to make this less likely to happen again :) Net effect: tone controls should no longer adjust the overall perceived volume in a weird way on mini2440. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-01-03Fix further tabsAndree Buschmann1-1/+1
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-11-11Comstify a function pointer arrayNils Wallménius1-2/+2
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-11-03Improvements to mini2440 audio; change CPU freq to 406MHzBob Cousins1-2/+2
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-08-01 * Move DSP_CALLBACK_* enum to sound.hMaurus Cuelenaere1-10/+4
* Add software based volume control for a certain range (SW_VOLUME_MIN -> SW_VOLUME_MAX) * Make Onda VX747 use it * Don't change volume or frequency in Ingenic Jz4740 codec driver when they're already set git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-07-11Fix red in bootloadersAlexander Levin1-2/+0
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-07-11Improvements to the pitch screen UI (FS#10359 by David Johnston)Alexander Levin1-8/+11
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-06-28Create an udacodec interface (similar to ascodec and wmcoded) and ↵Bertrik Sikken1-1/+2
adapt/implement it for the iriver h1xx/h3xx and the meizus. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-05-26Fix audio on Onda VX747Maurus Cuelenaere1-0/+2
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657