Skip to content
dheijl edited this page Dec 6, 2023 · 12 revisions

Welcome to the swyh-rs wiki!

1. Building swyh-rs yourself

1.1 Versions before 1.9.4

Except for fltk-rs building is straightforward: installing latest stable rust, cloning this repo and running cargo build or cargo build --release is all that is needed.

However, fltk-rs depends on FLTK (Fast Light Tool Kit), a C/C++ library. The swyh-rs version on GitHub will try to build this library, and for this you need C/C++ development tools (MSVC or GCC, CMake, Ninja-build), please refer to fltk-rs - Dependencies for information on this topic.

fltk-rs has an option (feature in Cargo.toml) to use a "bundled" version of FLTK for most platforms, and if you use this option in Cargo.toml you don't have to build FLTK and so don't need a C/C++ development environment. But be aware that this option may disappear in future versions of fltk-rs.

To activate this feature change the following line in Cargo.toml (see fltk-rs - Features):

fltk = { version = "0.12.0", features = ["use-ninja"] }

to

fltk = { version = "0.12.0", features = ["fltk-bundled"] }

But a C/C++ compiler is needed anyway for building libflac (FLAC support) that comes with versions 1.4 and later.

1.2 From versions 1.9.4 and onward you need to specify a feature, either cli or gui, for building (with "gui" being the default):

To be able to build the CLI version (swyh-rs-cli) without pulling in fltk-rs and dependencies, I had to use 2 features in Cargo.toml: "cli" and "gui" (like in the buildall script).

  • to build the cli, use: cargo build --bin swyh-rs-cli --features cli --release --no-default-features
  • to build the gui, use: cargo build --bin swyh-rs --features gui --release or just cargo build --release

If you do not specify a feature, the "gui" version is built (the default feature).

2. [OBSOLETE - Use the new CLI version] Running swyh-rs without a GUI in combination with the "Auto-reconnect" option (Windows only)

User @Silun had an interesting use case (see this issue): swyh-rs is used to stream to a Bubble-UPNP server that exposes a Chromecast as an UPNP/DLNA renderer, but once this is configured with autoreconnect @Silun wanted to get rid of the GUI completely, and devised this clever trick:

I use this Python script which is located in the same folder as swyh-rs.exe:

import subprocess

def startProgram(target):
    SW_HIDE = 0
    info = subprocess.STARTUPINFO()
    info.dwFlags = subprocess.STARTF_USESHOWWINDOW
    info.wShowWindow = SW_HIDE
    subprocess.Popen(target, startupinfo=info)

program = r'swyh-rs.exe'

startProgram(program)

It will run swyh-rs.exe while suppressing the window completely. I put a shortcut to it in shell:startup so it will run automatically on user logon. This does what I wanted to accomplish, it just works now, without any window showing up.

@Silun has also made a small tool that allows you to hide swyh-rs in the system tray: Trayify: It's a small windows utility to run any program while hiding its window, and also add a tray icon to quickly toggle the window's visibility.

3. Automatically downloading the latest release (Windows)

@ksz16 made this script for downloading the latest release with a script (issue #34):

Maybe it will be useful for someone. Tested on Windows 7 with Cygwin installed and curl and grep added to PATH.

FOR /F "tokens=*" %%G IN ('curl -s https://api.github.com/repos/dheijl/swyh-rs/releases/latest ^| grep -oP '^"tag_name^": ^"\K^(.*^)^(^?^=^"^)'') DO set LATEST=%%G curl -L https://github.com/dheijl/swyh-rs/releases/latest/download/swyh-rs-%LATEST%.zip -o %TEMP%\swyh-rs-%LATEST%.zip

@ksz16 also made a complete setup script that integrates the system-tray tool made by @Silun: see issue #35

4. Using ASIO

swyh-rs is built using CPAL without ASIO support. You can still use ASIO though by using VB-Audio HiFi Cable with ASIO Bridge:

According to @mg2c : Using “Hifi Cable Asio Bridge” I can access my RME Fireface UFX II external ASIO soundcard, “connect” it to SWYH-RS and get it to play up to 192kHz/16bit to the Marantz AV7705 AV preamp. So full ASIO support is a given using this bridge.