Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snapcast: add streaming from kodi #2597

Merged
merged 2 commits into from
Apr 10, 2018
Merged

Conversation

awiouy
Copy link
Collaborator

@awiouy awiouy commented Mar 18, 2018

No description provided.

@awiouy
Copy link
Collaborator Author

awiouy commented Mar 21, 2018

To stream from Kodi:

  1. In Add-ons/My add-ons/Services/Snapserver/Configure set Preset to Kodi
  2. In Settings/System/Audio set Audio output device to PULSE: Default or PULSE: Linux FIFO sink /tmp/snapfifo
  3. In Add-ons/My add-ons/Services/Snapclient/Configure increase Latency (600 somehow works here, your mileage may vary) in order to (attempt to) synchronise audio and video; this must be done for all Snapclients

Remarks:

  • Sound quality feels inferior
  • Boot time feels longer

@awiouy awiouy changed the title snapclient: always restart service snapcast: add streaming from kodi Mar 21, 2018
@awiouy
Copy link
Collaborator Author

awiouy commented Mar 22, 2018

meh... snapserver should wait for pulse

@awiouy
Copy link
Collaborator Author

awiouy commented Mar 26, 2018

Snapcast

Snapcast is a multi-room client-server audio player, where all clients are time synchronized with the server to play perfectly synced audio. On LibreELEC it comes as two addons: Snapserver to stream AirPlay, Kodi or Spotify, and Snapserver to play.

Installation

Snapserver

Install Snapserver on one system in your network. Snapserver also exists for systems other than LibreELEC.

Snapclient

Install Snapclient on every system in your network you want to stream to. Snapclient also exists for systems other than LibreELEC.

Configuration

Snapserver for LibreELEC

By default, Snapserver streams AirPlay. You can select a stream in the settings of the addon from Airplay, Kodi or Spotify.

AirPlay

In the settings of the addon, select AirPlay. Then check with a phone or tablet that Snapcast is available via AirPlay.

Kodi

It works but is still quite capricious. Expect trial and error.

Before streaming Kodi, install Snapserver and reboot LibreELEC. After rebooting you should find PULSE: Snapserver in Settings/System/Audio/Audio output device. Do not select it yet. First select Kodi in the settings of the addon. Then select PULSE: Snapserver in Settings/System/Audio/Audio. After that, you should be able to select any audio output device without rebooting.

Before you switch to another stream in the settings of the addon, make sure you have selected a device other than PULSE:

You will notice that audio and video are not synchronized. This can easily be fixed during video playback by setting Audio offset to Ahead by 1.000s in Settings/Audio settings while playing. You may also wish to disable Play GUI sounds in System/Settings/Audio.

If you know what you are doing, you can set pulseaudio options by editing the pulseaudio.conf file in the home directory of the addon (smb://libreelec.local/userdata/addon_data/service.snapserver/pulseaudio.conf). Pulseaudio will pick these options when it restarts.

Spotify

In the settings of the addon, select Spotify. Then check with a Spotity app that Snapcast is available via Spotify.

Snapclient for LibreELEC

Sound Card

First, start streaming from the source you have set in Snapserver. If you are lucky, Snapclient will start playing.

If Snapclient does not play or uses a wrong sound card, go the settings of the addon. There, select "List sound cards" to list available sound cards, note the index of the card you wish Snapclient to use (3 for example), and set it in the "Sound Card" field. Snapclient should play after you change the settings with the "OK" button.

If "List sound cards" lists no card or only the null sound card you will wnat to add a sound card. For a Rasberry Pi, you can do this in the Raspberry Pi tab of the settings by setting "Manage onboard audio", selecting a playback mode and changing the settings with the "OK" button. When you return in the settings of the addon you should be able to list and select a card.

Enjoy!

@awiouy awiouy force-pushed the 90-snapclient branch 2 times, most recently from 457229b to 9973400 Compare March 26, 2018 23:58
@awiouy
Copy link
Collaborator Author

awiouy commented Mar 27, 2018

I am done. Please review and test.

@CvH
Copy link
Member

CvH commented Mar 27, 2018

lgtm 👍 (no runtime test as no usecase)

chewitt added a commit that referenced this pull request Mar 27, 2018
snapcast: add streaming from kodi (backport of #2597)
@awiouy
Copy link
Collaborator Author

awiouy commented Apr 10, 2018

This can be merged, no?

@CvH CvH merged commit 5f87ae7 into LibreELEC:master Apr 10, 2018
@awiouy awiouy deleted the 90-snapclient branch June 13, 2018 17:35
@diabl0w
Copy link

diabl0w commented Mar 31, 2020

the alsa-plugins are useless, alsa-lib is hardcoded with a plugindir of /usr/lib/alsa and this addon installs alsa-plugins to its own kodi addon directory... setting LD_LIBRARY_PATH does not affect alsa and so it isnt fixing anything

EDIT: wrong committ, resubmitting at correct location

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants