Just found out that if I don’t share the same fuse or electrical socket for the pi and the speakers, my audio considerably better.
Does this work for us that runs HA on a NUC ?
it doesn’t work even on a Pi xD
It should, the docker images are compiled for all the supported platforms.
Strong statement, there. It doesn’t work on your RPi. Are you sure it’s not something with your setup?
But I run the NUC imagae not docker.
Docker is also used internally by Hassio to run add-ons
works on my pi, sometimes the audio is bad but a ha restart fix it
Hi @giannello! Thank you so much for the work! I came upon your add-on after having the bad audio issue with the Spotify connect. Configured it within 1 minute and the magic started!
I would have one question, since you integrated the entity “hack”: is there a way I can control the play/pause or even more of the player? My end goal is to tell Google home to play music on HomeAssistant. I’m not asking to have Google Assistant recognising the Spotify connect as a speaker of course, but if I could control play/pause I could pack it in a script and bind the script to a custom routine in Google home
Hi @Doudou, at the moment I have no plans to do that, due to limited time.
It’s necessary to check 1) whether librespot supports receiving commands through some kind of API/RPC and 2) figure out how to expose those as a service (I think - still have to fully understand the internals of homeassistant). On top of this, @frenck has some strong opinions on whether this is the right approach, and maybe he can recommend a better long-term approach.
If somebody wants to take over from there, I can give contributor access to the repo.
Hi @giannello, thank you for your reply! Unfortunately I’m running into the same issue as before, sound very slow and bad. I tried restarting home assistant, restarting the plugin, changing output, but nothing does I also have nothing in the logs. This is my config:
name: HomeAssistant
bitrate: 320
create_entity: true
device_type: speaker
Would you have any idea? Thanks a lot!
do you have the same issue using the official spotify add-on? what kind of audio output do you use?
please also check not only the add-on logs, but also system logs, especially the “audio” log
After restarting the Pi I finally get logs in the add-on:
ALSA lib pcm_pulse.c:752:(pulse_prepare) PulseAudio: Unable to create stream: No such entity
thread '<unnamed>' panicked at 'hardware params could not be set: "I/O error"', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/cpal-0.8.2/src/alsa/mod.rs:805:5
stack backtrace:
0: 0x5580bea360 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3b474b474b5e10ff
1: 0x5580c12960 - core::fmt::write::h50f911cdcf31c1b9
2: 0x5580be3e2c - std::io::Write::write_fmt::h9ea9e4f82760f271
3: 0x5580bdaa60 - std::panicking::default_hook::{{closure}}::h1934eafdf58c2b16
4: 0x5580bda788 - std::panicking::default_hook::hff71e455f1760e76
5: 0x5580bdb0d4 - std::panicking::rust_panic_with_hook::hd386d1405383a79a
6: 0x5580bdacec - rust_begin_unwind
7: 0x5580c12090 - core::panicking::panic_fmt::h8c74e424078ffa30
8: 0x5580c0f39c - core::result::unwrap_failed::h8e7b5c828d31509e
9: 0x55808dee54 - cpal::cpal_impl::set_hw_params_from_format::h6034494c7380bbde
10: 0x55808de71c - cpal::cpal_impl::EventLoop::build_output_stream::hf76047d3e8253e18
11: 0x55808d8000 - rodio::engine::new_output_stream::ha09b262c673ade7d
12: 0x55808c7c58 - rodio::engine::play_raw::hf2b896d06ba3490f
13: 0x55808b883c - <librespot_playback::audio_backend::rodio::RodioSink as librespot_playback::audio_backend::Open>::open::hfd959d4dddd35372
14: 0x55808cd8d8 - librespot_playback::audio_backend::mk_sink::h6a9aeac21c2b7351
15: 0x558081dc24 - std::sys_common::backtrace::__rust_begin_short_backtrace::ha8994faf212112e7
16: 0x55808330a0 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h4c6e8156cbc0e924
17: 0x5580bddf94 - std::sys::unix::thread::Thread::new::thread_start::h77a992904f18c5b3
18: 0x7f9e2fca60 - <unknown>
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: SendError("...")', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/librespot-playback-0.1.3/src/player.rs:277:9
stack backtrace:
0: 0x5580bea360 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3b474b474b5e10ff
1: 0x5580c12960 - core::fmt::write::h50f911cdcf31c1b9
2: 0x5580be3e2c - std::io::Write::write_fmt::h9ea9e4f82760f271
3: 0x5580bdaa60 - std::panicking::default_hook::{{closure}}::h1934eafdf58c2b16
4: 0x5580bda788 - std::panicking::default_hook::hff71e455f1760e76
5: 0x5580bdb0d4 - std::panicking::rust_panic_with_hook::hd386d1405383a79a
6: 0x5580bdacec - rust_begin_unwind
7: 0x5580c12090 - core::panicking::panic_fmt::h8c74e424078ffa30
8: 0x5580c0f39c - core::result::unwrap_failed::h8e7b5c828d31509e
9: 0x55808ab91c - librespot_playback::player::Player::load::h952d556bdf3cdc82
10: 0x5580873934 - librespot_connect::spirc::SpircTask::load_track::h9acc939bdeec7f61
11: 0x55808708cc - <librespot_connect::spirc::SpircTask as futures::future::Future>::poll::h3e0e98b9c59fc39f
12: 0x558082f448 - <librespot::Main as futures::future::Future>::poll::h99aedbd929e4b2c9
13: 0x558083477c - futures::task_impl::std::set::hd9913464b1175215
14: 0x5580834b28 - <futures::future::lazy::Lazy<F,R> as futures::future::Future>::poll::h2c0b2647bad703d9
15: 0x5580834624 - futures::task_impl::std::set::hb7e2f9dfd47a5acb
16: 0x558081a1d0 - std::thread::local::LocalKey<T>::with::h908b6c73d9f7478e
17: 0x5580818f44 - tokio_current_thread::Entered<P>::block_on::h2860026547a040b8
18: 0x5580835e10 - tokio_timer::timer::handle::with_default::hb876c3d4ea570e1d
19: 0x558081a2b4 - std::thread::local::LocalKey<T>::with::hb3c8523433b72a96
20: 0x558081631c - scoped_tls::ScopedKey<T>::set::h3aa757463505765d
21: 0x558081cb40 - tokio_core::reactor::Core::run::h8ce020e5d8bce4c9
22: 0x5580831960 - librespot::main::h376a180ed710fffa
23: 0x558083295c - std::rt::lang_start::{{closure}}::hbade998e43c45ebe
24: 0x5580bdb3b4 - std::rt::lang_start_internal::h8ca08882543027bf
25: 0x558083276c - main
26: 0x7f9e2c277c - <unknown>
[2021-01-23T16:50:28Z ERROR librespot_playback::player] Player thread panicked!
[17:50:28] INFO: Starting the librespot daemon...
Do you have any idea which direction to search?
EDIT: Nevermind, I uninstalled the plugin, reinstalled, pasted the config, started the plugin, and everything back to normal sorry for taking your time!
Weird. The add-on doesn’t have much of a choice when it comes to selecting an audio device - the system takes care of that via some pulseaudio trickery.
I don’t think this issue is related to the add-on.
Hi, I have a few questions:
- Spotify Connect plays 5-10 tracks and stops, problem like similar to January 17th issue. create_entity: True is present, the add-on was removed and reinstalled - it does not help. What can be wrong?
- I am using USB DSP on ADAU1467, I can’t say the sound is bad, but it looks like a 96kbps mp3 instead of the 320kbps set. This is also true for ASUS USB DACs.
- If someone knows how to connect ADAU1467 directly to Raspberry via i2s?
Anything in the logs? Also, when looking at the logs, pay attention to timestamps, in case the add-on is restarted.
Thank you for this Add-on. I have moved from “official” one since there was terrible sound distortion on it.
Now, I can play and all seem to work very well, except… I cannot see full Configuration section in full. Only Audio selection is possible:
Any ideas why is that and how can I make full Configuration to appear ?
Thanks for the github issue @Maco65. It’s now fixed, hit “Reload” in the add-on store, uninstall/install again.
Excellent. Done and all is working fine !
THANK You !