owntone / owntone-server

Linux/FreeBSD DAAP (iTunes) and MPD audio server with support for AirPlay 1 and 2 speakers (multiroom), Apple Remote (and compatibles), Chromecast, Spotify and internet radio.
https://owntone.github.io/owntone-server
GNU General Public License v2.0
2.04k stars 234 forks source link

feature request: Snapcast support #1156

Open amitkeret opened 3 years ago

amitkeret commented 3 years ago

forked-daapd has an impressive list of supported clients. I started testing/using it due to its support for Chromecast devices, which I absolutely ❤️

I was previously using Snapcast for similar functionality, and what I especially like about it is Snapcast's Android app, which connect to the snapserver and allow to instantly add another "node" to the system. Is it possible to support streaming/broadcasting to Snapcast clients? I'm not sure what that would entail, but I imagine FD using another port to broadcast its stream, to which any snapclient nodes could connect.

ejurgensen commented 3 years ago

Yes, I suppose that would be possible especially since Snapcast seems to be open source. However, since I have no use for it myself and thus would have a hard time maintaining it, it would need to be done by someone who can do all that.

nadigo commented 2 years ago

hey, I am trying to use snapcast to stream music from a record player using HiFiBerry DAC+ ADC and Pi to my owntone server using snapcast.

On the pi / DAC side, I have configured snapserver and got the DAC to pipe to /tmp/snapfifo. On the owntone side I am trying to use snapclient to pipe a stream to owntone's library folder, an have owntone auto play it when a stream is present.

Using the below snapclient -player file > pipe somehow works.

snapclient --host testvm.local --logsink null --player file | tail -n +2 > /srv/music/phono

It's still somewhat buggy and I'm trying to find a better way to get snapclient to pipe a stream Any suggestions?

jpbaril commented 2 years ago

hey, I am trying to use snapcast to stream music from a record player using HiFiBerry DAC+ ADC and Pi to my owntone server using snapcast.

On the pi / DAC side, I have configured snapserver and got the DAC to pipe to /tmp/snapfifo. On the owntone side I am trying to use snapclient to pipe a stream to owntone's library folder, an have owntone auto play it when a stream is present.

Using the below snapclient -player file > pipe somehow works.

snapclient --host testvm.local --logsink null --player file | tail -n +2 > /srv/music/phono

It's still somewhat buggy and I'm trying to find a better way to get snapclient to pipe a stream Any suggestions?

@nadigo If you find a solution please let us know. I'm also trying to bridge Snapcast and Owntone.

TacoDog311 commented 6 months ago

I have successfully used owntone with snapcast by enabling the fifo output in owntonw.conf and setting it to /tmp/snapfifo. Then I set the snapserver steam to the same file.

The sound quality is horrible however. Can we bump up the fifo bitrate? I use 48000 when I do this in mopidy.

ejurgensen commented 6 months ago

OwnTone outputs 44100/16/2 (and that's hardcoded) so if snapserver expects 48000 the quality will indeed be horrible. Do you have a link to snapserver documentation of the fifo input?

ejurgensen commented 6 months ago

Found the docs, I see they say to configure snapserver with sampleformat=44100:16:2. Did you do that?

TacoDog311 commented 6 months ago

you are absolutely right.

this entry in owntone.conf:

fifo {
        nickname = "fifo"
        path = "/tmp/owntonefifo"
}

and this entry in snapserver.conf


[stream]
source = pipe:///tmp/snapfifo?name=modipy
stream = pipe:///tmp/owntonefifo?name=owntone&sampleformat=44100:16:2&codec=flac

lets me stream both services (I'm still deciding which I want to use) to any snapclient with clear audio.

Thank you!