Commit graph

628 commits

Author SHA1 Message Date
Roman Artiukhin
ff0ad4ca7d metadata: aac: support .aac files with mp4 container inside
Change-Id: Id982c58184197f6b2f9eeb0cf403cc2e30a97e24
2024-09-23 17:43:13 +03:00
Roman Artiukhin
3f3ec8273a metadata: aac: Fix any file is treated as valid aac
Fixup for d50470bc

Change-Id: Ie96a636afd3f18e03d70601628c2731cb7314483
2024-09-21 14:51:50 -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
Christian Soffke
23e5f77ab0 Remove mp3info function & remove list_do_action from plugin_api
Change-Id: Ia9a2d6889679832f23b19a989927277ba886cba4
2024-07-26 15:15:06 -04:00
William Wilgus
7e90760a48 [Feature] Playlis to cue plugin
generate valid cue files from a playlist

uses remarks to store extra id3 info and display and playlist index

Change-Id: I00c9f6389445bb601dde6eb8f36157044024f8cb
2024-07-20 07:27:01 -04:00
Evan Kenny
96f42a5646 skin engine: Add tags to display Quickscreen Items
A set of new tags for themes that allow them to display a quickscreen item's name or value like what is displayed on the default quickscreen.

There are 8 tags in total, 2 for each direction or "item".
One type of tag displays the setting name, while the other displays the setting's value.

All tags output an "ERR" string if no valid setting is found for that item.

Quickscreen Item name tags: %QT, %QR, %QB and %QL.
Quickscreen Item value tags: %Qt, %Qr, %Qb and %Ql.

Change-Id: Ia08ba5940e38065e051a0aefa2cff142c9e58684
2024-07-13 19:07:06 -04: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
William Wilgus
fdbaf7df59 [Feature] playlist_viewer id3 title display
Not sure this is a great idea from disk and battery standpoint
but there is no reason you can't..

using the name buffer to fill title data
prevent hitting the disk for each screen scroll

add get_metadata_ex to allow flags
 METADATA_EXCLUDE_ID3_PATH
  prevent copying the filename to the ID3 struct
 METADATA_CLOSE_FD_ON_EXIT
  instead of seeking to the beginning the file is closed before
  get_metadata returns

add logic to allow a invalid fd to signal that get_metadata
should open and close the file within its call

bugfix per Chris_s don't use the tagcache for the trackinfo

Change-Id: Ic7a595b39a8d7a57f975312bc9c8bb4111f22a88
2024-07-09 01:40:02 -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
William Wilgus
2903a8e8ac [coverity] tlsf.c tlsf_malloc guard against empty mempool
on error mp could still be NULL

Change-Id: Ic86571a7d5d0c3586d2be00b45251f03b1be3fca
2024-06-02 21:00:09 -04:00
Solomon Peachy
5dd9238004 Fix yellow in sim builds
Change-Id: Ibed5ca7a821a31128940d602ade75497c13631f5
2024-05-24 11:34:43 -04:00
Solomon Peachy
8825b33052 skin_debug: Don't segfault when dump a viewport with no children
Change-Id: I5dfcc53a735dab1552211cdf522f4d18d93e6ec8
2024-05-24 11:17:41 -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
William Wilgus
0dd5df4060 [BugFix] tlsf get_new_area should return 0u or OOM
Change-Id: I24f67a3a28237b7c1035932f69b7f526471bb8ef
2024-04-27 03:23:43 -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
William Wilgus
92e77ddbd8 [FIX_RED] microtar.c #2
Change-Id: I22fe42de595c2d31c8720c5bae115e69849f6e28
2023-11-19 13:20:35 -05:00
William Wilgus
58707b0429 [FIX_RED] strcmp missing on microtar.c ??
Change-Id: I55110433dac770896155061ad4572252a6f3a374
2023-11-19 13:03:25 -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
11b8336c64 Fix rewind on resume is applied for skip length across tracks action after auto frequency switch
Add resume adjustments flag in mp3entry struct which is required for proper AUDIO_START_RESTART resume handling

Fixup for 4fb37ecb (#5196)

Change-Id: Ie9ecfe2b637bba38e442066333d71eeff01030ad
2023-10-31 13:46:07 -04: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
Aidan MacDonald
1131320d48 Remove structec API from codecs
Change-Id: I1e67582c0521e6354b0175a11fcf690ae40dbd88
2023-10-01 12:10:41 +01: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
roman.artiukhin
35150b83d4 Codecs: mp4: Fix sbr detections for some files
Use logic from libfaad/mp4.c AudioSpecificConfig2 for sbr detection

Fixes FS#12856

Change-Id: I235aa27830aa99f1307b303347f7affe7deafbe3
2023-09-20 10:03:27 -04:00
roman.artiukhin
57409f52d5 Codecs: mp4: Accurate seek in large files with small lookup_table
Read sample_byte_sizes table on demand when it can't be cached

Change-Id: I2191be63ceebfd8b16e1e973e13c5b51986b6564
2023-09-20 11:43:39 +03:00
Solomon Peachy
3dbf5a97ad alac: Fix warnings introduced in ac82a653bb
Change-Id: I96fc2b8637cb95c5bd14a6d77fc4b2339c4acd49
2023-09-19 12:36:02 -04:00
Solomon Peachy
ac82a653bb libm4a: Fix warnings introduced in 001a338e51
Change-Id: Ia915e6f8babbd71533f22af566e5c45c2b40fbe5
2023-09-19 11:47:38 -04:00
roman.artiukhin
001a338e51 Codecs: mp4: Reuse lookup_table index from seek in m4a_check_sample_offset
Change-Id: If2fc3038ce8db8ddf2991406a5cce294a857eadc
2023-09-19 11:13:19 -04:00
roman.artiukhin
ef7d6009b4 Codecs: mp4: Optimize m4a_check_sample_offset
Make optimization from 2358fabb actually work.
Fix potential out of bound access.
Remove redundant zero offset check.

Change-Id: I0a0ba04670b612d410ac17a761bd08c2915721b9
2023-09-19 11:13:19 -04:00
roman.artiukhin
9242e4cadb Codecs: mp4: Small cleanup
Remove unnecessary frame modification

Change-Id: I884152a66477efea7cfcadc638f55352ad75fc41
2023-09-18 11:29:21 -04:00
roman.artiukhin
6acb6446e6 Codecs: mp4: Improve support for long files. Part 2
Don't store sample_to_chunk table and read data on demand instead (it's required only once for building lookup table). It allows to store 2x bigger lookup table.

Change-Id: Ida79d0c281040300d6561e124fe10ebacb0e4679
2023-09-18 11:29:05 -04:00
roman.artiukhin
27aa95afcb Codecs: mp4: Fix seek in very large files
Samples count requires 64 bit

Change-Id: Ia54be57d7d15b3db19dbc29ff8a06671594abb4b
2023-09-15 09:08:18 -04:00
roman.artiukhin
d2f7777f7a Codecs: mp4: metadata: Fix time length in very large files
Fix 40 hours long book reported as 14 hours due to samples overflow

Change-Id: I5988d4492b1f51081fff921180de6fe384ab5f4f
2023-09-15 09:08:02 -04:00