Ulrar / hassio-addons

Repo for hassio addons
MIT License
23 stars 10 forks source link

Pipe needs to exist for Raspotify addon? #7

Closed marecabo closed 4 years ago

marecabo commented 4 years ago

Thanks a lot for the hint on using Raspotify with a pipe to Forked-DAAPD. Finally multiroom audio from Spotify! 🥳 Now I just need multiple rooms...

Anyway, I noticed that the pipe needs to exist and does not get created when launching Raspotify for the first time, else this error comes up:

Long Error Log ``` [15:21:54] INFO: Starting the raspotify Server... [2020-06-07T13:22:35Z INFO librespot] librespot (raspotify v0.14.0) 3672214 (2020-01-30). Built on 2020-02-16. Build ID: 7pZDdYUK [2020-06-07T13:22:36Z INFO librespot_core::session] Connecting to AP "gew1-accesspoint-b-zqpq.ap.spotify.com:4070" [2020-06-07T13:22:37Z INFO librespot_core::session] Authenticated as "***" ! thread '' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1188:5 stack backtrace: [2020-06-07T13:22:38Z INFO librespot_core::session] Country: "**" 0: 0x9513a4 - backtrace::backtrace::libunwind::trace::hb1e9954dcc6e7c1f at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88 1: 0x9513a4 - backtrace::backtrace::trace_unsynchronized::h1b198a73034a9734 at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66 2: 0x9513a4 - std::sys_common::backtrace::_print_fmt::hf691518b63d0b79d at src/libstd/sys_common/backtrace.rs:84 3: 0xae13a4 - ::fmt::he6a16924c7e1913e at src/libstd/sys_common/backtrace.rs:61 4: 0xb03ca4 - core::fmt::write::hc426988e4c4119a8 at src/libcore/fmt/mod.rs:1025 5: 0xadbff0 - std::io::Write::write_fmt::h34e90dde595ba7cd at src/libstd/io/mod.rs:1426 6: 0xae3954 - std::sys_common::backtrace::_print::h406863a8800396cd at src/libstd/sys_common/backtrace.rs:65 7: 0xae3954 - std::sys_common::backtrace::print::hec570bc9fdd6a536 at src/libstd/sys_common/backtrace.rs:50 8: 0xae3954 - std::panicking::default_hook::{{closure}}::hf187be78db8e291b at src/libstd/panicking.rs:193 9: 0xae35b4 - std::panicking::default_hook::h9634e45fc0d61ba6 at src/libstd/panicking.rs:210 10: 0xae4030 - std::panicking::rust_panic_with_hook::h35923fdea5783220 at src/libstd/panicking.rs:471 11: 0xae3c48 - rust_begin_unwind at src/libstd/panicking.rs:375 12: 0xaffac0 - core::panicking::panic_fmt::hd74e307162bc16e5 at src/libcore/panicking.rs:84 13: 0xaffbac - core::result::unwrap_failed::h36f73057b442c0eb at src/libcore/result.rs:1188 14: 0x6ae378 - ::open::hba99211ee8370642 15: 0x6c3308 - librespot_playback::audio_backend::mk_sink::hdcb616e92333a609 16: 0x6042e4 - std::sys_common::backtrace::__rust_begin_short_backtrace::h7c6871de616d8893 17: 0x5ff78c - std::panicking::try::do_call::hac2a3db38490f7c2 18: 0xaeb220 - __rust_maybe_catch_panic at src/libpanic_unwind/lib.rs:78 19: 0x620200 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h39f2cbdbe410812b 20: 0xad4790 - as core::ops::function::FnOnce>::call_once::hc0d20dd2593d70b4 at /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8/src/liballoc/boxed.rs:1022 21: 0xaea3e4 - as core::ops::function::FnOnce>::call_once::h81836ca2a42ca881 at /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8/src/liballoc/boxed.rs:1022 22: 0xaea3e4 - std::sys_common::thread::start_thread::hdbf450a6e252329e at src/libstd/sys_common/thread.rs:13 23: 0xaea3e4 - std::sys::unix::thread::Thread::new::thread_start::h5823a94baad158fb at src/libstd/sys/unix/thread.rs:80 thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', src/libcore/result.rs:1188:5 stack backtrace: 0: 0xae13a4 - backtrace::backtrace::libunwind::trace::hb1e9954dcc6e7c1f at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88 1: 0xae13a4 - backtrace::backtrace::trace_unsynchronized::h1b198a73034a9734 at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66 2: 0xae13a4 - std::sys_common::backtrace::_print_fmt::hf691518b63d0b79d at src/libstd/sys_common/backtrace.rs:84 3: 0xae13a4 - ::fmt::he6a16924c7e1913e at src/libstd/sys_common/backtrace.rs:61 4: 0xb03ca4 - core::fmt::write::hc426988e4c4119a8 at src/libcore/fmt/mod.rs:1025 5: 0xadbff0 - std::io::Write::write_fmt::h34e90dde595ba7cd at src/libstd/io/mod.rs:1426 6: 0xae3954 - std::sys_common::backtrace::_print::h406863a8800396cd at src/libstd/sys_common/backtrace.rs:65 7: 0xae3954 - std::sys_common::backtrace::print::hec570bc9fdd6a536 at src/libstd/sys_common/backtrace.rs:50 8: 0xae3954 - std::panicking::default_hook::{{closure}}::hf187be78db8e291b at src/libstd/panicking.rs:193 9: 0xae35b4 - std::panicking::default_hook::h9634e45fc0d61ba6 at src/libstd/panicking.rs:210 10: 0xae4030 - std::panicking::rust_panic_with_hook::h35923fdea5783220 at src/libstd/panicking.rs:471 11: 0xae3c48 - rust_begin_unwind at src/libstd/panicking.rs:375 12: 0xaffac0 - core::panicking::panic_fmt::hd74e307162bc16e5 at src/libcore/panicking.rs:84 13: 0xaffbac - core::result::unwrap_failed::h36f73057b442c0eb at src/libcore/result.rs:1188 14: 0x6a7e34 - librespot_playback::player::Player::load::h473baeba93a49d56 15: 0x6686ec - librespot_connect::spirc::SpircTask::load_track::ha5e63470cf57912f 16: 0x6655e4 - ::poll::hb573aef2426969ea 17: 0x618374 - ::poll::h39e6051da7010f1e 18: 0x5ffc40 - futures::task_impl::std::set::h4e51aae067d11534 19: 0x61eb58 - as futures::future::Future>::poll::h621a887d6837858e 20: 0x5ffdd0 - futures::task_impl::std::set::h63a28574c80b5637 21: 0x5fe060 - std::thread::local::LocalKey::with::hd47ca4d010c74fa6 22: 0x5fdd90 - std::thread::local::LocalKey::with::ha85a14e62c57594b 23: 0x5fdbe8 - std::thread::local::LocalKey::with::h04965b1b1c7a9048 24: 0x5fc3e4 - scoped_tls::ScopedKey::set::hc4c1edb96d8883ef 25: 0x6031a0 - tokio_core::reactor::Core::run::hffdc295949f1f25a 26: 0x61ade4 - librespot::main::h0ed06a728ac2479f 27: 0x61c980 - std::rt::lang_start::{{closure}}::h3ecc962e3fb4564b 28: 0xae3ac4 - std::rt::lang_start_internal::{{closure}}::hc02935a73664ebd0 at src/libstd/rt.rs:52 29: 0xae3ac4 - std::panicking::try::do_call::h9ca5184b6b3cc62d at src/libstd/panicking.rs:292 30: 0xaeb220 - __rust_maybe_catch_panic at src/libpanic_unwind/lib.rs:78 31: 0xae4484 - std::panicking::try::hc53e4a11b02f3299 at src/libstd/panicking.rs:270 32: 0xae4484 - std::panic::catch_unwind::ha972c7f8a413a94c at src/libstd/panic.rs:394 33: 0xae4484 - std::rt::lang_start_internal::hdf6cc497202d2594 at src/libstd/rt.rs:51 34: 0x61bdc4 - main 35: 0xf7a44524 - __libc_start_main [2020-06-07T13:22:39Z ERROR librespot_playback::player] Player thread panicked! [15:22:39] INFO: Starting the raspotify Server... [2020-06-07T13:22:39Z INFO librespot] librespot (raspotify v0.14.0) 3672214 (2020-01-30). Built on 2020-02-16. Build ID: 7pZDdYUK [2020-06-07T13:22:39Z INFO librespot_core::session] Connecting to AP "gew1-accesspoint-b-kwbv.ap.spotify.com:4070" [2020-06-07T13:22:39Z ERROR librespot] Could not connect to server: bytes remaining on stream ```

