Commit Graph

348 Commits

Author SHA1 Message Date
Jonas Kvinge 4626a6f609 GstEnginePipeline: Use playbin3 with gstreamer >= 1.22 2024-03-08 18:52:22 +01:00
Jonas Kvinge f84ce3f1d1 Add exclusive mode option for WASAPI 2024-02-20 01:08:00 +01:00
Jonas Kvinge ff28e7c86e Add ASIO device finder 2024-02-17 00:40:55 +01:00
Jonas Kvinge a354f6bdc5 GstEnginePipeline: Set device-clsid 2024-02-16 21:38:33 +01:00
Jonas Kvinge cb44c71733 DirectSoundDeviceFinder: Add waveformsink 2024-02-16 21:38:08 +01:00
Jonas Kvinge 6b1c14f875 GstEngine: Make sure asiosink is detected 2024-02-16 00:29:17 +01:00
Jonas Kvinge 7770aba877 GstEngine: Add pipewiresink 2024-02-14 18:46:23 +01:00
Jonas Kvinge 6bdd9ad4dd GstEnginePipeline: Only hard-code playbin3 with gst 1.22 2024-02-11 23:52:22 +01:00
Jonas Kvinge 7c4e33b676 GstEngine: Treat all stream errors as non-fatal
Fixes #1347
2024-01-02 19:54:19 +01:00
Jonas Kvinge 54c42b276f GstEnginePipeline: Increase thread priority 2023-11-26 13:12:03 +01:00
Jonas Kvinge ac9fd9070f GstEnginePipeline: Only set max size buffer if > 0
Fixes #1302
2023-11-12 22:04:31 +01:00
Jonas Kvinge 6348649bc6 GstEnginePipeline: Run QTimer::singleShot in main thread
Partial fix for #1302
2023-11-12 21:57:59 +01:00
Jonas Kvinge 9211b6f0c0 GstStartup: Remove macOS libsoup workarounds 2023-10-21 03:05:04 +02:00
Jonas Kvinge bf52afa21d GstStartup: Add back LIBSOUP3_LIBRARY_PATH 2023-10-15 07:46:49 +02:00
Jonas Kvinge 1a66eaf7bf GstStartup: Refactor environment code 2023-10-14 03:29:54 +02:00
Jonas Kvinge 99a5aee8b3 GstEnginePipeline: Change debug logging for active/inactive 2023-10-13 23:38:19 +02:00
Jonas Kvinge f542f1c854 GstEnginePipeline: Remove volume sync for Auto
Workaround crash in #1123
2023-10-10 23:17:03 +02:00
Jonas Kvinge 33041ffa75 GstEnginePipeline: Delay seek when when resetting next URI
When seeking after the next URI is set, we set the state to READY to switch the URI back. The seek in after going to ready sometimes does not work, delay the seek to workaround this.

Fixes #1258
2023-10-10 23:00:11 +02:00
Jonas Kvinge 76fa4745d0 GstEnginePipeline: Only update last known position when possible
Fixes flaky seeking where gst_element_query_position() returns -1 when seeking.
2023-10-07 02:47:12 +02:00
Jonas Kvinge f40f43861d EngineBase: Use enum class for TrackChangeType 2023-10-03 20:18:52 +02:00
Jonas Kvinge 45ad84a9bc Fix build with macOS < 12.0 2023-08-27 13:54:23 +02:00
Jonas Kvinge 6815f8c9b7 MacOsDeviceFinder: Rename kAudioObjectPropertyElementMaster to kAudioObjectPropertyElementMain 2023-08-27 01:14:42 +02:00
Jonas Kvinge e56e58b634 GstEnginePipeline: Always set use-buffering 2023-08-06 13:44:57 +02:00
Jonas Kvinge fed5b6b695 GstEnginePipeline: Rename ebur128 volume variable 2023-08-06 13:36:25 +02:00
Jonas Kvinge f70f126f76 AlsaDeviceFinder: Replace BOOST_SCOPE_EXIT with QScopeGuard 2023-08-03 17:29:42 +02:00
Jonas Kvinge 2a90256d32 GstEnginePipeline: Disable volume sync on Windows
Fixes #1220
2023-08-01 16:39:57 +02:00
Jonas Kvinge 560712db21 ebur128analysis: Check for valid channel-mask 2023-07-30 03:18:48 +02:00
Jonas Kvinge 483b42d2b8 GstStartup: Use directsoundsink as primary sink 2023-07-29 22:54:49 +02:00
Jonas Kvinge 2e61235403 Application: Use shared pointers
Fixes #1239
2023-07-21 05:55:24 +02:00
Jonas Kvinge d6b53f78ab Cleanup includes 2023-07-21 05:25:57 +02:00
Jonas Kvinge a2c7ff63df Formatting 2023-07-21 05:11:27 +02:00
Roman Lebedev 9fb15545bd GstEnginePipeline: Perform EBU R 128 Loudness Normalization in floating-point 2023-07-19 03:07:22 +02:00
Jonas Kvinge dc65753a0b ebur128analysis: Remove extra semicolon 2023-07-16 23:26:17 +02:00
Jonas Kvinge 7826f77425 Formatting 2023-07-12 16:27:59 +02:00
Jonas Kvinge a1ffc5c33b ebur128analysis: Rename dsc variable 2023-07-12 16:26:39 +02:00
Jonas Kvinge 8a44a41abb ebur128analysis: Initialize variables to silence warnings 2023-07-12 16:26:17 +02:00
Roman Lebedev 4bd993b1e3 GstEngine/GstEnginePipeline: support gap-less playback w/ loudness-normalizing gain
Ok, it does appear that it is that simple.

