Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash of concurrent Win TTS synthesis #223

Merged
merged 1 commit into from
Apr 23, 2023

Conversation

rkusa
Copy link
Collaborator

@rkusa rkusa commented Apr 7, 2023

Fixes a crash related to Windows' TTS as reported in Discord. This seems to be caused by a certain concurrency of the synthesis. I don't really know the exact cause (could be Windows - Rust interop), but simply preventing concurrency seems to fix it.

tts/src/win.rs Show resolved Hide resolved
rurounijones
rurounijones previously approved these changes Apr 8, 2023
@uriba107
Copy link

uriba107 commented Apr 8, 2023

Just to chime in.
I've ran one of my Hound demo missions with a DLL built from this branch. the fix seems to have done the trick and my mission was able to run correctly (I was a maximum of 14 messages in 2 seconds, usually two or 3 are the same message sent on different channels).

here is a random chunks of debug log

2023-04-08 23:25:33.700 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>JAZZ SAM information Bravo 05 05 Local. Fan-song 54, very recent at Bravo Tango Six   Zero, accuracy Very High. Fan-song 44, very recent at Bravo Sierra Three   Niner, accuracy Very High. Fan-song 52, Active at Bravo Sierra Six   Seven, accuracy Very High. Fan-song 43, Active at Bravo Sierra Four   Niner, accuracy Very High. Fan-song 45, Active at Bravo Sierra Five   Eight, accuracy Very High. Flat Face 36, very recent at Bravo Sierra Four   Niner, accuracy Low. Flat Face 38, Active at Bravo Sierra Five   Eight, accuracy High. Flat Face 37, very recent at Bravo Sierra Three   Niner, accuracy High. Flat Face 40, Active at Bravo Sierra Three   Five, accuracy Low. Flat Face 39, Active at Bravo Sierra Six   Seven, accuracy Very Low. Flat Face 50, Active at Bravo Tango Three   Zero, accuracy Low. Straight Flush 47, very recent at Bravo Tango Two   Zero, accuracy Very High. Straight Flush 46, recent at Bravo Sierra Three   Niner, accuracy Very High. Straight Flush 41, relevant at Bravo Sierra Four   Six, accuracy Very High. Straight Flush 48, Active at Bravo Sierra Five   Niner, accuracy Very High. 2 EWRs are tracked. you have Bravo.</prosody></voice>` @ 306750000 (TtsOptions { plaintext: None, srs_client_name: Some("JAZZ"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:34.704 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>WHEELJACK SAM information Bravo 05 05 Local. 9 EWRs are tracked. you have Bravo.</prosody></voice>` @ 307750000 (TtsOptions { plaintext: None, srs_client_name: Some("WHEELJACK"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:34.705 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>BUMBLEBEE SAM information Bravo 05 05 Local. 5 EWRs are tracked. you have Bravo.</prosody></voice>` @ 307250000 (TtsOptions { plaintext: None, srs_client_name: Some("BUMBLEBEE"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:34.705 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>RATCHET SAM information Bravo 05 05 Local. 9 EWRs are tracked. you have Bravo.</prosody></voice>` @ 309250000 (TtsOptions { plaintext: None, srs_client_name: Some("RATCHET"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:35.705 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>SLAG SAM information Alpha 05 hundred Local. 3 EWRs are tracked. you have Alpha.</prosody></voice>` @ 309750000 (TtsOptions { plaintext: None, srs_client_name: Some("SLAG"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:36.705 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>All Aircraft, HOUND. Straight Flush 57 is now Alive in South Syria.</prosody></voice>` @ 251000000 (TtsOptions { plaintext: None, srs_client_name: Some("HOUND"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:36.705 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>All Aircraft, HOUND. Straight Flush 57 is now Alive in South Syria.</prosody></voice>` @ 35000000 (TtsOptions { plaintext: None, srs_client_name: Some("HOUND"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:41.891 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>SWOOP SAM information Alpha 05 hundred Local. 1 EWRs are tracked. you have Alpha.</prosody></voice>` @ 308750000 (TtsOptions { plaintext: None, srs_client_name: Some("SWOOP"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:43.108 ERROR   dcs_grpc: failed to deserialize event: deserialize error: missing field `id`
2023-04-08 23:25:43.445 ERROR   dcs_grpc: failed to deserialize event: deserialize error: missing field `id`
2023-04-08 23:25:43.898 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'>This is OPTIMUS. Tall Rack 26 has been destroyed, bullseye One Six Three  72, grid Three Seven Sierra Bravo Tango Six   One.</voice>` @ 306000000 (TtsOptions { plaintext: None, srs_client_name: Some("OPTIMUS"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:44.398 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>All Aircraft, HOUND. Box Spring 24 has been destroyed in Damascus.</prosody></voice>` @ 251000000 (TtsOptions { plaintext: None, srs_client_name: Some("HOUND"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:44.399 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>All Aircraft, HOUND. Box Spring 24 has been destroyed in Damascus.</prosody></voice>` @ 35000000 (TtsOptions { plaintext: None, srs_client_name: Some("HOUND"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:45.772 INFO    dcs_grpc::stats: Calls per second: average=101.06, highest=131.93
2023-04-08 23:25:45.772 INFO    dcs_grpc::stats: Events per second: average=32.34, highest=26.78
2023-04-08 23:25:45.772 INFO    dcs_grpc::stats: Blocking time: total=56.892ms (≙ 0.09%)
2023-04-08 23:25:45.772 INFO    dcs_grpc::stats: Queue size: average=0.00, biggest=0
2023-04-08 23:25:46.901 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>WHEELJACK SAM information Bravo 05 05 Local. 9 EWRs are tracked. you have Bravo.</prosody></voice>` @ 307750000 (TtsOptions { plaintext: None, srs_client_name: Some("WHEELJACK"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:46.902 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>BUMBLEBEE SAM information Bravo 05 05 Local. 5 EWRs are tracked. you have Bravo.</prosody></voice>` @ 307250000 (TtsOptions { plaintext: None, srs_client_name: Some("BUMBLEBEE"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:46.902 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>RATCHET SAM information Bravo 05 05 Local. 9 EWRs are tracked. you have Bravo.</prosody></voice>` @ 309250000 (TtsOptions { plaintext: None, srs_client_name: Some("RATCHET"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:47.904 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>SLAG SAM information Alpha 05 hundred Local. 3 EWRs are tracked. you have Alpha.</prosody></voice>` @ 309750000 (TtsOptions { plaintext: None, srs_client_name: Some("SLAG"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:51.902 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>This is HOUND. Flat Face 39 has been destroyed in South Syria.</prosody></voice>` @ 251000000 (TtsOptions { plaintext: None, srs_client_name: Some("HOUND"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:51.902 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>This is HOUND. Flat Face 39 has been destroyed in South Syria.</prosody></voice>` @ 35000000 (TtsOptions { plaintext: None, srs_client_name: Some("HOUND"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:59.160 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>WHEELJACK SAM information Bravo 05 05 Local. 9 EWRs are tracked. you have Bravo.</prosody></voice>` @ 307750000 (TtsOptions { plaintext: None, srs_client_name: Some("WHEELJACK"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:59.160 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>BUMBLEBEE SAM information Bravo 05 05 Local. 5 EWRs are tracked. you have Bravo.</prosody></voice>` @ 307250000 (TtsOptions { plaintext: None, srs_client_name: Some("BUMBLEBEE"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:59.161 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>RATCHET SAM information Bravo 05 05 Local. 9 EWRs are tracked. you have Bravo.</prosody></voice>` @ 309250000 (TtsOptions { plaintext: None, srs_client_name: Some("RATCHET"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:59.662 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>Attention All Aircraft! This is HOUND. Straight Flush 48 has been destroyed in Damascus.</prosody></voice>` @ 251000000 (TtsOptions { plaintext: None, srs_client_name: Some("HOUND"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:25:59.662 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>Attention All Aircraft! This is HOUND. Straight Flush 48 has been destroyed in Damascus.</prosody></voice>` @ 35000000 (TtsOptions { plaintext: None, srs_client_name: Some("HOUND"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:26:00.163 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>SLAG SAM information Alpha 05 hundred Local. 3 EWRs are tracked. you have Alpha.</prosody></voice>` @ 309750000 (TtsOptions { plaintext: None, srs_client_name: Some("SLAG"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:26:00.662 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'>Attention All Aircraft! This is OPTIMUS. Box Spring 24 has been destroyed, bullseye One Seven Five  77, grid Three Seven Sierra Bravo Sierra Three   Niner.</voice>` @ 306000000 (TtsOptions { plaintext: None, srs_client_name: Some("OPTIMUS"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:26:03.162 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>OPTIMUS SAM information Bravo 05 05 Local. Fan-song 43, Active at Bravo Sierra Four   Niner, accuracy Very High. Fan-song 54, very recent at Bravo Tango Six   Zero, accuracy Very High. Fan-song 45, Active at Bravo Sierra Five   Eight, accuracy Very High. Fan-song 44, very recent at Bravo Sierra Three   Niner, accuracy Very High. Fan-song 52, Active at Bravo Sierra Six   Seven, accuracy Very High. Flat Face 38, Active at Bravo Sierra Five   Eight, accuracy High. Flat Face 39, Active at Bravo Sierra Six   Seven, accuracy Very Low. Flat Face 36, very recent at Bravo Sierra Four   Niner, accuracy Low. Flat Face 37, very recent at Bravo Sierra Three   Niner, accuracy High. Flat Face 40, Active at Bravo Sierra Three   Five, accuracy Low. Flat Face 50, Active at Bravo Tango Three   Zero, accuracy Low. Low Blow 55, Active at Bravo Tango Five   Zero, accuracy Very High. Straight Flush 48, Active at Bravo Sierra Five   Niner, accuracy Very High. Straight Flush 41, relevant at Bravo Sierra Four   Six, accuracy Very High. Straight Flush 56, very recent at Bravo Tango Three   One, accuracy Very High. Straight Flush 46, recent at Bravo Sierra Three   Niner, accuracy Very High. Straight Flush 47, very recent at Bravo Tango Two   Zero, accuracy Very High. 9 EWRs are tracked. you have Bravo.</prosody></voice>` @ 306250000 (TtsOptions { plaintext: None, srs_client_name: Some("OPTIMUS"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:26:06.843 ERROR   dcs_grpc: failed to deserialize event: deserialize error: missing field `id`
2023-04-08 23:26:06.844 WARN    dcs_grpc: Skipping unimplemented event id 37
2023-04-08 23:26:08.163 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>SWOOP SAM information Alpha 05 hundred Local. 1 EWRs are tracked. you have Alpha.</prosody></voice>` @ 308750000 (TtsOptions { plaintext: None, srs_client_name: Some("SWOOP"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:26:11.460 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>WHEELJACK SAM information Bravo 05 05 Local. 9 EWRs are tracked. you have Bravo.</prosody></voice>` @ 307750000 (TtsOptions { plaintext: None, srs_client_name: Some("WHEELJACK"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:26:11.460 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>BUMBLEBEE SAM information Bravo 05 05 Local. 5 EWRs are tracked. you have Bravo.</prosody></voice>` @ 307250000 (TtsOptions { plaintext: None, srs_client_name: Some("BUMBLEBEE"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:26:11.460 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>RATCHET SAM information Bravo 05 05 Local. 9 EWRs are tracked. you have Bravo.</prosody></voice>` @ 309250000 (TtsOptions { plaintext: None, srs_client_name: Some("RATCHET"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })
2023-04-08 23:26:12.457 DEBUG   dcs_grpc::server: TTS from Lua: `<voice gender='female'><prosody rate='1.15'>SLAG SAM information Alpha 05 hundred Local. 3 EWRs are tracked. you have Alpha.</prosody></voice>` @ 309750000 (TtsOptions { plaintext: None, srs_client_name: Some("SLAG"), position: Some(InputPosition { lat: 32.9990036187192, lon: 35.40978959127942, alt: 1292.5196533203125 }), coalition: Some(Blue), provider: None })

@rkusa
Copy link
Collaborator Author

rkusa commented Apr 10, 2023

Rebased to get CI fixes from main

rurounijones
rurounijones previously approved these changes Apr 13, 2023
@rurounijones
Copy link
Contributor

@rkusa Could you resolve conflicts and update the CHANGELOG?

@rurounijones rurounijones merged commit 1f36bea into main Apr 23, 2023
@rurounijones rurounijones deleted the concurrent-win-tts-crash branch April 23, 2023 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants