Commit Graph

3185 Commits (af0a2436fc2465edb844f4ba5376a8c05c4e19ad)

Author SHA1 Message Date
Christopher Snowhill af0a2436fc [FFMPEG Input] Support reading more metadata
Now read all metadata and signal it, and also support pre-buffering
a small block of sample frames if there is embedded artwork, since the
embedded artwork must be handled by the sample decode function.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-11 06:39:00 -07:00
Christopher Snowhill 4828b7f1c1 [FFMPEG Input] Metadata reader supports "genre"
Add support for plain "genre" tag, in addition to the previously
supported "icy-genre" field for streams, this one is for static files.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-11 06:37:31 -07:00
Christopher Snowhill d89edfb979 [FFMPEG Input] Add .dsf filename extension
This format is already supported, but the extension was mistakenly left
out of the format list.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-11 06:35:58 -07:00
Christopher Snowhill 7cac6625d9 [Visualizer] Align memory allocations for DFT
DFT should use aligned memory blocks for best results. Also allocate one
extra sample for DFT output, just in case DFT zop is as bad as zrop.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-11 03:33:42 -07:00
Christopher Snowhill 6c733762d3 [HRIR Filter] Add safety margin for DFT
DFT float happens to clobber one extra sample on forward translate, so
allocate one extra for every complex buffer.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-11 03:32:38 -07:00
Christopher Snowhill 040a61e1ed [HRIR Filter] Replace implementation with vDSP
Work back to a vDSP implementation, this time using overlap-save instead
of overlap-add, also accumulating the results as complex values, only
inversing them once at the end, and finally, replacing the FFT method
with the newer DFT API.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-11 02:25:40 -07:00
Christopher Snowhill 7b18a9f398 [Visualizer] Add PFFFT implementation for example
The PFFFT implementation is actually slower than Apple's float DFT code.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-11 02:21:17 -07:00
Christopher Snowhill b3b4d728f9 [Legacy Visualizer] Customizable colors, labels
The legacy 2D visualizer now supports customizable bar and peak dot
colors, and renders a grid and labels in the windowed mode.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-10 22:38:46 -07:00
Christopher Snowhill b821896560 [Visualizer] Constrain SceneKit visualizer events
Constrain observer events to the exact context requested, and remove
them with the same context specified.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-10 22:35:51 -07:00
Christopher Snowhill 10f0644407 [Core Audio] Conditionally uninitialize equalizer
Only uninitialize the equalizer if sound output was successfully started
and the equalizer AudioUnit was successfully ininitialized.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-10 18:43:56 -07:00
Christopher Snowhill d390febe72 [Core Audio] Remove redundant initialization
These variables will be zero initialized by the class already.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-10 18:42:37 -07:00
Christopher Snowhill 2c7285382c [SQLite Store] Add type checks to add string/art
String and art adder functions now perform type checks, in case of
memory errors that somehow result in classes changing type. Which in
itself is a strange thing to happen.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-10 18:26:45 -07:00
Christopher Snowhill e69ddb3578 [SQLite Store] Restructure add art/string code
Restructure the add string or art functions so they don't take a pointer
to a pointer, which may have caused issues when receiving a nil string
from the caller. Instead, take a plain pointer, and return the object,
returning the ID of the object to a pointer to an int64_t.

