1
0
Fork 0
forked from len0rd/rockbox
Commit graph

226 commits

Author SHA1 Message Date
Christian Soffke
727c800c0d Don't force gcc as host compiler + fix clang warnings
On MacOS, gcc is a symlink for clang.

Patch gets rid of the warnings produced by clang,
when it is set as HOSTCC, and fixes voicetools
compilation on MacOS when calling make voicetools
from the simulator directory.

lua rb_defines_helper:
format specifies type 'int' but the argument has
type 'long'

codecs: opus / speex (LOGF):
format '%ld' expects argument of type 'long int',
but argument 7 has type 'off_t'

gigabeat:
variable 'size' set but not used

rdf2binary:
a function declaration without a prototype is
deprecated in all versions of C

rbspeexdec:
passing 'unsigned char *' to parameter of type
'char *' converts between pointers to integer
types where one is of the unique plain 'char'
type and the other is not

hmac-sha1.c
defining a type within 'offsetof' is a Clang
extension

Change-Id: I90539906698868f9589650585d865aee9f7e8539
2024-12-20 05:29:18 +01:00
Christian Soffke
a86b1999d0 simulator: fix missing Werror option + eliminate lib duplicate
configure:
Ensure Werror option doesn't get lost when simcc resets GCCOPTS

uisimulator.make:
Remove ignored duplicate SIMLIB on Darwin

codecs.make:
Eliminate some redundancy

Change-Id: Ieee6f677fd22666cb58aa6fe53eabdc0b0f8c190
2024-12-19 15:04:46 -05:00
Vencislav Atanasov
1468649258 Convert non-ASCII characters to UTF-8 or C-string literals
Comments are converted to UTF-8.

Strings which are part of executable code are converted using C-string hex literals. A comment with the intended UTF-8 character is appended to such lines.

The "c"-looking character in mpa.c was actually a small cyrillic "s" (i.e. "с").

Change-Id: If3a889080ef60b8bf756ad9ada38baede93ce35b
2024-12-15 21:16:12 -05:00
Vencislav Atanasov
5d7c8a0df1 Convert non-ASCII characters to UTF-8
Comments and notes are converted to UTF-8. Already broken multibyte characters are fixed using common sense.

This patch contains no code changes.

Change-Id: Ia511ab84936cb2495ac17309493a9b98727a7902
2024-12-15 21:16:12 -05:00
William Wilgus
f233b6e2f2 'libmad remove warnings
calculating inside a function makes it work
adding FORCE_INLINE makes warning reappear
anything else in bounds of the array asounds ok but has digital
distortion so pretty confident the code is right

Change-Id: Ibb2babe20b1d8a980f3e3fd19b4cddaaff9213a6
2024-12-14 01:21:56 -05:00
William Wilgus
e9b14b3986 libmad synth.c silence warnings try #3
https://godbolt.org/z/3bM7fxPP3 shows some of the disasm around the troble area for compiling

Change-Id: I7b2897ae20dad1b11af39439a4d1856267b1222b
2024-12-10 11:16:40 -05:00
Solomon Peachy
95681c3959 Revert "libmad synth.c silence warnings try #2"
This reverts commit 5650007399.

Reason for revert:  Results in warnings on *all* device builds.

Change-Id: I635be6791c3ea9c7d7e89f9cf5dd2e4e4e042a80
2024-12-10 08:59:00 -05:00
William Wilgus
5650007399 libmad synth.c silence warnings try #2
https://godbolt.org/z/3bM7fxPP3 shows some of the disasm around the troble area for compiling

Change-Id: I135af6df5569fb4b6d18d79f7893b5c27f6f83ea
2024-12-10 02:17:55 -05:00
Solomon Peachy
e3323e3ba7 Revert "libmad synth.c silence warnings"
This reverts commit b14056e90f.

Reason for revert: Not mathematically equivalent, inconsistent with other code paths, and leads to audio artifacts on ARM targets.

Change-Id: I71646e6e8df2aa2c57decdb5360daff870670c87
2024-12-08 19:14:01 -05:00
William Wilgus
b14056e90f libmad synth.c silence warnings
synth.c is using a negative offset which gcc doesn't like

equlivalent code just uses pointer math instead

Change-Id: Ia1282c5608409cdff05cd4b90c4d4b695174482a
2024-12-08 00:06:59 -05:00
Christian Soffke
87452d775e fix warnings on some systems / format specifier mismatch
Instead of %ld or %lx, use %jd or %jx
for off_t (after casting to intmax_t)

