path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2018-06-12Agptek Rocker: Initial commitMarcin Bukat1-1/+2
Change-Id: I26b51106c7b1c36a603fba6d521e917d79b5a95b
2017-12-07Remove explicit 'enum codec_command_action' in codec APIMichael Sevakis45-49/+53
Just use long so the compiler potentially doesn't complain about use of other values not in the enum. It's also the type used around the system for event ids. Increase min codec API version. No functional changes. Change-Id: If4419b42912f5e4ef673adcdeb69313e503f94cc
2017-11-21Undo hacks to meant to get around string formatting limitationsMichael Sevakis3-3/+31
The new vuprintf makes unnecessary workarounds due to formatting limitations. I checked grep output for whatever appeared to fit but it's possible I missed some instances because they weren't so obvious. Also, this means sound settings can dynamically work with any number of decimals rather than the current assumption of one or two. Add an ipow() function to help and take advantage of dynamic field width and precision. Consolidate string formatting of sound settings. Change-Id: I46caf534859dfd1916cd440cd25e5206b192fcd8
2017-11-06libpcm: Get unbranded structure tag out of my way.Michael Sevakis16-36/+36
No functional changes. Change-Id: If372023cb605389a203a635b700eca20685ad49b
2017-10-29Revert "tlsf: pack info structs"Franklin Wei1-2/+2
This reverts commit 8a6d7cefc9bf45b979ff064d87141949e9b81ca4. Packing the structs was mostly a precautionary measure, tlsf should still work without it.
2017-10-29tlsf: remove memset() call in add_new_area()Franklin Wei1-1/+3
This call was not needed in the first place, but was causing crashes in sgt-puzzles. Removing it fixes the crashes. Change-Id: I1149d5600e1c97e0e848fdd34bf65d54c930adab
2017-10-29tlsf: pack info structsFranklin Wei1-2/+2
This should make it build cleanly under -Wcast-align, which should hopefully avoid any alignment issues on ARM. Change-Id: Ie147323d2d8cb980dcbb94710387b7ee80826c4d
2017-10-12PBE+Surround: Localize some variables and fixup some flush opsMichael Sevakis2-73/+55
Change-Id: I9fba5b8cbf69d261a7ca1c66e080c08d2fc6d9db
2017-10-12Nitpick configuration code in a few DSP filters to fix some bugsMichael Sevakis3-84/+125
Most importantly is surround shouldn't operate in mono mode. Have it watch and (de)activate itself on relevant format changes as it should. Other changes to better handle buffer allocation failure. PBE was set internally at 100 by default; SBZ. Change-Id: I328e0b674e56751a255eae817d7892d685796b06
2017-10-01Need limits.h for hosted buildsMichael Sevakis1-0/+1
Change-Id: Iac1433957de80ad5db51396f74acf1f4f8d45bf3
2017-10-01Replace fp_sqrt function with one that only uses shift, or and sub.Michael Sevakis2-51/+51
Simply extends the current isqrt() to be able to do fractional bits and improves the initial estimate using clz(). iqrt() itself is no more and is equivalent to fp_sqrt(x, 0). The original also had a small bug where the guess comparision should have been >=, not >. Uses no large integer math or division and is very accurate (simply returns a truncated fraction). Change-Id: I2ae26e6505df1770dc01e56220f7385369f90ae9
2017-09-17fix warning in vorbisAmaury Pouly1-1/+4
Change-Id: I01dd320ac7f4641caaef62363556ca7527dbee19
2017-09-07ARM support: provide compiler a better popcount functionMichael Sevakis1-0/+31
Just the 32-bit one for now. The default uses lookup tables and is ungainly and bloated. Change-Id: I4a2eb31defb1f4d6f6853b65fe6dacc380d6ffc0
2017-09-05Initial commit for the Sony NWZ linux portAmaury Pouly4-3/+4
SUPPORTED SERIES: - NWZ-E450 - NWZ-E460 - NWZ-E470 - NWZ-E580 - NWZ-A10 NOTES: - bootloader makefile convert an extra font to be installed alongside the bootloader since sysfont is way too small - the toolsicon bitmap comes from the Oxygen iconset - touchscreen driver is untested TODO: - implement audio routing driver (pcm is handled by pcm-alsa) - fix playback: it crashes on illegal instruction in DEBUG builds - find out why the browser starts at / instead of /contents - implement radio support - implement return to OF for usb handling - calibrate battery curve (NB: of can report a battery level on a 0-5 scale but probabl don't want to use that ?) - implement simulator build (we need a nice image of the player) - figure out if we can detect jack removal POTENTIAL TODOS: - try to build a usb serial gadget and gdbserver Change-Id: Ic77d71e0651355d47cc4e423a40fb64a60c69a80
2017-07-30rbcodec: remove useless includeAmaury Pouly1-1/+0
metadata.c does not need cuesheet.h, which in apps/ and has nothing to do with rbcodec library. Change-Id: I914a49e8c182f5c367d7db3479c2ff39565e5f07
2017-07-30rbcodec: fix compilation in debug modeAmaury Pouly3-3/+3
Change-Id: I124cf59c641c2e161cc147b031d9bef5ef773dfb
2017-02-04Fix dangerous castsAmaury Pouly4-10/+11
On Windows 64-bit, the size of long is 32-bit, thus any pointer to long cast is not valid. In any case, one should use intptr_t and ptrdiff_t when casting to integers. This commit attempts to fix all instances reported by GCC. When relevant, I replaced code by the macros PTR_ADD, ALIGN_UP from system.h Change-Id: I2273b0e8465d3c4689824717ed5afa5ed238a2dc
2017-01-15Fix codecs in simulator builds on WindowsAmaury Pouly3-2/+5
The mingw linker uses strlen() in some cases, and codeclib.c redefines it, that leads to mingw runtime init to call into our strlen() and then ci->strlen() which of course crashes. Apply the same fix as for malloc and friends: rename the symbol. The codeclib.h include is necessary for normal builds. Change-Id: Ifa85901a3e4a31cc0e10b4b905df348a239d5c99
2016-12-12unwinder: in get__sp(), use the more correct "msr cpsr_c, ..." formAmaury Pouly1-3/+3
Change-Id: I9cfdca80536fc9fb6e8983a81219ccdf5c0b3c42
2016-12-03Fix DEBUG build codecsAmaury Pouly1-1/+0
In DEBUG build, the codec API struct is consider with DEBUG flag in apps/ but without DEBUG flah in rbcodecs/, leading to unmatched structure and horrible crashes in some cases (mostly encoders). I have no idea why the codecs Makefile removes the DEBUG flag (maybe for performance reasons?) but it cannot be right. Change-Id: Idb2c5f66741408ec2939624590fc39c4cf69fc2b
2016-09-07Opus: update resume offset correctly while playing.Adam Sampson1-0/+1
The codec wasn't calling ci->set_offset() while decoding; as a result, the saved offset in ci.id3->offset was only updated at the start of the file and when seeking. To reproduce the problem in the simulator or on a real device: - Start playing an Opus file. - Let it play until 15s, then turn the player off. - Turn back on and resume playback. This'll resume correctly from 15s (using time-based resume, I think, as the offset was 0?). - Let it play until 30s, then turn the player off again. - Turn back on and resume playback. This'll resume from 15s, based on the initial position from last time, when it should resume from 30s. I believe this will also fix FS#12799 ("Resuming opus file from bookmark is not working correctly"). Change-Id: Iba67368e0029c968ef802693767e0722719bc38b
2016-05-28Fix race conditions in parallel build.Frank Gevaerts2-2/+0
ffmpeg_bitstream.c is included in libcodec, so there doesn't seem to be any reason for individual codecs to also compile it (and clobber any previous copy while they're at it, leading to broken builds) Change-Id: I2bedc277ab109f44a6e8feb3d12ed01a720e00a6
2016-03-18_BSD_SOURCE is deprecated, and we're supposed to use _DEFAULT_SOURCE now.Frank Gevaerts1-1/+1
Change-Id: Ia051bc758c8fe4002e222511fdc6be613cdd39e7
2015-07-17mp3_enc.c: fix MP3 recording at 32 kHz sample rateCástor Muñoz1-2/+2
Fixes a buffer overflow present when MP3 is encoded at 32000 Hz sample rate, affected bitrates are 320 and 256 kbps. Change-Id: I7634e70409be9d675d47be316a42630dd3147636
2015-02-02iBasso DX50/DX90: Major code cleanup and reorganization.Udo Schläpfer1-5/+5
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 - 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 Includes - - - Does not include 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 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
2015-01-30fix surround & pbe dsp crashChiwen Chang2-2/+4
check handle before clean up buffer in flush(). Change-Id: I36a130c45c9f5dce97aa723ef98922b6935ead75
2015-01-22fix pbe/haas surround dsps: surround_enabled, redo flush functions.Chiwen Chang2-26/+11
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
2015-01-19Enable buflib and core_alloc for warble.Frank Gevaerts4-0/+25
Most of the work comes from by Thomas Jarosch. Change-Id: Iaa673dad2388d1e44fc95ffaa14bafadc6158101
2015-01-19three new DSPsChiwen Chang11-5/+852
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
2015-01-12ARM unwinder for thumb: Fix broken MOV opcodeThomas Jarosch1-2/+2
The origin of the register value was never moved in the desired register state due to a typo ('rhs' vs. 'rhd'). While looking at the code, I noticed the action taken for the register value is another copy'n'paste error from the ADD opcode above -> it added to the register value instead of MOVing the current value. Patch submitted upstream. cppcheck reported: [lib/unwarminder/unwarm_thumb.c:473]: (warning) Redundant assignment of 'state.regData[rhd].o' to itself. Change-Id: I78cdbf37a191007a3bddbaa350b906dbce2fe671
2015-01-12Fix redThomas Jarosch1-1/+1
Change-Id: Ia7565dac0f6b9703a5dfff723167620deb218bc3
2015-01-12ARM unwinder for thumb: Fix broken SUB opcodeThomas Jarosch1-1/+1
Detected while looking through the code. Patch submitted upstream. Change-Id: I7ebe7b5f5947cf3df1b054d545dba92829f21b99
2015-01-12ARM unwinder: Add missing 'register' variable in debug outputThomas Jarosch1-2/+2
Also fix a wrong format specifier for an unsigned variable. Detected by cppcheck, patch submitted upstream. Change-Id: I9b84d91eeb242ed77b53ecc16252c5b35190bb9f
2015-01-12ARM unwinder: Add missing va_end() call.Thomas Jarosch1-0/+1
Detected by cppcheck, patch submitted upstream. Change-Id: Ieeec9d2e7e2c22d64c94936958f5a4ff02d3548b
2015-01-11Limit more variables to file scopeThomas Jarosch12-59/+52
Change-Id: I30219d626316776eb73b4205d63376fa3dbc6361
2015-01-08Clarify usb_powered() and fix some code.Amaury Pouly2-2/+2
Either by mistake or because its meaning changed, usb_powered() doesn't mean what the name suggest, so clarify its meaning by renaming it to usb_powered_only. So use of usb_powered() are replaced by usb_inserted() when it makes more sense. Change-Id: I112887e2d8560e84587bee5f55c826dde8c806d8 Reviewed-on: Reviewed-by: Amaury Pouly <>
2015-01-05Fix yellowThomas Jarosch4-40/+41
Change-Id: I8685198c208b5324b09b5ad59f7379502e9ed977
2015-01-05Make thirty functions static to reduce binary sizeThomas Jarosch4-10/+10
If any of those functions should be (unused) API functions, they can easily be turned back once really needed. Detected using a new cppcheck check that uses the internal symbol database to catch functions that are only used in the current file. Change-Id: Ic2b1e5b8020b76397f11cefc4e205f3b7ac1f184
2014-12-27More standard conforming codec_realloc()Thomas Jarosch1-2/+6
- Leave original ptr untouched if allocation fails (bail out early) - Behave like malloc() in case ptr is NULL Change-Id: Ib854ca19bd0e069999b7780d2d9a533ece705add
2014-12-17Add newlines at the end of the fileThomas Jarosch2-2/+2
Quiet maemo's gcc 4.2.1 compiler warning. Change-Id: I35dfb2c0cb269b05edd62adf71fe0308a4b9ba5b
2014-11-28Fix warning in WMA Pro and remove a c++ comment.Michael Giacomelli2-4/+3
Change-Id: Id9b50c1fdeca4d87f158da717de8958330f027ef
2014-11-28Fix FS#13009.Michael Giacomelli3-13/+33
This file revealed several problems with our ASF parser: 1) The packet count in the ASF was actually a 64 bit value, leading to overflow in very long files. 2) Seeking blindly trusted the bitrate listed in the ASF header rather than computing it from the packet size and number of packets. Fix these problems and fix a few minor issues. Change-Id: Ie0f68734e6423e837757528ddb155f3bdcc979f3
2014-09-22fix yellowMarcin Bukat1-1/+1
Change-Id: Ie3aa9b208e3f4f17d4d02f11f69839e9b381217d
2014-09-22metadata: Add cuesheet embedded in ape tags.nialv71-13/+23
Change-Id: I5d9e731c3ea786fb910afbb0a5201fc68dcab9f9 Reviewed-on: Reviewed-by: Nick Peskett <> Tested: Nick Peskett <> Reviewed-by: Marcin Bukat <>
2014-08-30Fix last warning for WarbleMichael Sevakis1-0/+2
Unused result warnings will have to be dealt with separately. Change-Id: I00c45e28d4d43a5376745036e650ff8df576c2db
2014-08-30Get the last errors I hope!Michael Sevakis4-9/+12
Change-Id: Ia285b95480cc9ac6494b745d80892c4b1b912341
2014-08-25Remove unused return value variable in lib/unwarminder/backtrace.cMichael Sevakis1-3/+1
Stop the Android warning about it Change-Id: I2f01220004f128befaa5757786b8de174566cbb5
2014-08-16Fix warnings from 6ed0087Michael Sevakis1-2/+2
Forgot to (void) an unused parameter when priorityless. usb-drv-rl27xx.c was using a compound init to initialize a semaphore but the structure changed so that it is no longer correct. Use designated initializers to avoid having to complete all fields. Forgot to break compatibility on all plugins and codecs since the kernel objects are now different. Take care of that too and do the sort thing. Change-Id: Ie2ab8da152d40be0c69dc573ced8d697d94b0674
2014-07-21add supports for x,y value in percentage to several tags.Chiwen Chang1-7/+6
including BAR_PARAMS, %xl, %dr, %T,%St, %xl and %Cl Change-Id: I0811ebfff5f83085481dcbf08f97b7223f677bfe Reviewed-on: Reviewed-by: Jonathan Gordon <>
2014-07-13libopus: use iram for more constantsNils Wallménius2-5/+5
Speeds up decoding of the 64 kbps test file by 2.59 MHz and the 128 kbps test file by 4.31 MHz on H300 (cf). Decoding the same files on c200 is sped up by 0.33 MHz and 0.55 MHz respectively. Change-Id: I0f9f9ef6a7293581cf45e3201b33c65504c95c81