rkusa / DATIS

DCS World Automatic Terminal Information Service (ATIS) broadcasted through Simple Radio Standalone (SRS)
MIT License
91 stars 22 forks source link

Wine compatibility #130

Closed jonpas closed 2 years ago

jonpas commented 2 years ago

I am running DCS and SRS Server inside Wine, which so far works great. However, DATIS fails to find TTS voices, even with Microsoft Speech Runtime Platform and SAPI 4/5 runtimes and voices installed.

I would like to add support for running in Wine, however I am having trouble compiling win-tts for testing:

error[E0433]: failed to resolve: could not find `runtime` in `tokio`
  --> crates\win-tts\src\tts.rs:12:25
   |
12 |         let rt = tokio::runtime::Runtime::new()?;
   |                         ^^^^^^^ could not find `runtime` in `tokio`

error[E0433]: failed to resolve: could not find `LocalSet` in `task`
  --> crates\win-tts\src\tts.rs:14:38
   |
14 |             let local = tokio::task::LocalSet::new();
   |                                      ^^^^^^^^ could not find `LocalSet` in `task`

error[E0425]: cannot find function `spawn_blocking` in module `tokio::task`
  --> crates\win-tts\src\tts.rs:11:28
   |
11 |     let buf = tokio::task::spawn_blocking(move || {
   |                            ^^^^^^^^^^^^^^ not found in `tokio::task`

error[E0425]: cannot find function `spawn_local` in module `task`
  --> crates\win-tts\src\tts.rs:19:27
   |
19 |                     task::spawn_local(async move { tts_local(ssml, voice).await })
   |                           ^^^^^^^^^^^ not found in `task`

Some errors have detailed explanations: E0425, E0433.
For more information about an error, try `rustc --explain E0425`.
error: could not compile `win-tts` due to 4 previous errors

Using rustc 1.63.0 and current main branch, compiling on Windows.

Cross-compiling on Linux has a different issue with --target x86_64-pc-windows-gnu:

   Compiling win-tts v3.1.2 (/home/jonpas/Work/Other/DATIS/crates/win-tts)
error: couldn't read /home/jonpas/Work/Other/DATIS/target/x86_64-pc-windows-gnu/release/build/win-tts-3d89ca416c86f8f0/out/windows.rs: No such file or directory (os error 2)
 --> crates/win-tts/src/lib.rs:4:5
  |
4 |     ::windows::include_bindings!();
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: this error originates in the macro `::std::include` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `win-tts` due to previous error

Build command used: cargo build --release --package win-tts [--target x86_64-pc-windows-gnu].

Any help or information would be appreciated!

rkusa commented 2 years ago

A single build of win-tts on Windows via cargo build -p win-tts should be fixed on main now.

rkusa commented 2 years ago

I've also upgraded the windows dependency to the latest version, which doesn't need the ::windows::include_bindings!(); shenanigans anymore - maybe this helps for cross-compilation.

jonpas commented 2 years ago

Compiling on Windows and cross-compiling works now! I will get to testing this under Wine again shortly. Thank you.

rkusa commented 2 years ago

Great, I'll close this for now then. Feel free to re-open, if you encounter any other issue.

bagellord commented 1 year ago

@jonpas were you ever able to get it to run under Wine? I have been trying, and failing, to get the Windows TTS to work.

jonpas commented 1 year ago

Negative. But work should be put into DCS-gRPC's TTS instead.

bagellord commented 1 year ago

Darn, oh well. I will check that project out.