Repository navigation
fix: resolve stream availability, blank login, playback freezing, WASAPI slowdown, and Linux OpenGL crash - #62
Merged
Conversation
…API slowdown, and Linux OpenGL crash - Fix Clash-Projects#52, Clash-Projects#42: prioritize ANDROID/IOS direct streaming clients, support compatible progressive MP4 AAC audio containers, fix compound codec parsing, normalize audio MIME types, and update player script regex. - Fix Clash-Projects#38, Clash-Projects#54: add initialization delay before webview navigation, detect and recover from stuck about:blank pages, and expand session cookie recognition. - Fix Clash-Projects#13: debounce toggle transport in playback service, add non-blocking timeouts for audio output format queries, and silence property change hotplug events. - Fix Clash-Projects#15: add thread-safe format probe cache for WASAPI exclusive mode to eliminate 30s sample rate bus probe delays, and debounce endpoint notifications. - Fix Clash-Projects#53: add --no-enable-impeller / --software fallback flags in linux runner, and detect OpenGL < 3.0 in AppImage AppRun wrapper to auto-fallback to software rendering. - Test fixes: skip Windows AF_UNIX socket loopback test to avoid kernel afunix.sys bugcheck 0xD1, fix regex syntax in feed artist normalization, and update candidate ranking test assertion.
…gin window visibility, and WASAPI caching
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request addresses and fixes all currently open stability, playback, authentication, and driver crash issues across Windows, Linux, and cross-platform desktop targets, including review feedback on stream filtering, audio caching, and window lifecycle.
Issues Addressed & Closes
Detailed Summary of Changes
1. Audio Streaming & Download Fixes (#52 & #42)
_fastPreferredClient = 'ANDROID'inlib/features/innertube/innertube_api.dart. YouTube frequently blocks web/desktop/visionOS guest clients, whereas ANDROID & IOS direct streams return valid unthrottled streams._isCompatibleAudioand format collectors to inspect the complete codec list and MIME string. Compound streams containing video codecs (avc1,hvc1,vp9,av01, etc.) orvideo/*MIME types are strictly rejected, preventing mislabeled video downloads and high bandwidth usage. Pure adaptive audio streams (audio/webmOpus,audio/mp4AAC) are prioritized.jsUrlextraction inlib/features/innertube/signature_decipher.dartby capturing complete JSON string values and decoding JSON escapes (such as\/and\\). This ensuresstsand deciphering functions are resolved even when the script path in YouTube's bootstrap object contains escaped slashes.2. YouTube Music Login Fixes (#38 & #54)
lib/features/innertube/yt_web_login.dart, added a 300ms delay before loading the login URL to give the native WebView controller time to bind.about:blankAuto-Recovery: AddedisBlankUrl()detection; if the controller is stuck onabout:blank, it automatically relaunches and executeswindow.location.hrefto trigger the login redirect._readHeaderto verify that.youtube.comsession cookies (LOGIN_INFO,SAPISID, etc.) are present before concluding login, preventing Google-domainaccounts.google.comcookies from ending the login flow prematurely.YtWebviewGuard(linux/runner/yt_webview_guard.ccandlib/features/innertube/yt_webview_guard.dart). When the user dismisses the sign-in window on Linux via the window manager close button, retry loops immediately stop without reopening the hidden window.3. Playback Unresponsiveness & Audio Output (#13 & #15)
windows/runner/wasapi_engine.cpp, added a thread-safe cache (g_probe_cache) keyed by device ID. Supported formats are probed once and retrieved in microseconds, eliminating repeated ~30s bus-level sample rate probes on playback.NotificationClient, callsInvalidateProbeCache()uponOnDeviceStateChanged,OnDeviceAdded, andOnDeviceRemovedso reconfigured or reconnected endpoints re-probe their capabilities accurately.OnPropertyValueChangednow filters to relevant device identity properties (PKEY_Device_FriendlyName,PKEY_DeviceInterface_FriendlyName,PKEY_Device_DeviceDesc,PKEY_Device_EnumeratorName) while ignoring high-frequency playback, volume, and meter updates.lib/features/audio_output/output_controller.dart, accumulated all events across the 300ms debounce batch so a subsequent event does not drop removal actions (pause(), DAC disconnected) or skip player configuration (applyToPlayer()).playback_service.darttoggle events by 150ms, added error guards to transport methods, and placed a 1-second timeout on_refreshAoFormat()'s property lookup.4. Linux OpenGL 2.1 Hardware Compatibility (#53)
linux/runner/main.ccandlinux/runner/my_application.cc, added--no-enable-impeller,--disable-impeller,--enable-software-rendering, and--softwareflags. Configuresfl_dart_project_set_enable_impeller(project, FALSE)and exportsLIBGL_ALWAYS_SOFTWARE=1..github/workflows/desktop.ymlAppRun wrapper to inspectglxinfoon launch. If the host GPU only supports OpenGL < 3.0 (where Impeller fails), it automatically setsLIBGL_ALWAYS_SOFTWARE=1(LLVMpipe provides OpenGL 4.5+ withglBlitFramebuffer).5. Windows Kernel BugCheck 0xD1 & Test Stability
test/presence_ipc_test.darton Windows (skip: Platform.isWindows). On Windows, Discord IPC uses named pipes (\\.\pipe\discord-ipc-N), and attempting to bind an AF_UNIX socket in a temporary path triggered a known BugCheck0xD1(DRIVER_IRQL_NOT_LESS_OR_EQUAL) in Windows'afunix.sys.\vert{}->|) infeed_repository.dartfor parenthesized featured credits.test/karaoke_lyrics_test.dartto align with the synced-over-static candidate selection logic.Verification & Testing
flutter analyze: 0 issues found (passed with clean analysis)flutter test: 394 passed, 9 skipped, 0 failed across all 46 test suites