Change-Id: I4cd1831816820d2862b383ff8782e548b2fca294
2024-12-07 11:07:44 -05:00
Christian Soffke
1745b74576 Make simulator compile on MacOS
Tested on MacOS Sequoia (Apple Silicon) with the
latest Xcode command line tools, gcc 14
(Homebrew GCC 14.2.0_1) and sdl2 (Homebrew 2.30.9)

Make sure 'gcc' (and 'gcc-ar') is in your PATH
ahead of the Xcode-provided "gcc"(clang). E.g.
by setting up symlinks in /usr/local/bin that
point to gcc-14 and gcc-ar-14.

Notes:
- The appropriate bmp from uisimulator/bitmaps
  has to be manually copied to your build folder
  and renamed to UI256.bmp, if you want the sim
  background to be displayed

Change-Id: I559f33d2165065f913f30c016b85906af380fb81
2024-11-30 22:19:02 -05:00
William Wilgus
1fddea5e8e Revert "[BugFix] Enums are only 2 bytes on some Devices"
This reverts commit 4ec34f6986.

Reason for revert:
 -fshort-enums makes them smaller if the explicitrly enumerated values will fit in a smaller type

Change-Id: I834dfd2b2039eda91bc02c9cf95a0f9dfc5783f6
2024-11-24 11:38:16 -05:00
William Wilgus
4ec34f6986 [BugFix] Enums are only 2 bytes on some Devices
using enums to hold values larger than 0xFFFF could be problematic

WIP

Change-Id: I3a9be957265364b545f022fe26163f0869569e3e
2024-11-24 10:23:53 -05:00
Solomon Peachy
bdf1690cb2 build: Allow LTO to work globally, not just codecs/plugins
IMPORTANT: There is no guarantee this will compile cleanly much less
_work_ on any given target.  This is purely to enable future hackery.

Change-Id: Ib58f21b717719fd4325622b446a60779406ae035
2024-11-24 08:23:38 -05:00
Vencislav Atanasov
f040c4c9ec Rename CPU_S5L870X to CPU_S5L87XX
This is a preparation to introduce support for the following SoC models: S5L8720 (iPod Nano 4G, iPod Touch 2G), S5L8730 (iPod Nano 5G), S5L8723 (iPod Nano 6G) and S5L8740 (iPod Nano 7G)

The whole family consists of SoCs which are similar, running ARMv6 and Thumb2 instructions, but some peripherals are located at a different address.

No functional change is to be expected so far.

Change-Id: If1f7669c49cf110ccc52c5234cc42ffd6f2b4e80
2024-11-20 10:58:32 -05:00
Vencislav Atanasov
5c6d463cc3 Simplify libgme define
Change-Id: I3e66f57b3640246bde9fc1c5d75b094553f8598c
2024-11-20 12:31:09 +02:00
Solomon Peachy
2f109a7c2a flac: 7th channel decode buffer may not fit into IRAM.
(Fixes failure to compile on nano2g)

Change-Id: Ibe40a18ee74a3ac3ca2ec9dfac478d1fda5d34ee
2024-10-14 13:43:54 -04:00
Solomon Peachy
29f28ad8e6 flac: Implement proper support for 7 channel FLACs
* Allocate buffer for additional channel
 * Proper downmixing

