app/
main.rs

1#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
2
3fn main() {
4
5    #[cfg(target_os = "linux")]
6    {
7        // === Web Audio Freeze Fix for ALSA Environment ===
8        
9        // ✓ WebKit rendering optimizations (verified)
10        std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
11        std::env::set_var("WEBKIT_DISABLE_COMPOSITING_MODE", "1");
12        
13        // ✓ GStreamer settings (verified)
14        std::env::set_var("GST_DEBUG", "2");
15        // Avoid demoting mpegaudioparse; doing so muted audio in some games.
16        // Leave feature ranks default unless debugging decoder selection.
17        std::env::set_var("WEBKIT_GST_DMABUF_SINK_DISABLED", "1");
18        
19        // ✓ PulseAudio settings (timing synchronization)
20        // std::env::set_var("PULSE_LATENCY_MSEC", "100");
21        // std::env::set_var("ALSA_CARD", "default");
22        
23        // Note: GStreamer uses GST_AUDIO_SINK but alsasink properties are set via element properties
24        // not environment variables. Buffer/latency settings need to be configured in GStreamer pipeline.
25        
26        // Disable sandbox for debugging (REMOVE in production!)
27        // std::env::set_var("WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS", "1");
28    }
29
30    app_lib::run();
31}