Thread crash when streaming to chromecast device
The chromecast device shows its connected to rust cast, but the application keeps running/playing on my laptop. The log shows the following thread crash:
DEBUG shortwave::audio::gcast_discoverer > Start discovering for google cast devices...
DEBUG shortwave::audio::gcast_discoverer > Found new google cast device!
DEBUG shortwave::audio::gcast_discoverer > GCastDevice { id: "fb26e505069478db7286147973d9b5da", ip: V4(10.0.0.160), name: "Stue" }
DEBUG shortwave::audio::gcast_discoverer > Found new google cast device!
DEBUG shortwave::audio::gcast_discoverer > GCastDevice { id: "28a88856-b4af-479f-9424-1ca33e9f7d33", ip: V4(10.0.0.131), name: "Hjemme" }
DEBUG shortwave::audio::gcast_discoverer > Found new google cast device!
DEBUG shortwave::audio::gcast_discoverer > GCastDevice { id: "737e36e9791d1974d57f69998884d681", ip: V4(10.0.0.131), name: "Kontor" }
DEBUG shortwave::audio::gcast_discoverer > Found new google cast device!
DEBUG shortwave::audio::gcast_discoverer > GCastDevice { id: "42aedc7da6e7a45f0a7aa97b290b5451", ip: V4(10.0.0.191), name: "Stue" }
DEBUG shortwave::audio::controller::gcast_controller > Called to connect to gcast device...
DEBUG shortwave::audio::controller::gcast_controller > Connect to gcast device with IP "10.0.0.131"...
DEBUG rust_cast > Establishing non-verified connection with cast device at 10.0.0.131:8009...
DEBUG rust_cast > Connection with 10.0.0.131:8009 successfully established.
DEBUG rust_cast::message_manager > Message sent: CastMessage { protocol_version: Some(CASTV2_1_0), source_id: Some("sender-0"), destination_id: Some("receiver-0"), namespace: Some("urn:x-cast:com.google.cast.tp.connection"), payload_type: Some(STRING), payload_utf8: Some("{\"type\":\"CONNECT\",\"userAgent\":\"RustCast\"}"), payload_binary: None, unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 111 } }
DEBUG rust_cast::message_manager > Message sent: CastMessage { protocol_version: Some(CASTV2_1_0), source_id: Some("sender-0"), destination_id: Some("receiver-0"), namespace: Some("urn:x-cast:com.google.cast.tp.heartbeat"), payload_type: Some(STRING), payload_utf8: Some("{\"type\":\"PING\"}"), payload_binary: None, unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 84 } }
DEBUG rust_cast::message_manager > Message sent: CastMessage { protocol_version: Some(CASTV2_1_0), source_id: Some("sender-0"), destination_id: Some("receiver-0"), namespace: Some("urn:x-cast:com.google.cast.receiver"), payload_type: Some(STRING), payload_utf8: Some("{\"requestId\":2,\"type\":\"LAUNCH\",\"appId\":\"CC1AD845\"}"), payload_binary: None, unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 115 } }
DEBUG rust_cast::message_manager > Message received: CastMessage { protocol_version: Some(CASTV2_1_0), source_id: Some("receiver-0"), destination_id: Some("sender-0"), namespace: Some("urn:x-cast:com.google.cast.tp.heartbeat"), payload_type: Some(STRING), payload_utf8: Some("{\"type\":\"PONG\"}"), payload_binary: None, unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 0 } }
DEBUG rust_cast::message_manager > Message received: CastMessage { protocol_version: Some(CASTV2_1_0), source_id: Some("receiver-0"), destination_id: Some("*"), namespace: Some("urn:x-cast:com.google.cast.receiver"), payload_type: Some(STRING), payload_utf8: Some("{\"requestId\":0,\"status\":{\"userEq\":{\"high_shelf\":{\"frequency\":4500.0,\"gain_db\":0.0,\"quality\":0.707},\"low_shelf\":{\"frequency\":150.0,\"gain_db\":0.0,\"quality\":0.707},\"max_peaking_eqs\":0,\"peaking_eqs\":[]},\"volume\":{\"controlType\":\"master\",\"level\":0.10999999940395355,\"muted\":false,\"stepInterval\":0.019999999552965164}},\"type\":\"RECEIVER_STATUS\"}"), payload_binary: None, unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 0 } }
DEBUG rust_cast::message_manager > Message received: CastMessage { protocol_version: Some(CASTV2_1_0), source_id: Some("receiver-0"), destination_id: Some("*"), namespace: Some("urn:x-cast:com.google.cast.receiver"), payload_type: Some(STRING), payload_utf8: Some("{\"requestId\":2,\"status\":{\"applications\":[{\"appId\":\"CC1AD845\",\"displayName\":\"Default Media Receiver\",\"iconUrl\":\"\",\"isIdleScreen\":false,\"launchedFromCloud\":false,\"namespaces\":[{\"name\":\"urn:x-cast:com.google.cast.cac\"},{\"name\":\"urn:x-cast:com.google.cast.debugoverlay\"},{\"name\":\"urn:x-cast:com.google.cast.broadcast\"},{\"name\":\"urn:x-cast:com.google.cast.media\"}],\"sessionId\":\"1f8b6290-f1fb-4568-8a62-01cfceadf725\",\"statusText\":\"Default Media Receiver\",\"transportId\":\"1f8b6290-f1fb-4568-8a62-01cfceadf725\"}],\"userEq\":{\"high_shelf\":{\"frequency\":4500.0,\"gain_db\":0.0,\"quality\":0.707},\"low_shelf\":{\"frequency\":150.0,\"gain_db\":0.0,\"quality\":0.707},\"max_peaking_eqs\":0,\"peaking_eqs\":[]},\"volume\":{\"controlType\":\"master\",\"level\":0.10999999940395355,\"muted\":false,\"stepInterval\":0.019999999552965164}},\"type\":\"RECEIVER_STATUS\"}"), payload_binary: None, unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 0 } }
DEBUG rust_cast::message_manager > Message sent: CastMessage { protocol_version: Some(CASTV2_1_0), source_id: Some("sender-0"), destination_id: Some("1f8b6290-f1fb-4568-8a62-01cfceadf725"), namespace: Some("urn:x-cast:com.google.cast.tp.connection"), payload_type: Some(STRING), payload_utf8: Some("{\"type\":\"CONNECT\",\"userAgent\":\"RustCast\"}"), payload_binary: None, unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 137 } }
DEBUG shortwave::audio::controller::gcast_controller > Connected to gcast device!
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /build/rust/src/rustc-1.41.0-src/src/libcore/macros/mod.rs:15:40
stack backtrace:
0: 0x56506e6e2fd4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7b11b2a23cd910b3
1: 0x56506e70682c - core::fmt::write::hca7efce6c0791439
2: 0x56506e6dd8c7 - std::io::Write::write_fmt::he56b7f6fb86cf3b5
3: 0x56506e6e572e - std::panicking::default_hook::{{closure}}::hf51e7f0a7424f5cd
4: 0x56506e6e5421 - std::panicking::default_hook::he8ba9c8182908cf7
5: 0x56506e6e5e0b - std::panicking::rust_panic_with_hook::hf9a08396e191b616
6: 0x56506e6e59be - rust_begin_unwind
7: 0x56506e7026ee - core::panicking::panic_fmt::h1ec1b70c49f8bf0e
8: 0x56506e70263a - core::panicking::panic::hb62b3816d7e34515
9: 0x56506de8d9af - core::option::Option<T>::unwrap::h15d37fba56f20d40
at /build/rust/src/rustc-1.41.0-src/src/libcore/macros/mod.rs:15
10: 0x56506df1276e - shortwave::audio::controller::gcast_controller::GCastController::start_thread::{{closure}}::{{closure}}::h3acbd7f2e8cb2346
at src/audio/controller/gcast_controller.rs:88
11: 0x56506de81661 - core::option::Option<T>::map::h1de4cd3a7fd0a451
at /build/rust/src/rustc-1.41.0-src/src/libcore/option.rs:450
12: 0x56506df15a1e - shortwave::audio::controller::gcast_controller::GCastController::start_thread::{{closure}}::h8e59fbb9a56b33b1
at src/audio/controller/gcast_controller.rs:87
13: 0x56506df2ee82 - std::sys_common::backtrace::__rust_begin_short_backtrace::hbc12d6baf17f5fae
at /build/rust/src/rustc-1.41.0-src/src/libstd/sys_common/backtrace.rs:136
14: 0x56506dedadf2 - std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}::h8e16caa3de650f25
at /build/rust/src/rustc-1.41.0-src/src/libstd/thread/mod.rs:469
15: 0x56506df2ec60 - <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h16dfe27b9a91bc8e
at /build/rust/src/rustc-1.41.0-src/src/libstd/panic.rs:318
16: 0x56506df4ed4e - std::panicking::try::do_call::h9c046afee4ce9f62
at /build/rust/src/rustc-1.41.0-src/src/libstd/panicking.rs:292
17: 0x56506e6efa2a - __rust_maybe_catch_panic
18: 0x56506df4e6be - std::panicking::try::h44930e9d6547d76e
at /build/rust/src/rustc-1.41.0-src/src/libstd/panicking.rs:270
19: 0x56506df2ed32 - std::panic::catch_unwind::h27f34f9accf49375
at /build/rust/src/rustc-1.41.0-src/src/libstd/panic.rs:394
20: 0x56506dedabbe - std::thread::Builder::spawn_unchecked::{{closure}}::h8034e29198c6207e
at /build/rust/src/rustc-1.41.0-src/src/libstd/thread/mod.rs:468
21: 0x56506ddeda23 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hf1dc4794d77e0fd0
at /build/rust/src/rustc-1.41.0-src/src/libcore/ops/function.rs:232
22: 0x56506e6d636f - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::hb2fd1530f488d589
23: 0x56506e6eeae0 - std::sys::unix::thread::Thread::new::thread_start::h3f75a3f23d28c926
24: 0x7fdd8332246f - start_thread
25: 0x7fdd832363d3 - clone
26: 0x0 - <unknown>