Change-Id: I4190358a93bb328585952affcd42db05b05c19a5
2024-10-14 12:28:07 -04:00
Solomon Peachy
3aef933348 flac: Bump maximum channel count to 7 (FS#13306)
This is actually the root fix for the crash; the fix in
772eff8ca6 didn't restrict it to 2 channels, just sanity
checked the file vs MAX_CHANNELS.

Change-Id: If5a0a9b946a179ad47d6e7955f7c025de3aaaa0e
2024-10-14 11:05:28 -04:00
Solomon Peachy
772eff8ca6 flac: Explicitly reject FLAC files with more than two channels (FS#13306)
It's not clear that we've ever intended to support >2ch files, based on
'#define MAX_CHANNELS 2' and other logic that only seems to care about
mono vs not.

Change-Id: I15e92fb29cceef32e63fc3a821f6e96bbde930b6
2024-10-14 09:00:26 -04:00
Solomon Peachy
d4d74fda00 codecs: abs() --> llabs() in speex and libgme
We were calling abs() on 64-bit (ie long long) variables.

Change-Id: I8326910a4ce733e9e2251aa5f9047e336c8be6df
2024-10-12 12:01:36 -04:00
Roman Artiukhin
ef6da7503a Codecs: mp4: Support object type 29 (AAC LC + SBR + PS).
Backport libfaad commit d35cf8f24d

Change-Id: I0d637d2be36f5e4bb10d7d09adc442b470e81bf7
2024-09-25 14:01:57 +03:00
Solomon Peachy
c3f51b5fe9 opus: Re-add a ICONST_ATTR lost in 4c6bb798d6bebc80f07e863236adbaf8d156a9c
Change-Id: If1395d5b1d71c1bc0bb9104ff26d2addbfd1040f
2024-09-24 10:27:17 -04:00
Wolfram Sang
22b05c97a3 codec: cRSID: check whole load address
Due to a typo, only the high byte of the embedded load address was
checked to be empty. For a full check, high and low byte must be
evaluated, of course. Also, fixed in cRSID 1.3.

Change-Id: Ib0b701622b006ab4bb1791f07bf17b3b06a70719
2024-09-05 16:16:18 +02:00
Solomon Peachy
43dfa7d084 opus: Re-add IRAM hints to some constant tables
Was accidently disabled in 14c6bb798d
(in January 2019)

See 8e8671a73e for the benchmarks.

Change-Id: I3d558f8cfc041a14d0a1e55da3b042c7d01089e8
2024-07-10 09:23:33 -04:00
Solomon Peachy
67b5fa06d5 opus: Re-enable Coldfire ASM optimizations
Was accidently disabled in 14c6bb798d
(in January 2019)

(Had to make a minor change due argument differences)

Change-Id: If7c128cdeaa9ed82b2b33de1b75ca7cc4a95abdd
2024-07-10 09:23:33 -04:00
Solomon Peachy
eb8f6e578e libspeex: Fix up two build regressions in 547b6a570
Broke rbspeex build if we weren't using system libspeex
2024-06-21 16:38:45 -04:00
Solomon Peachy
547b6a570d codecs: Update libspeex from 1.2beta3 to 1.2rc1
This is a relatively minor bump, but it's the first step towards
bringing this current.

Change-Id: Iab6c9b0c77f0ba705280434ea74b513364719499
2024-06-20 07:08:35 -04:00
Solomon Peachy
6f4d0b7eb1 m4a: Fix a warning under GCC 8.
...Not sure why this just cropped up now.

Change-Id: I2318ee929fb5fddbf033680d92f21bba73631db6
2024-06-19 09:22:44 -04:00
Roman Artiukhin
e80cf93b67 Codecs: debugging: Disable compiler optimizations when DEBUG is defined
Change-Id: I6a65a2f650c4c7e0cde6165e8f46df1f3a5fd855
2024-06-18 20:43:35 -04:00
Solomon Peachy
73f40d8a23 build: Experimental LTO support, phase one
* Only codecs and plugins are enabled
 * Only native builds (so far)
 * Only tested on xDuoo X3 (MIPS, monochrome)
 * opus & speex generate some warnings
 * Significant compile time impact

Change-Id: I519b0d179631a54b2103cd67225bd5ec6ad3bd2f
2024-06-18 08:15:47 -04:00
Solomon Peachy
8c86fb6da0 arm: Use -masm-syntax-unified when compiling with gcc8 or newer
Annoyingly, this makes all of the '.S' files we compile get treated as
divided syntax, so we need to make the syntax in them explicit.

Change-Id: I56a3916b7b24c84a1214a5d6bc4ed4d651f002cf
2024-05-08 21:45:42 -04:00
Solomon Peachy
98971604c7 Correct one of the GCC14 warning workarounds
(Accidentally pushed an out-of-date commit)

Change-Id: I53a85420349d6fc12831a481becc2dd1617a8ed9
2024-04-25 20:49:56 -04:00
Solomon Peachy
1922ac1aac Temporary fix for build warnings under GCC 14.0.1
...Both appear to be false positives, and will hopefully be resolved
in a later GCC point release.  I will periodically revisit this.

Change-Id: I7388932f5be052d39dd8c4195b438bf275dd72d9
2024-04-25 19:19:38 -04:00
Roman Artiukhin
19f21a2b3f Codecs: mp4: Enable FAAD_STATIC_ALLOC
Allocates several SBR + PS arrays and variables statically
Prevents out of memory exceptions for long audiobooks

Note from original commit a602f46d why it was disabled:
For now malloc is not fully removed but used by a few arrays needed for AAC-HE SBR+PS only. Reason to keep malloc is to have this amount of memory available for AAC-LC files which might require large m4a tables.

But now with "shrinkable" seek table 2c6dfd06 it's no longer a critical issue for aac-lc files (we just load less seek entries) but might be critical for aac-he files.

Fixes issue described here https://www.rockbox.org/tracker/task/13049#comment44587

Change-Id: Id9c20bad4c46034299a2a4de95d41c807b3af412
2024-03-28 08:25:02 -04:00
Roman Artiukhin
76ec55cc49 Remove ATRAC3 specific fields (channels, extradata_size) from mp3entry
Also fixes typo of using never initialized id3->channels in wav metadata (introduced in 2d1937a1)

Change-Id: I28cddec2b9d9bd1e756ffaa004b4f6e8528a7566
2024-02-02 09:36:53 -05:00
Roman Artiukhin
be16edc94b Codecs: mpa: Use both time and offset when resuming files
The supplied time may be more accurate than the calculated time from the bitrate (can be quite inaccurate for long vbr files and even for cbr due to padding)

Change-Id: I1f8291eab45fbd91a161b51776c391a0f7886a5c
2024-01-24 18:19:33 +02:00
Roman Artiukhin
1122cae028 Codecs: mpa: Improve seek in large mp3 vbr files
Use current position as toc mark and use it if it gives better accuracy.

Continuation of 3883c978

Change-Id: Ic6e8192fc43061f3c07128486dbefba7382be5ce
2024-01-24 12:35:07 +02:00
Roman Artiukhin
d50470bc7d Codecs: aac: Improve ADTS stream detection
Captured ADTS streams might start from some garbage data from previous frame. We should check for sync errors even for first frame.

Change-Id: I70171298b79713aeedf9fa2e6098a03063487649
2024-01-21 20:08:04 -05:00
Roman Artiukhin
3080892d21 Codecs: mp4: Re-Fix loading tracks with metadata at the end of file
first_frame_offset is not set for mp4 files so seeking to it doesn't make any sense. It can lead only to additional re-buffer request. So instead let's just allow seek back for m4a_check_sample_offset check. And do seek_buffer(0) before reading metadata (fixes possible hang introduced in fc65bdab)

Change-Id: Ia7fae14b0137d73b5e263390be5f143deb7ca789
2024-01-12 18:30:30 +02:00
roman.artiukhin
4cd65b9d97 Codecs: mp4: Disable SBR decoding for PP5002 - PP5022 platforms
Includes ipod video (5G) and earlier models, sansa c200 and others players not capable to decode AAC-HE.

Allows to play backward compatible files as AAC-LC.

Change-Id: Ic9f5c0f255d9a4308c3414d402f8f27f4328ca94
2023-12-31 20:44:15 -05:00
roman.artiukhin
fc65bdab4e Codecs: mp4: Fix loading tracks with metadata at the end of file
Fixes FS#13402

Change-Id: Iafb21787e8f042e913c86b249bb2552cfdf4f4a8
2023-12-23 14:35:56 -05:00
roman.artiukhin
2030d681e4 Codecs: mp4: Fix sign overflow in seek by offset
Change-Id: I52f536ae959f989c3dc70a50cb802eb1b8615642
2023-11-02 09:40:56 +02:00
roman.artiukhin
69f62b7891 Codecs: mp4: Fix seek to end of track
Fix possible crash due to out of bound access.

Fixes FS#13371

Change-Id: I90d28fa89ceb22e6561d33abc5f2b4c7f32d323c
2023-10-03 18:36:22 +03:00
roman.artiukhin
7616822fbb Codecs: mp4: Ignore decode errors till next chunk present in lookup_table
In files with gaps between chunks and reduced lookup_table we can't properly detect all gaps in m4a_check_sample_offset. So just ignore decode errors till next chunk present in lookup_table

Change-Id: I317864dce6a2251cdb6ddb8c0ad4d7c1640cb7a1
2023-10-02 12:54:57 -04:00
roman.artiukhin
d05f6aac2d Codecs: mp4: Skip FOURCC filetype chunk check
Instead of FOURCC it needs ignore-case text match. Also value can contain \0 ('m4a\0' instead of expected 'm4a ').But let's simply skip it and let decoder handle it.

Change-Id: I87eefcabbc9010481286257c26cee09e61d1221c
2023-09-29 08:21:27 -04:00
William Wilgus
4c533475d8 codec.h fix ifdef for older compilers
elifdef appears to be finally supported in C23
elif defined() works everywhere

Change-Id: I8ac6c215bedc81cc9ea8f79850be40cef131594b
2023-09-26 15:03:13 -04:00
roman.artiukhin
ec2c507e60 Support per file logging with LOGF_ENABLE in codecs
Codecs mostly use custom LOGF define for logging (i.e. see aac.c). Now such logging can be enabled in single file with #define LOGF_ENABLE

Change-Id: I36312fbcd2d9166fb1fe5ead31e7354342d8828d
2023-09-26 08:38:31 -04:00
roman.artiukhin
a45204f5df Codecs: mp4: Fix seek in files with single element in lookup_table
lookup_table offset shouldn't be zero terminated.
And fix possible out of bound access.

Change-Id: I212a5fcc1868a2ca519b0052b170e836276fe9de
2023-09-22 10:37:38 -04:00