sonixd
sonixd copied to clipboard
Plans for supporting audio device exclusive mode
Is your feature request related to a problem? Please describe.
Hi, I really appreciate the great work here! Just wondering if you have any plans for support playing back utilizing audio device exclusive mode provided by OSes, e.g. CoreAudio Exclusive Mode on macOS and WASAPI Exclusive Mode on Windows, to achieve bit-perfect playback?
Thanks in advance! Tom
I did a bit of research about this since I haven't really used it before, and I'm not sure if Electron natively supports this functionality. Do you know if there Electron apps or apps using HTML5 audio that have achieved this to reference?
AFAIK Tidal uses Electron and supports Exclusive Mode, I unpacked their macOS client and there is a Electron framework inside.
I think I'll probably need some additional assistance since I don't see an easy way on how to implement this. If anyone has implemented this previously, your insight is appreciated!
Found this while looking around for any examples of using WASAPI or ALSA (linux exclusive driver) and it looks like it might not be possible with electronjs
@daynyxx Nice find. Seems like this issue is stuck unless someone is aware of a path forwards.
You could achieve this if you instruct a backend to do the actual playback. Chromium (and thus Electron) handles playback with FFmpeg internally, which is reasonable for web stuff; perhaps you'd have to use a GStreamer pipe to achieve this, or libVLC, but easily not stuff that you can do in plain JS (unless NPM proves me wrong).
Jellyfin Desktop player did it using MPV (https://github.com/jellyfin/jellyfin-media-player/blob/b670715a5cff4249090b073032fcb7a2564a63c1/src/player/PlayerComponent.cpp)
@Mavyre Perfect, the rewrite is currently using mpv as well. Looks to just be a configuration toggle to enable it. https://github.com/jeffvli/feishin
Awesome @jeffvli! I'll test it out. That will allow me to play mqa.flac files through my DAC!