I am reporting a problem with pajper's Spotify 1.1.2 app in Elten 3.0.5 RC 4. Initially, the app could not load its native library. With an alternative path to the data directory, the app opens, but music still does not play.
Environment
Elten 3.0.5 RC 4, x64. Ruby 4.0.7, x64 mingw ucrt environment. NVDA 2026.3. Windows. The exact Windows edition and build were not recorded in the existing diagnostic report. Spotify app 1.1.2, build 20260926001, installed as a signed package from the server. Active Spotify Premium Individual subscription. Music works on the same account in the official Spotify client outside Elten.
Steps and observed behaviour
When starting Elten normally, browser authentication completed and displayed a message saying I could return to Elten. The app then reported that it could not load the Spotify library for Windows x64 and suggested reinstalling. Reinstalling did not help.
My Windows profile directory contains the Polish character ł. A comparison test used a temporary SUBST alias for the data directory and the /datadir option to provide a path without Polish characters. This used the same installation and existing data.
With that launch method, Elten and the Spotify app open. However, attempting to play a track produces no sound. Repeatedly pressing P reports a position of zero. Selecting the Realtek speakers as Elten's output device does not help.
Expected result
The app should load its library from a path containing Polish characters and play the selected track.
Diagnostic results already collected
The x64 elten_spotify.dll exists and is 9,909,760 bytes long. Its PE header confirms x64, 0x8664, and the DLL flag.
Both LoadLibraryExW tests using the full Unicode path succeeded. The first used the DLL directory and System32. The second also included the Elten installation directories. These tests ran in separate diagnostic processes, not inside Elten's Ruby process, and did not test Spotify authentication or playback.
Direct imports, with case insensitive duplicates omitted: kernel32.dll ntdll.dll advapi32.dll oleaut32.dll bcryptprimitives.dll ws2_32.dll secur32.dll crypt32.dll api-ms-win-core-synch-l1-2-0.dll
An earlier Elten log also contained BASS_ERROR_FILEFORM for listbox_marker. Its relationship to the Spotify problem has not been established. I do not yet have a detailed error from the playback stage after applying the alias.
I am not claiming that the character in the path is the confirmed cause of both symptoms. The alternative launch method removed the initial library error but did not fix playback. There may be two separate problems.
Could you investigate path handling and advise how to enable detailed app logging, ideally showing the actual exception and the results of Librespot session initialization, the play request, data retrieval and passing audio samples to Elten? Please also explain how to remove authentication tokens safely from any log before sharing it.
A more detailed compilation of the existing results is prepared in RaportSpotifyElten.txt, in Polish. It is not a new test or a complete playback log. The key technical results are included above so this post is useful even without an attachment.
I reproduced the library-loading part independently using the Windows x64 DLL from the current signed Spotify 1.1.2 / build 20260926001 package. Its size and SHA-256 match this report exactly (9,909,760 bytes; `caeb76756e27b8dfc33d7257f99f6b3e465519799f7533a9cad8642bed3d0b20`).
In two separate Ruby processes (Ruby 4.0.6, Fiddle 1.1.8, Windows ANSI code page 1250), using the same DLL:
- An ASCII path: `Fiddle.dlopen(path)` succeeds, and `esp_abi_version` returns 3. - A path containing `Łódź-żółw`: `Fiddle.dlopen(path)` raises `Fiddle::DLError: No such file or directory`. - `LoadLibraryW` with the full UTF-16LE path succeeds in both cases; `GetProcAddress` plus the same ABI call returns 3.
No `esp_create`, Spotify authentication, network connection, playback or microphone operation was invoked. This isolates the loader without starting a second Rust/Tokio runtime inside Elten.
The shipped `spotify/native.rb` verifies the DLL with Ruby's Unicode-aware file APIs, but then loads the original UTF-8 path directly with `Fiddle.dlopen`. Fiddle 1.1.8's Windows implementation passes its C string to `LoadLibrary`, so this boundary does not provide the UTF-16 loading used by the successful control test. A Windows-only wide-character loader is needed at that boundary, preserving the existing `LIBRARIES` cache and the deliberate no-dlclose lifetime. Merely suggesting reinstalling cannot repair this path failure.
I have now prepared and tested this contained patch to the shipped `spotify/native.rb`. It does not change global Fiddle handling, authentication, server tables, playback/decoding or other platforms' loader. There is no repository URL in the public app catalogue, so this is source for the app maintainer, not an already-updated signed package.
```diff --- a/spotify/native.rb +++ b/spotify/native.rb @@ -13,6 +13,31 @@ # Keep the DLL mapped while its Rust runtime is alive. Never dlclose a Tokio runtime. LIBRARIES = {}
+ # Fiddle's Windows loader accepts an ANSI C string, not a UTF-8 path. + # This private adapter intentionally never calls FreeLibrary, like the + # disabled-close Fiddle handles used on the other platforms. + class WindowsLibrary + def initialize(path) + raise ArgumentError, "Invalid library path" if path.include?("\0") + @kernel = Fiddle.dlopen("kernel32.dll") + @kernel.disable_close + ptr = Fiddle::TYPE_VOIDP + abi = defined?(Fiddle::Function::STDCALL) ? Fiddle::Function::STDCALL : Fiddle::Function::DEFAULT + load = Fiddle::Function.new(@kernel["LoadLibraryW"], [ptr], ptr, abi) + @symbol = Fiddle::Function.new(@kernel["GetProcAddress"], [ptr, ptr], ptr, abi) + @handle = load.call(path.encode(Encoding::UTF_16LE).b + "\0\0".b) + raise Fiddle::DLError, "LoadLibraryW failed (Windows error #{Fiddle.win32_last_error})" if @handle.null? + end + + def [](name) + address = @symbol.call(@handle, name) + raise Fiddle::DLError, "GetProcAddress failed for #{name} (Windows error #{Fiddle.win32_last_error})" if address.null? + address.to_i + end + + def disable_close = self + end + def initialize(program) target = Programs.platform_target suffix = target.start_with?("windows-") ? ".dll" : (target.start_with?("osx-") ? ".dylib" : ".so") @@ -21,7 +46,7 @@ expected = BINARY_HASHES["bin/#{target}/elten_spotify#{suffix}"] raise Error, "The Spotify library failed its integrity check. Please reinstall the application." unless expected && Digest::SHA256.file(path).hexdigest == expected - @library = LIBRARIES[path] ||= Fiddle.dlopen(path) + @library = LIBRARIES[path] ||= target.start_with?("windows-") ? WindowsLibrary.new(path) : Fiddle.dlopen(path) @library.disable_close ptr, int, void = Fiddle::TYPE_VOIDP, Fiddle::TYPE_INT, Fiddle::TYPE_VOID @abi = Fiddle::Function.new(@library["esp_abi_version"], [], int) @@ -34,7 +59,8 @@ @mutex = Mutex.new @handle = @create.call raise Error, "Librespot could not be started." if @handle.null? - rescue Fiddle::DLError + rescue Fiddle::DLError => error + Logging.exception("native_library_load_failed", error) raise Error, _("The Spotify library for %{target} could not be loaded. Please reinstall the application.") % { target: target } end
```
The patched loader passed 39 checks in an isolated Windows x64 Ruby process, including real ABI calls from ASCII, Polish and Japanese/emoji paths, resolving all six required exports, GC without unloading, missing file/export error codes, embedded NUL rejection, constructor cache selection/reuse and diagnostic propagation. `esp_create` was controlled at the constructor boundary, never executed; no Spotify session was started. Windows x86/ARM64, Linux and macOS were not run.
The second symptom is still separate: the ASCII/SUBST workaround already gets past loading but does not produce music. A separate muted native test inside the running Elten confirmed that the app's shipped Ruby `AudioOutput` consumes synthetic PCM and advances position. That is not a real Spotify track test and does not diagnose authentication, session initialization or native decoding. I am not marking playback as fixed. The app already has a sanitising `Spotify::Logging` queue and `flush` on its extension tick; `native_call_failed` / `audio_worker_failed` and the native diagnostics entries are the relevant existing hooks for a playback trace. Do not share access tokens or raw credential files.