dheijl / swyh-rs

Stream What You Hear written in rust, inspired by SWYH.
MIT License
309 stars 14 forks source link

SWYH-SSDP Maximum Interval Question #136

Closed omoknen closed 1 month ago

omoknen commented 1 month ago

Sonos is making things hard with the new application, and I have to use another application to get my music to my speakers and play it synchronized. I am using the application Tuneblade (Airplay On Windows) to the speakers, and they are really going away from custom URLs of any sort I believe. I don't think Sonos software upgrades will change that eventuality. I still use the SWYH for my husband's android phone.

As I don't need the SSDP right now, I would like to make the SSDP Interval quite long because the Sonos is making its speakers act really weird right now. What is a safe long interval I could change it to in the configuration file.

Thank you

dheijl commented 1 month ago

There is no real limit, if you don't need it you can set it to a real high value. If you use the CLI version of swyh-rs with the -x argument there will be no ssdp at all.

omoknen commented 1 month ago

Thank you. At least I have options that some others don't on Sonos, but their courageous new app (not alpha quality release) is going to set users off for probably months (they said mid June - ha ha). I will try the command line version. I think maybe I can come up with something.

omoknen commented 1 month ago

I did get a batch script working. I misunderstood what -n option did it really only created the configuration file.

Everything works but, I saw something slightly strange.

swyh-rs-cli.exe -p 5901 -l info -s 0 -r false -S true -x true -b 16 -f wav +U32maxNotChunked -o 192.168.254.50

I know "auto reconnect" is not an option, but even when I set "auto reconnect" to false in the config file it resets it at the end. Do I need to set the config file to "read_only" to true?

Console Output

Args { dry_run: None, config_id: None, server_port: Some(5901), auto_resume: Some(false), sound_source_index: Some(0), sound_source_name: None, log_level: Some(Info), ssdp_interval_mins: None, use_wave_format: Some(true), bits_per_sample: Some(16), streaming_format: Some(Wav), stream_size: None, player_ip: Some("192.168.254.50"), ip_address: None, active_players: Some(["192.168.254.50"]), inject_silence: Some(true), serve_only: Some(true), volume: None, upfront_buffer: None }

ARG override configfile (-C): None Loading config from C:\Users\Radio.swyh-rs\config_cli.toml Loaded configuration -c _cli Current config: Configuration { server_port: Some(5901), auto_resume: false, sound_source: Some("CABLE Input (VB-Audio Virtual Cable)"), sound_source_index: Some(0), log_level: Info, ssdp_interval_mins: 10.0, _autoreconnect: false, _disable_chunked: true, lpcm_stream_size: Some(U64maxNotChunked), wav_stream_size: Some(U32maxNotChunked), rf64_stream_size: Some(U64maxNotChunked), flac_stream_size: Some(U64maxNotChunked), use_wave_format: true, bits_per_sample: Some(16), streaming_format: Some(Wav), monitor_rms: false, capture_timeout: Some(2000), inject_silence: Some(true), buffering_delay_msec: Some(0), last_renderer: Some("192.168.254.65"), active_renderers: [], last_network: Some("192.168.254.50"), config_dir: "C:\Users\Radio\.swyh-rs", config_id: Some("_cli"), read_only: false } 20:38:12 [INFO] SWYH-RS-CLI V 1.10.5 - Running on x86_64, windows, windows - Logging started. 20:38:12 [INFO] tb_log: Found Audio Source: index = 0, name = CABLE Input (VB-Audio Virtual Cable) 20:38:12 [INFO] tb_log: Selected audio source: CABLE Input (VB-Audio Virtual Cable)[#0] 20:38:12 [INFO] tb_log: Found Audio Source: index = 1, name = Speakers (Realtek(R) Audio) 20:38:12 [INFO] tb_log: Found Audio Source: index = 2, name = CABLE Output (VB-Audio Virtual Cable) 20:38:12 [INFO] tb_log: Found Audio Source: index = 3, name = Microphone (Realtek(R) Audio) 20:38:12 [INFO] tb_log: Found network: 192.168.254.50 20:38:12 [INFO] tb_log: Found network: 127.0.0.1 20:38:12 [INFO] Using network 192.168.254.50 20:38:12 [INFO] tb_log: Now running at ABOVE_NORMAL_PRIORITY_CLASS 20:38:12 [INFO] tb_log: Capturing audio from: CABLE Input (VB-Audio Virtual Cable) 20:38:12 [INFO] tb_log: Default audio SupportedStreamConfig { channels: 2, sample_rate: SampleRate(44100), buffer_size: Range { min: 0, max: 4294967295 }, sample_format: F32 } 20:38:12 [INFO] tb_log: Injecting silence into the output stream 20:38:12 [INFO] tb_log: The wave_reader is now receiving samples 20:38:12 [INFO] tb_log: The streaming server is listening on http://192.168.254.50:5901/stream/swyh.wav 20:38:12 [INFO] tb_log: Streaming sample rate: 44100, bits per sample: 16, format: Wav 20:38:12 [INFO] New config: Configuration { server_port: Some(5901), auto_resume: false, sound_source: Some("CABLE Input (VB-Audio Virtual Cable)"), sound_source_index: Some(0), log_level: Info, ssdp_interval_mins: 10.0, _autoreconnect: true, _disable_chunked: true, lpcm_stream_size: Some(U64maxNotChunked), wav_stream_size: Some(U32maxNotChunked), rf64_stream_size: Some(U64maxNotChunked), flac_stream_size: Some(U64maxNotChunked), use_wave_format: true, bits_per_sample: Some(16), streaming_format: Some(Wav), monitor_rms: false, capture_timeout: Some(2000), inject_silence: Some(true), buffering_delay_msec: Some(0), last_renderer: Some("192.168.254.50"), active_renderers: ["192.168.254.50"], last_network: Some("192.168.254.50"), config_dir: "C:\Users\Radio\.swyh-rs", config_id: Some("_cli"), read_only: false } 20:38:12 [INFO] tb_log: Serving started on port 5901...

Thank you

dheijl commented 1 month ago

I would say it's a bug. Before "-x" was added, autoreconnect was always forced true to start streaming if at all possible. After introducing "-x" this was no longer relevant and even not evaluated if -x was present, but the "force true" was never removed. Also, with -x the -o option serves no real purpose. Thanks for the heads-up!

dheijl commented 1 month ago

fixed for the next release.

dheijl commented 1 month ago

Fixed in current release.