Commit graph

327 commits

Author SHA1 Message Date
Michael Sevakis
6c868dd48f Remove explicit 'enum codec_command_action' in codec API
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-12-07 14:41:59 -05:00
Michael Sevakis
aced667f48 Undo hacks to meant to get around string formatting limitations
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-21 05:01:14 -05:00
Michael Sevakis
826f99e187 libpcm: Get unbranded structure tag out of my way.
No functional changes.

Change-Id: If372023cb605389a203a635b700eca20685ad49b
2017-11-06 20:06:08 -05:00
Franklin Wei
2423d3d4ae Revert "tlsf: pack info structs"
This reverts commit 8a6d7cefc9.

Packing the structs was mostly a precautionary measure, tlsf should
still work without it.
2017-10-29 16:51:33 -04:00
Franklin Wei
60e5cd7276 tlsf: remove memset() call in add_new_area()
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-29 12:49:39 -04:00
Franklin Wei
8a6d7cefc9 tlsf: pack info structs
This should make it build cleanly under -Wcast-align, which should
hopefully avoid any alignment issues on ARM.

Change-Id: Ie147323d2d8cb980dcbb94710387b7ee80826c4d
2017-10-29 12:49:39 -04:00
Michael Sevakis
a8e4b3a190 PBE+Surround: Localize some variables and fixup some flush ops
Change-Id: I9fba5b8cbf69d261a7ca1c66e080c08d2fc6d9db
2017-10-12 05:59:18 -04:00
Michael Sevakis
5eee28e37d Nitpick configuration code in a few DSP filters to fix some bugs
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-12 04:44:55 -04:00
Michael Sevakis
66b49dc0b2 Need limits.h for hosted builds
Change-Id: Iac1433957de80ad5db51396f74acf1f4f8d45bf3
2017-10-01 23:27:41 -04:00
Michael Sevakis
b2a373eb64 Replace fp_sqrt function with one that only uses shift, or and sub.
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-10-01 20:29:38 -04:00
Amaury Pouly
3b7263be2d fix warning in vorbis
Change-Id: I01dd320ac7f4641caaef62363556ca7527dbee19
2017-09-17 15:09:39 +02:00
Michael Sevakis
c6d5cd74a8 ARM support: provide compiler a better popcount function
Just the 32-bit one for now. The default uses lookup tables and is
ungainly and bloated.

Change-Id: I4a2eb31defb1f4d6f6853b65fe6dacc380d6ffc0
2017-09-07 15:45:55 -04:00
Amaury Pouly
1d121e8c08 Initial commit for the Sony NWZ linux port
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-09-05 21:42:12 +02:00
Amaury Pouly
ce39850e6b rbcodec: remove useless include
metadata.c does not need cuesheet.h, which in apps/ and has nothing to do with
rbcodec library.

Change-Id: I914a49e8c182f5c367d7db3479c2ff39565e5f07
2017-07-30 14:32:12 +02:00
Amaury Pouly
928d660a67 rbcodec: fix compilation in debug mode
Change-Id: I124cf59c641c2e161cc147b031d9bef5ef773dfb
2017-07-30 14:32:12 +02:00
Amaury Pouly
d7871914ac Fix dangerous casts
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-02-04 17:24:47 +01:00
Amaury Pouly
16d1788356 Fix codecs in simulator builds on Windows
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
2017-01-15 21:46:19 +01:00
Amaury Pouly
7e0820fe21 unwinder: in get__sp(), use the more correct "msr cpsr_c, ..." form
Change-Id: I9cfdca80536fc9fb6e8983a81219ccdf5c0b3c42
2016-12-12 13:15:47 +01:00
Amaury Pouly
bbf4ff2c91 Fix DEBUG build codecs
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-12-03 23:07:32 +01:00
Adam Sampson
1f8ea9fe27 Opus: update resume offset correctly while playing.
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-09-07 19:44:37 +02:00
Frank Gevaerts
c926a5269e Fix race conditions in parallel build.
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-05-28 17:41:32 +02:00
Frank Gevaerts
123346b86a _BSD_SOURCE is deprecated, and we're supposed to use _DEFAULT_SOURCE now.
Change-Id: Ia051bc758c8fe4002e222511fdc6be613cdd39e7
2016-03-18 21:27:15 +01:00
Cástor Muñoz
d68ecccd88 mp3_enc.c: fix MP3 recording at 32 kHz sample rate
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-07-17 01:03:38 +02:00
Udo Schläpfer
dbabd0d9c3 iBasso DX50/DX90: Major code cleanup and reorganization.
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
2015-02-02 21:57:55 +01:00
Chiwen Chang
572b36a51a fix surround & pbe dsp crash
check handle before clean up buffer in flush().

Change-Id: I36a130c45c9f5dce97aa723ef98922b6935ead75
2015-01-30 20:06:00 +01:00
Chiwen Chang
30784cc262 fix pbe/haas surround dsps: surround_enabled, redo flush functions.
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-22 13:28:34 +11:00
Frank Gevaerts
163ca14e58 Enable buflib and core_alloc for warble.
Most of the work comes from http://gerrit.rockbox.org/r/#/c/1088/
by Thomas Jarosch.