In principle this (even the non-update case) results in volume jumps,
so maybe we'll want gradual gain change...

Notably, i thought we'd always seek if the pipeline
was already operating on the same URL as the new one,
but apparently only for adjacent songs?
2023-07-12 14:34:04 +02:00
Roman Lebedev f81816b0cd EBUR128Analysis: handle channel map
Loudness measurement is channel-dependent.
This perhaps matters most for mono audio.
2023-07-12 14:34:04 +02:00
Roman Lebedev 94ab788032 GstEnginePipeline: actually perform (EBU R 128) loudness normalization
The magic: if EBU R 128 loudness normalization is enabled,
just insert `volume` GST element into the pipeline
(where ReplayGain would be inserted) and configure it.

We currently don't support changing said gain after the pipeline
was created. We might need to, though, for a number of reasons.
2023-07-12 14:34:04 +02:00
Roman Lebedev e3a333564a `GstEngine::Load()`: different loudness-normalizing gain means new pipeline
This is a bit of a gotcha, there should be a point (where we seek?)
where we'd be able to change said gain, but for now this is a simple[r]
stop-gap fix.
2023-07-12 14:34:04 +02:00
Roman Lebedev 13d6cf201f Engine: pipe-in the EBU R 128 loudness normalization gain stuff
The idea is that Integrated Loudness is an integral part
of the song, much like knowing it's beginning / ending
in the file, and we must handle it the exact same way,
and pipe it through all the way.

At the same time, `EngineBase` knows Target Level (from settings),
and these two combined tell us the Gain needed to normalize the
Loudness of the particular Song (`EngineBase::Load()` does that).
So the actual backend only needs to handle the Volume.

We don't currently support changing Target Level on the fly.
We don't currently support changing Loudness-normalizing Gain on the fly.

This does not handle the case when the song is loaded from URL
and thus the EBU R 128 measures, that exist, are not nessesairly correct.
2023-07-12 14:34:04 +02:00
Roman Lebedev 40ef3191fc `EBUR128Analysis`: place a `queue` before `appsink`
This improves the performance of the analysis (by 2x!),
by offloading non-`libebur128`-computations (i.e. decode-convert)
to a separate thread, thus reducing walltime.
2023-07-12 14:34:04 +02:00
Roman Lebedev bafcb97fa1 Implement `EBUR128Analysis`
The most juicy bit!

This is based on Song Fingerprint Analysis,
but here we must know the actual song, and not just the file.

The library supports only interleaved S16/S32/F32/F64,
so we must be sure we insert `audioconvert` into pipeline.

One point of contention here for me, is whether we should
feed the frames to the library the moment we get them
in `NewBufferCallback`, or collect them in a buffer
and pass them all at once. I've gone with the former,
because it seems like that is not the worst choice:
https://github.com/strawberrymusicplayer/strawberry/pull/1216#issuecomment-1610075876

In principle, the analysis *could* fail,
so we want to handle that gracefully.
2023-07-12 14:34:04 +02:00
Jonas Kvinge 716e80fb84 UWPDeviceFinder: Fix EngineDeviceList 2023-06-01 21:35:48 +02:00
Jonas Kvinge 315073f9a7 Add EngineDevice class 2023-06-01 19:31:19 +02:00
Jonas Kvinge a5a29f7ad3 DeviceFinder: Add typedef DeviceList 2023-06-01 18:43:43 +02:00
Jonas Kvinge 8e14ef7c0c GstStartup: Set rank for directsoundsink higher than wasapisink for MinGW
Fixes #1204
2023-06-01 18:31:55 +02:00
Jonas Kvinge e466cb6e30 Add UWP device finder 2023-06-01 18:11:30 +02:00
Jonas Kvinge f0df9dc0fb GstEngine: Append "2" to wasapi2sink description 2023-06-01 17:22:11 +02:00
Jonas Kvinge 5fd0a0831f GstEngine: Include all outputs that starts with "Sink/Audio" 2023-04-23 01:28:52 +02:00