Fortunately, I could resolve it by executing

mkfifo -m 666 /share/forked-daapd/music/Raspotify

similar to L21 from a shell of the Forked-DAAPD addon.

Did the piping work for you without initially creating that file? 🤔

Ulrar commented 4 years ago

Glad to hear it's being used and works, and thanks for all the PRs by the way ! I also have a shairport-sync one I haven't pushed because I ended up going with raspotify, if that's of any interest I could push it. A bit annoying to use from android, raspotify is much nicer imho but for iOS users that might be a nice alternative.

Ah, I forgot about the pipe, I did have to create it the first time indeed. Not sure what would be the best way to handle that, maybe have explicit backend options (instead of the generic one) and if pipe is enabled have the startup script check that it exists or create it ?

marecabo commented 4 years ago

Shairport-sync is for receiveing audio via Airplay (e.g. from Forked-DAAPD or an iOS device) in order to play it on the home Assistant host? Personally, I do not have any iOS devices, but i think, that users finding your Forked-DAAPD add-on likely also could be interested in it, especially, if it works already. It would fit into your collection of audio add-ons.

I started to write some config handling regarding the pipe handling and will make another pr soon. Maybe you could also test, whether the pipe creation/reuse works for you?

Ulrar commented 4 years ago

Just tested it, works great. I merged the PR #8, again thanks for all the help here, it's really starting to look good !