Change-Id: Iaa673dad2388d1e44fc95ffaa14bafadc6158101
2015-01-19 21:30:03 +01:00
Chiwen Chang
3ae0f32ac3 three new DSPs
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-19 19:34:01 +01:00
Thomas Jarosch
789df17dd9 ARM unwinder for thumb: Fix broken MOV opcode
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-12 19:36:58 +01:00
Thomas Jarosch
799024198f Fix red
Change-Id: Ia7565dac0f6b9703a5dfff723167620deb218bc3
2015-01-12 19:31:39 +01:00
Thomas Jarosch
7361a433d0 ARM unwinder for thumb: Fix broken SUB opcode
Detected while looking through the code.
Patch submitted upstream.

Change-Id: I7ebe7b5f5947cf3df1b054d545dba92829f21b99
2015-01-12 19:26:23 +01:00
Thomas Jarosch
fa592cc725 ARM unwinder: Add missing 'register' variable in debug output
Also fix a wrong format specifier for an unsigned variable.
Detected by cppcheck, patch submitted upstream.

Change-Id: I9b84d91eeb242ed77b53ecc16252c5b35190bb9f
2015-01-12 19:15:08 +01:00
Thomas Jarosch
1589b28afc ARM unwinder: Add missing va_end() call.
Detected by cppcheck, patch submitted upstream.

Change-Id: Ieeec9d2e7e2c22d64c94936958f5a4ff02d3548b
2015-01-12 19:10:24 +01:00
Thomas Jarosch
2a3e1628a5 Limit more variables to file scope
Change-Id: I30219d626316776eb73b4205d63376fa3dbc6361
2015-01-11 21:40:51 +01:00
Amaury Pouly
dc127f213c Clarify usb_powered() and fix some code.
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: http://gerrit.rockbox.org/1097
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2015-01-08 16:45:32 +01:00
Thomas Jarosch
f91434cc7b Fix yellow
Change-Id: I8685198c208b5324b09b5ad59f7379502e9ed977
2015-01-05 19:09:33 +01:00
Thomas Jarosch
fdd4aef340 Make thirty functions static to reduce binary size
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
2015-01-05 18:44:36 +01:00
Thomas Jarosch
e7c282fed7 More standard conforming codec_realloc()
- Leave original ptr untouched if allocation fails
  (bail out early)
- Behave like malloc() in case ptr is NULL

Change-Id: Ib854ca19bd0e069999b7780d2d9a533ece705add
2014-12-27 17:33:24 +01:00
Thomas Jarosch
55a5aab97c Add newlines at the end of the file
Quiet maemo's gcc 4.2.1 compiler warning.

Change-Id: I35dfb2c0cb269b05edd62adf71fe0308a4b9ba5b
2014-12-17 23:34:48 +01:00
Michael Giacomelli
d924c83066 Fix warning in WMA Pro and remove a c++ comment.
Change-Id: Id9b50c1fdeca4d87f158da717de8958330f027ef
2014-11-28 23:04:50 +01:00
Michael Giacomelli
aa2c55e105 Fix FS#13009.
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-11-28 22:30:05 +01:00
Marcin Bukat
da417ab93d fix yellow
Change-Id: Ie3aa9b208e3f4f17d4d02f11f69839e9b381217d
2014-09-22 10:55:11 +02:00
nialv7
d392da8002 metadata: Add cuesheet embedded in ape tags.
Change-Id: I5d9e731c3ea786fb910afbb0a5201fc68dcab9f9
Reviewed-on: http://gerrit.rockbox.org/965
Reviewed-by: Nick Peskett <rockbox@peskett.co.uk>
Tested: Nick Peskett <rockbox@peskett.co.uk>
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2014-09-22 10:20:39 +02:00
Michael Sevakis
5d31d3c3bc Fix last warning for Warble
Unused result warnings will have to be dealt with separately.

Change-Id: I00c45e28d4d43a5376745036e650ff8df576c2db
2014-08-30 01:50:22 -04:00
Michael Sevakis
da4938d6ee Get the last errors I hope!
Change-Id: Ia285b95480cc9ac6494b745d80892c4b1b912341
2014-08-30 01:29:18 -04:00
Michael Sevakis
bfbec3a3a7 Remove unused return value variable in lib/unwarminder/backtrace.c
Stop the Android warning about it

Change-Id: I2f01220004f128befaa5757786b8de174566cbb5
2014-08-25 14:07:19 -04:00
Michael Sevakis
528715a672 Fix warnings from 6ed0087
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-08-16 06:00:36 -04:00
Chiwen Chang
9fb65294fb add supports for x,y value in percentage to several tags.
including
BAR_PARAMS, %xl, %dr, %T,%St, %xl and %Cl

Change-Id: I0811ebfff5f83085481dcbf08f97b7223f677bfe
Reviewed-on: http://gerrit.rockbox.org/900
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2014-07-21 04:54:53 +02:00
Nils Wallménius
8e8671a73e libopus: use iram for more constants
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
2014-07-13 14:19:54 +02:00
Nils Wallménius
888e05ec12 libopus: asm C_MUL for coldfire
The recent merge of upstream changed the fft to use C_MUL which
wasn't implemented in asm for coldfire.

Speeds up decoding 64 kbps test file by 2.68 MHz and 128 kbps
test file by 2.80 MHz on H300.

Change-Id: I8b61fc0f9568d6350431e311a12e44fe4f60f72e
2014-07-13 11:49:34 +02:00