I run the snapcast server on a different RPi with Rapsbian. If I want to use LibreELEC as a Snapcast Client I always have to ssh "snapclient -h 192.168.188.46"
Can you tell me how I can configure the client to use this Snapcast server permanent?
Which version of LibreELEC/Snapclient are you using?
What does the log say (journalctl -u service.snapclient)?
Here, Snapclient starts with LibreELEC.
I am not aware that it is possible to install addons otherwise than through Kodi user interface, ie with the remote.
htop comes with the System Tools addon, which is a collection of programs which do not interface with Kodi. To use htop, ssh into LibreELEC and type htop.
tinc uses and provides miniupnpc libraries. If you need more, eg the cli, you will have to build it yourself.
And if you set "wait for network" in Settings/LibreELEC/Network?
I have tested 109b (from your link) as well as version 110 from libreelec-repo on my fresh installed LE9 Milhouse build (from april 1st and april 2nd). Each combination doesn't work for me: my spotify-app doesn't see the device. The dependencies-section says: os.libreelec.tv is unavailable.
I have activated logging and then uninstalled and reinstalled the plugin. Hopefully the log is useful. (In the log, os.libreelec.tv is shown as loaded.)
Please provide a log produced with "journalctl -u service.librespot"
after I reinstalled the Raspberry Pi 3 and installed Librespot, I am not able to select the device. I got an other Spotify Connect Add On already, but its not that good like the Librespot.
I hope that you can help me with that problem.
edit: on mobile it says "connecting" and than it diappears.
Please provide a log produced with "journalctl -u service.librespot"
I've been looking and I did not find any environment variable that defines the location of alsa plugins either. That's unfortunate.
I thought there was a possibility to specify plugin locations via asoundrc or asound.conf but I misremembered. While you can set the location of LADSPA plugins in asound.conf and specify their location via a variable called LADSPA_PATH there is no way to do this for alsa plugins.
Having the alsa plugins in LibreELEC would be really cool though. We'd be able to use alsa's 'file' plugin to write audio to the snapserver fifo instead of using pulseaudio. For playback we could use the alsa 'dmix' plugin to have snapclient play through alsa while at the same time not blocking the output device for Kodi. We'd be using snapcast as it is intended to be used by badaix, running on alsa. As there is no native pulseaudio support snapcast can manage latency for raw alsa devices but not for pulseaudio.
A benefit of using alsa directly would be that we would not have to set the snapclient's '--latency=xy' parameter to offset the latency that is introduced by pulseaudio (which is a unique value for every output device and cannot be statically defined for all systems and devices).
The drawback would be that pulseaudio would still be required for playout of snapclient to bluetooth devices. Also setting the latency parameter would be required for synchronous playback. But since bluetooth playback itself introduces considerable latency, the latency parameter would have to be used to account for this anyway.
I have reworked the alsa-plugin package to only build pulse in less than 100KB. I will submit a PR when it is ready.
I will think about how to go forward with Snapcast and Librespot during the next days, and propose it here.
At a glance, output to pulse and being able to control Snapserver via RPC from Kodi, at least to select a stream and set volume would allow to simplify a lot of things.
meh... with the above Alsa creates the device but cannot open it, due to : (snd1_dlobj_cache_get) Cannot open shared library /usr/lib/alsa/libasound_module_pcm_pulse.so.
No idea if it is possible to have Alsa search plugins in LD_LIBRARY_PATH.
Amazing progress guys!
There is no need to add the libraries to the image. Simply add them to a directory in LD_LIBRARY_PATH and edit /storage/.config/asound.conf to use them.
I will add pulse to Snapclient, because there is a use case. I let someone else add all or the rest to the audio-tools addon.
Please discuss the pulse with Snapclient use case in the Snapcast thread, so that everyone can share without searching much.
on PC it works just fine - here I have a output like this:
Playback/recording through the PulseAudio sound server
Discard all samples (playback) or generate zero samples (capture)
PulseAudio Sound Server
If I select 0 here, snapclient just routes the audio to pulseaudio like any other client on the pc.
I think there's probably the pulseaudio library missing in the snapclient addon for libreelec, so that it doesn't find the pulseaudio of libreelec?
Also - of course kodi "holds" the pulseaudio speaker, but there is running a pulseaudio server which is used by kodi - snapclient should just output to that pulseaudio server as a source - just like it does on a desktop
Or maybe - if for some reason that's not possible - is it possible that snapclient just outputs to "kodi" - like librespot does? that way it would just use whatever source is used in kodi, or is that not possible due to the syncing?
By default there is no asound.conf in LibreELEC. You could try to create /storage/.config/asound.conf to create a pulse output. You will have to reboot LibreELEC for ALSA to pick up that asound.conf.
According to what I found /storage/.config/asound.conf should be:
Let me know if it works
I have a bluetooth Receiver on one of my libreelec devices (milhouse 9 build) - How can I make snapclient on this device play to the bluetooth device? Everything else on this device plays to bluetooth without issues
System Audio is set to "PULSE: (SPEAKERNAME)"
"snapclient -l" on ssh also only delivers the ALSA devices, no pulseaudio device
Snapclient outputs to ALSA, not to Pulseaudio.
What you are trying to do is therefore not possible at the moment.
Moreover, I suspect that Kodi holds the Pulseaudio speaker, and that Snapclient will not be able to share it.
Maybe someone else here has an idea of how this could be implemented, and wants to give it a shot.
i have updated librelec and i got snapserver/snapclient in librelec addons and install in my librelec 8.2.4 .what is the next step could i do.
Use a mobile device to stream to Snapcast with Airplay
Hello awiouy! First of all thank you for the work you are doing to get snapcast integrated into LibreELEC. It's really awesome!
You mentioned that sound quality is inferior when using snapserver with Kodi and pulseaudio. I have been experimenting with snapcast a lot and I think I have a solution: In 'Settings' > 'System' you can set 'Output configuration' to 'Fixed'. Then set 'Limit sampling rate kHz' to '48.0'. Then set 'Resample quality' to 'High'.
Sound quality should be better now as Kodi handles resampling the audio to 48kHz in high quality instead of leaving this task to pulseaudio.
You could also leave the settings in Kodi alone and make pulseaudio use a better resampler:
With pulseaudio I usually set it to use the 'sox-vhq' resampler, this also sounds very good. I don't think there's a huge difference between Kodi's high quality resampler and pulseaudio's 'sox-vhq'.
About A/V sync: You can easily get perfect sync across all snapclients. Just play a video and then go into the settings menu, then choose 'Audio settings' and then select 'Audio offset'. Set this to 'Ahead by 1.000s' and all your snapclients will be in sync with the video playback. No further configuration is needed on the clients this way.
Thank you for this information:
1. resample-method = soxr-vhq in /storage/.config/pulse-daemon.conf.d/10-snapserver.conf improves sound quality
2. Setting Audio offset to Ahead by 1.000s easily achieves audio/video synchronisation
I will see if I can add both to snapserver (and librespot)
In the meantime both can be done manually
I attach updated previews for RPi2