Also change several prototypes and functions to use _Nonnull or
_Nullable where appropriate.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-10 18:10:47 -07:00
Christopher Snowhill f23f8970cc [VGMStream] Change libvgmstream optimization level
Optimization level bugs now affect Apple Silicon release builds, so
reduce optimization level there as well.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-10 16:43:27 -07:00
Christopher Snowhill ef2ba385f2 [Audio Threads] Clear workgroup token on exit
When leaving the workgroup, clear the token, as the join call requires
the token to be uninitialized.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-10 16:42:33 -07:00
Christopher Snowhill 22a41e71d3 [Audio Threads] Add further safety gating on error
Errors should stop all attempts to further use the audio thread priority
code, so there won't be debug breakpoints called on older OSes.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-10 15:20:07 -07:00
Christopher Snowhill 1c9887053c [MAD Decoder] Fix crash on invalid files
The properties function should not be dereferencing an invalid index
into the layer codec name array if layer is not set to 1 through 3. This
could happen if, for instance, an MP3 file has an invalid ID3v2 tag.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-10 02:55:13 -07:00
Christopher Snowhill ffdb6262c2 [MAD Decoder] Fix sample count calculation crash
This condition would underflow when skipping a bunch of samples on the
start of playback, or otherwise seeking, and could cause an unsigned
underflow, which would cause the subsequent vDSP_vflt32 to overread into
the MAD sample buffer and crash.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-10 02:44:02 -07:00
Christopher Snowhill fe82b5ed65 [DSD] Reduce volume level of decimator output
As the decimator has shown to be twice as loud as it should be, the
volume should be reduced by half when converting DSD to PCM with it.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-10 02:14:04 -07:00
Christopher Snowhill 4537a72275 [DSD] Add pure downsampling path, disabled
Pure downsampling is slower, but may or may not be more accurate. Though
probably not worth it. It did help me realize a minor error, though.
The decimator's volume is twice as loud as it should be.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-10 02:13:10 -07:00
Christopher Snowhill 92f6c38db0 [Playlist View] Fix constraints for status image
Status image should be positioned properly in the playlist, this minor
change was needed again.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-10 02:11:10 -07:00
Christopher Snowhill 6156aa0095 [Credits] Update Patreon credits
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-10 00:30:18 -07:00
Christopher Snowhill 90e24d2459 [Playlist View] Reset column constraints
Reset column constraints to suggested defaults. We can tweak them from
there if necessary.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-10 00:24:48 -07:00
Christopher Snowhill e96a4efa68 [Metadata Loading] Added null pointer guards
This prevents crashes where inputs were not returning either properties
or metadata blocks and the file open cache was attempting to cache the
resulting nil pointer as if it were valid. Also prevent the metadata
redundant string coalescing from processing nil objects as well, in case
it's used that way somewhere else.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-09 23:18:51 -07:00
Christopher Snowhill 2dabcb2581 [Build System] Forgot to set API key for symbols
The symbol uploads on archive are useless unless they're uploaded with
the API key set correctly in the script.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-09 21:25:03 -07:00
Christopher Snowhill aca29e472b [Bug Reporting] Introduce Bugsnag crash reporting
Crashes will now be collected with an optional comment, and uploaded on
next launch of the app.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-09 18:58:42 -07:00
Christopher Snowhill bca1b02dc4 [Git Hooks] Fix hook to ignore submodule projects
Submodule projects are sometimes out of my control, so I shouldn't have
to deal with team identifiers in projects that don't affect my build
process in any meaningful way. The only way to deal with this would be
to fork and modify every project I touch that contains this stuff. No.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-09 18:55:21 -07:00
Christopher Snowhill 6bd0bf1dc5 [Audio Threads] Set realtime priority on old OS
Set baseline real-time priority for audio threads even on old macOS,
since that API is available there. Only set it once, and do not attempt
again if it fails, only once per thread.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-09 18:53:58 -07:00
Christopher Snowhill 7813712df3 [Audio Threads] Correctly set real time priority
I'm not sure about macOS Ventura, but stable releases of macOS, at
least on Intel, require that threads joining Audio Interval
workgroups already be set to run as real-time before joining. Not
doing this results in an uncaught exception and a crash.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-09 18:15:44 -07:00
Christopher Snowhill 91898e9e77 [Audio Threads] Change workgroup system again
Now it allocates audio workgroups per thread, using work slices like the
Apple documentation describes for asynchronous threads.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-09 01:38:30 -07:00
Christopher Snowhill fef8821cf6 [Visualizer] Add extra condition to visible check
Add an extra condition to the visibility check, which is similar to the
previous version of this check, which now guards against the window it
is hosted in not being visible.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-09 00:43:23 -07:00
Christopher Snowhill 6179b304d0 [Audio Threads] Join output device workgroup
On Big Sur or newer, it is possible to join the audio threads to the
same OS workgroup as the audio output device, improving response.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-09 00:27:55 -07:00
Christopher Snowhill cdcbabd72f [Visualizer] Accidentally left in debug test code
This was changed to verify the legacy code still works.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-08 21:56:47 -07:00
Christopher Snowhill 1728debe94 [Visualizer] Bring back CoreGraphics visualizer
For legacy systems that do not support Metal. The Metal SceneKit view
does work on even 10.13.6, if a Metal GPU is present in the system.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-08 21:32:52 -07:00
Christopher Snowhill f2b015c149 Merge branch 'xcode14' 2022-06-07 19:06:48 -07:00
Christopher Snowhill 6022526ad4 [Visualization] Improve hidden window detection
The NSView should detect if it's a visible control in a window

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-07 19:01:47 -07:00
Christopher Snowhill fc7a8dbcb7 [Vorbis Plugin] Fix compilation on case sensitive
Fix compilation when source code is checked out on a case sensitive file
system.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-07 18:58:45 -07:00
Christopher Snowhill f11ef2d887 [Playlist Controller] Fix ambiguity with Xcode 14
This NSArray member call is ambiguous, but Xcode <14 allowed it.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-07 18:57:19 -07:00
Christopher Snowhill 00ea4562dc Update project files for Xcode 14 recommendations
Update all project files with new upgrade version number, and add the
dead code stripping option. Don't touch MASShortcut because it's not my
project.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-07 18:56:11 -07:00
Christopher Snowhill dc103ac546 [Visualizer] Disable processing when vis is hidden
When visualizer windows are created, but not actually visible, stop the
update timer, to save processing, especially if the vis is enabled in
one or the other main/mini windows.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-06 08:19:42 -07:00
Christopher Snowhill c208f60da4 [HRIR Convolver] Rewrite to use PFFFT float
Replace overlap-add vDSP/Accelerate implementation with a faster PFFFT
overlap-save implementation, using fewer FFT steps as well.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-06 08:18:33 -07:00
Christopher Snowhill 18af8a06df [Output] [Downmixer] Optimize a bit
Rewrite some of the output and a lot of the downmixer to use Accelerate
framework instead of dumb for loops.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-06 08:16:27 -07:00
Christopher Snowhill 0ba766023e Playlist/Time: Simplify font initialization
Apparently this simpler API already existed on a minimum of 10.11 for
creating a system font with monospaced digits.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-03 16:46:37 -07:00
Christopher Snowhill eaa73bc52f [Threading] Queue expensive actions outside audio
Use delayed dispatching on expensive operations which occur every time
the "heard" track end happens, and when audio metadata is changed by a
stream, so that they are inserted into the main thread queue after the
invoking callback returns control execution back to the audio thread.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-30 23:59:42 -07:00
Christopher Snowhill 4a0b337936 [Resampler] Change pffft_double project import
Change import from folder reference to group, like I originally
intended.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-30 22:31:49 -07:00
Christopher Snowhill 05f17ea950 [Menu] Add Stop after Selection to context menu
Since the existing code already supports setting any arbitrary track as
a stopping point, add a menu interface to toggle Stop After for any
track in the playlist. Stop After will be removed from the given track
after it has been played. Stop After will not be remembered on disk.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-30 22:23:02 -07:00
Christopher Snowhill aabd9431f1 [Visualization] Gate registered observers
Gate registering observers behind a check variable in the object state,
which will be zero initialized by the Objective-C runtime, and will
prevent the class from erroneously unregistering observers without them
being registered in the first place. Apparently, services cannot be
unregistered if they were never registered first, or else an exception
will be thrown upon attempting to unregister them. This fixes a crash on
startup in the now several times running failure to work properly on
legacy Macs without Metal graphics, now that the new visualization
system has been implemented.

It's probably not worth bringing back the previous Core Graphics based
visualizer method anyway, as on those same legacy machines, it was
causing out of control CPU usage by WindowServer. At least on modern
Macs, any amount of 60fps UI updating will cause WindowServer to use
about 45% of a core, regardless of how many apps are drawing that much
at once.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-30 21:38:29 -07:00
Christopher Snowhill 94057cf467 Updated VGMStream to r1745-22-gf696beb0
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-30 18:26:34 -07:00
Christopher Snowhill bea896cca5 [Resampler] Switch r8brain back to PFFFT double
Apparently, PFFFT double is much faster than vDSP, and I didn't even
notice. Thanks to Aleksey Vaneev for testing this properly.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-30 18:24:37 -07:00
Christopher Snowhill 50342891af [Convolver] Normalize HRTF impulse when resampling
When resampling the impulse according to the playback rate, it becomes
necessary to normalize the resulting impulse by the inverse of the
sample ratio, as resampling adds more or less loudness by virtue of
interpolating samples.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-30 01:39:12 -07:00