-
Notifications
You must be signed in to change notification settings - Fork 243
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
Spotify Connect #295
Comments
Certainly would be an interesting feature. It would mean that a user like me, which has both local music (+ radio) and Spotify, would need to use two clients. Personally, I prefer having all my music controllable from one client per device (mostly Remote on my phone). So what I am going for (and hoping for) is still proper integration. This is hard to do right now because of the lack of replacement for libspotify. So right now, Spotify support in forked-daapd is lackluster. The plan on my part (and @chme, I believe) is to see if Spotify delivers on their promise to make a replacement for libspotify. The announcement says before the end of this year. Anyone who feels like writing them to encourage this should probably do so! |
Yeah one would have to use two clients. (My use case is identical to yours). |
Yes, they may well disappoint. I actually have begun working on a little something that will give you all your Spotify music in forked-daapd. Basically by mixing libspotify with the web api. So I hope they will at least not cripple libspotify any more. |
Cool. Let me know if I can help testing. However still think that forked-daapd besides iTunes being the only piece of software able to stream to multiple airplay speakers synchronised would be good to accept input from spotify directly via spotify-connect. also forked-daapd as a airplay target would be nice to distribute audio from e.g. an iPhone to multiple speakers. |
Sounds interesting. Let me know if you need someone to test it out... Sent from my phone.
|
I agree, it’s just that adding direct support for librespot and libshairport/libshairplay in forked-daapd (and maintaining the support) is a bit more work than I can take on. I hope that the pipe (+ metadata pipe) can serve the purpose for now. Maybe a good thing to add to the current pipe implementation would be to make forked-daapd automatically start playing a watched pipe, if there is audio being written to it. That would mean you could start playback without interacting with forked-daapd. |
So for the interested: I created a named pipe:
and then run librespot like this:
then I can "play" Spotify in forked-daapd and select SpotifyConnect in the Spotify App - The output then goes to which-ever speakers selected in forked-daapd. Not exactly elegant but it works nicely to stream Spotify from the app to all airplay speakers. |
This is very cool. https://bbs.nextthing.co/t/howto-chip-or-chip-pro-as-spotify-connect-radio/17621 I found this guide, is this what you did or? Thanks |
I went for step 2B from your link. I downloaded the binary. the point however is starting it so that it outputs the audio to a named pipe, which is then read by forked-daapd This is done as I wrote above. |
Ive found a place with the install, but no idea how to install this to a headless Pi Zero https://github.com/herrernst/librespot/releases Any guides, im Googling, but im struggling. |
Right, hope this helps someone in the future :) Create the directory first, cd into that and then;
|
So if I run it this way, it works, but obviously goes no where; (I have set up the pipe, same as above)
If I try running it like this;
It seems to just crash, any ideas? |
Ok, so its running now, but the pipe doesnt work; I can see a device called "AirPlay" I can play to it. I cant see it in the remote and I can see this in the logs laudio: Error initializing Pulseaudio: Connection refused Im also using the native spotify "client" the one that just shows you the playlists in the remote. But I would assume if it was picking up the pipe correctly, it would show both? |
Did you create the pipe?
and of course this needs to be inside the library folder of forked-daapd so the above assumes that |
This option in
This makes forked-daapd automatically start if it detects data in the pipe. So you do not have to select the pipe file, forked-daapd will automatically do that if it detects that librespot is putting data into it. |
Thats what it was, I had the default in the conf file. Thanks so much, would never have got that. But its all working, and working well, crashes a bit though :( How are you finding stability? Thanks again for your help with this :) |
stability is so-so. It is crashing on me always. mostly I suppose it's forked-daapd crashing. not sure why though and I haven't had time to go into debugging. For running it as a service I use systemd
pretty crude but it works.
I can then use |
Don't like to hear about forked-daapd instability, so now I have also setup librespot with a pipe to test it the next few days... Would be nice if librespot would support metadata pipes like shairport does. That could also help remove some of the volume control lag. |
@snizzleorg sorry, been away, thanks for that. Have you guys seen this? dtcooper/raspotify#15 (comment) Its a client that's easy to install and has a conf file for settings, like piping as you can see from this issue. |
@1liminal1 @snizzleorg is the one that explained it to me :P |
@ejurgensen Just wanted to say thanks for an awesome piece of software. The setup detailed in this thread took me about an hour, which was a lot quicker than I expected. Mostly thanks to your slick software. |
@chimpy Nice! and thanks for your help on that other thread :) I also second how awesome forked-daapd is and just a general thanks for how helpful everyone is in getting stuff setup. |
Yes, I'm hoping librespot will implement metadata pipe or file, so forked-daapd can pickup volume changes instantly. However, so far there has been no response in the thread, so might require that someone steps up and makes a PR. I've been running the setup a few days, and so far no crashes. If there are specific circumstances that produce a crash I hope you will share. |
thanks for testing. I have not had time to dig to the root of this. Not sure what the crashes are and who is to blame. It's not so easy to debug and doesn't follow a pattern so that I can recognise so far. However if I find a little more time I will do some more thorough testing. Maybe I can find some specific circumstances. |
I have mine working now as well so ill test over the next few days and let you guys know about stability. So the meta-pipe causes the slow response, is there any workaround for that, or nothing we can do? |
Take a look here, seems to be more Active mantained than librespot for now: |
Thanks for the hint. But isn't it built on top of librespot? Or am I not understanding it properly? It also looks like it only can output to alsa and Pulseaudio, which won't do for forked-daapd. It will need to provide raw audio so that forked-daapd can send to any output (Airplay, Chromecast, alsa etc.). |
I use |
Here is another attempt. I tested with the command you shared, and it seems to work with that. I haven't made any further tests than that, so hope you can check if it does what you are looking for. |
Thank you. I'll give it ago. Update. Yes - it seems to work exactly as I would expect it too. Thank you for implementing this. |
FYI - I have asked the developer of librespot-java to implement a pfls event for playback commands. He has done this via librespot-org/librespot-java@6a2679d. I have tested in combination with the deb here by @ejurgensen and the controls are now super slick and very responsive. It works better than I had hoped. The only small caveat to this is you get approximate 0.2 seconds of the previous track play at the beginning of the next track. You can mitigate this with a sleep command or similar if scripting. |
Would you mind sharing even a basic rundown on how to make it happen? I'm a
little lost on how to update librespot and forked-daapd, is that what needs
to be done?
…--
Cory Beal
*He/HimProduction Manager @ Floodway Print Company LTD.*
https://floodwayprintco.com/
On Thu, Mar 11, 2021 at 3:13 PM aleszczynskig ***@***.***> wrote:
FYI - I have asked the developer of librespot-java to implement a pfls
event for playback commands. He has done this via
***@***.***
<librespot-org/librespot-java@6a2679d>.
I have tested in combination with the deb here by @ejurgensen
<https://github.com/ejurgensen> and the controls are now super slick and
very responsive. It works better than I had hoped.
The only small caveat to this is you get approximate 0.2 seconds of the
previous track play at the beginning of the next track. You can mitigate
this with a sleep command or similar if scripting.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#295 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AM3B6M25LYUB3D2XLSHGSWDTDEXAJANCNFSM4CTJMIFA>
.
|
@floodwayprintco - sure. I can put together a little write-up to cover it. I can only provide instructions for use on a raspberry pi though, if you are using other distributions you will need to alter as necessary. FYI - at present the capabilities are not in the formal releases so you will need to install either a test deb for forked-daapd or compile from source. For librespot-Java you will need to compile from source and make a small modification to the spocon systemd configuration. Depending on your technical capabilities you may want to wait until these changes are rolled into a full release for everything involved. |
My capability is right around the 'just enough to be dangerous' area,
although I'm willing to learn and could revert to a regular setup pretty
easily I think. Compiling from source, and the test deb are both the tricky
parts for me. I am on a raspberry pi though and am comfortable with a bit
of configuration. Let me put it this way, if you were to make a writeup I
could at least test it if that would help, but I am happy to wait for a
full release as well. So don't sweat it if you unless you think it'd be
'worth it' to test it too.
…--
Cory Beal
*He/HimProduction Manager @ Floodway Print Company LTD.*
https://floodwayprintco.com/
On Fri, Mar 12, 2021 at 8:16 AM aleszczynskig ***@***.***> wrote:
@floodwayprintco <https://github.com/floodwayprintco> - sure. I can put
together a little write-up to cover it. I can only provide my instructions
for use in a raspberry pi though, if you are using other distributions you
will need to alter as necessary.
FYI - at present the capabilities are not in the formal releases so you
will need to install either a test deb for forked-daapd or compile from
source. For librespot-Java you will need to compile from source and make a
small modification to the spocon systemd configuration. Depending on you
technical capability you may want to wait until these changes are rolled
into a full release for everything involved.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#295 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AM3B6M6Y4WK4FXHFAYPI3UDTDIO5FANCNFSM4CTJMIFA>
.
|
Hi, how you create the two files? I made it with "touch".
Then i edit spocon config.toml
After Restart i cannot connect to spocon. What i doing wrong? |
I'm not 100% on this, but for the sake of reply maybe this will help.
Pretty sure I had to make my pipes using a 'mkfifo' command.
…--
Cory Beal
*He/HimProduction Manager @ Floodway Print Company LTD.*
https://floodwayprintco.com/
On Fri, Mar 19, 2021 at 10:46 AM st0nec0ld ***@***.***> wrote:
Hi,
I use forked-daapd the same way @floodwayprintco
<https://github.com/floodwayprintco> does.
Until today using the pipe capability of raspotify was my approach too.
Now I encountered a Java based connector called spocon
<https://github.com/spocon/spocon>.
Additionally to the functionalities of raspotify it supports a metadata
pipe that works fine with forked-daapd!
After following the installation instructions of spocon I created two
files (*spotify* and *spotify.metadata*) and changed the configuration in
the [player]-Section:
# Audio output device (MIXER, PIPE, STDOUT)
output = "PIPE"
# Output raw (signed) PCM to this file (`player.output` must be PIPE)
pipe = "/home/pi/music/spotify"
# Output metadata in Shairport Sync format (https://github.com/mikebrady/shairport-sync-metadata-reader)
metadataPipe = "/home/pi/music/spotify.metadata"
After restarting spocon and forked-daapd I finally have metadata with
artwork in my UI.
I hope this helps everyone who is using forked-daapd with Spotify this
way. Thank you for your great work on this topic!
Hi, how you create the two files? I made it with "touch".
touch spotify touch spotify.metadata
Then i edit spocon config.toml
`metadataPipe = "/home/pi/spotify.metadata"
output = "PIPE"
pipe = "/home/pi/spotify"
After Restart i cannot connect to spocon. What i doing wrong?
`
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#295 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AM3B6MYQBQSXRELIZM5KSRDTENWWTANCNFSM4CTJMIFA>
.
|
Hello, apologies I have not found the time to respond to this. @floodwayprintco is correct, you must use mkfifo for both the audio and metadata pipes. A brief description of what is required is listed here. I am sorry I do not have time to do a more complete write-up at this time.
Note I have recently asked the librespot-java developers to implement configurable scripts to run on a variety of events. These are available in the latest master build. You will need to add this section to your config.toml if you want this to work. I have for example setup forked-daapd to connect to selected speakers when spocon resumes playback. I am sure there are many uses for these.
and speaker-connect.sh looks like this
You will need to update the ids for your devices accordingly. I hope this helps. I am sorry it is brief. I would like to author a proper HOWTO for this and add to the wiki pages if @ejurgensen is willing for me to do that. Finally none of this would be possible without the wonderful work of all the developers who give their free time to create these excellent examples of open-source software. Thanks to all of those involved. |
Hello, first of all many thanks for this great project and to all contributors! I have been able to successfully implement the instructions from aleszczynskig so far. However, the changes in volume are not adopted. This notice comes in the log. What am I doing wrong?
|
I don't use shairport-sync because I use PIPE to transfer the data from Spocon (librespot-java) to forked-daapd. I don't use shairport-sync because I think it is not needed? |
Sorry, misunderstood. It looks like the similar setting for Spocon might be: "bypassSinkVolume = true" (see the above) |
No Problem :) I have set the value "bypassSinkVolume = true" in the configuration and it appears in the log.
|
Yes - this setting is required in config.toml for spocon. I can't tell from your post; has enabling this setting worked for you? |
I think it's set correctly right? Thank you! :)
|
Yes that looks correct. FYI. You may want to change settings like the number of volume steps, pre-gain and initial volume to suit your needs. The values here are what works best for me. |
OK thanks! I just pulled and built the current dev branch again. Bug is still there. |
You can use the librespot-Java master branch. Is there a reason you are using the dev branch? |
As far as I understand, only this branch (git branch) currently exists there. I probably just don't know my way around git well enough. |
You are right. That is the correct branch. |
Hey guys, @snoopbird you don't need shairport-sync for spotify, but it can be configured to use this device as an airplay endpoint, in case you want to use your iOS device as a source. iphone (airplay audio sender)->shairport-sync(pipeout)->pipefile (file with mkfifo)->forked-daapd -> airplay speakers. If you enable pipe_autostart in forked_daapd and then play from iOS to the shairport-sync device, it will take over the stream from spocon and pause the spotify session. |
My goal is to transfer the music above PIPE to the owntone server above SpoCon (librespot-java). This all works wonderfully, except for the quick control of the volume with the new option Unfortunately I don't know why. I have again created a current build of librespot-java ("regular" branch / dev branch). If I set the switch |
@snoopbird I have played around with this and after setting my config.toml file to include the bypassSinkVolume line, I get an error (log level is TRACE):
I have the standard install of spocon. Unclear if this option is supported? |
Would be awesome if spotify-connect could be supported so that one could stream from spotify to forked-daapd and then to all the speakers in the house:
https://github.com/plietar/librespot
It's probably possible to do this even now via pipe (the same was as mentioned here: #278)
See also this discussion:
plietar/librespot#88
The text was updated successfully, but these errors were encountered: