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

Subsonic support #1930

Closed
Clementine-Issue-Importer opened this issue Dec 9, 2013 · 66 comments
Closed

Subsonic support #1930

Clementine-Issue-Importer opened this issue Dec 9, 2013 · 66 comments

Comments

@Clementine-Issue-Importer

From bb@zbeba.com on May 27, 2011 20:37:16

Add support for Subsonic. Developer API info here: http://www.subsonic.org/pages/api.jsp

Original issue: http://code.google.com/p/clementine-player/issues/detail?id=1930

@Clementine-Issue-Importer
Copy link
Author

From panaVTEC on August 07, 2011 03:56:03

This would be very nice!

Any progress on this? :O

@Clementine-Issue-Importer
Copy link
Author

From ultramancool on November 10, 2011 10:06:56

Another vote - would be awesome :)

@Clementine-Issue-Importer
Copy link
Author

From Drakaz on November 23, 2011 08:23:11

Would be nice !

@Clementine-Issue-Importer
Copy link
Author

From jordn.j on December 06, 2011 03:40:47

This would make Clementine the best music player available today, hands down!

@Clementine-Issue-Importer
Copy link
Author

From germain.gueutier on December 06, 2011 05:07:06

+1 for the subsonic integration !!!

@Clementine-Issue-Importer
Copy link
Author

From spqrqed on December 06, 2011 10:27:11

Very attractive feature, this would be.

@Clementine-Issue-Importer
Copy link
Author

From alan.briolat on December 06, 2011 15:43:52

I'm attempting to add Subsonic support to Clementine, I'll comment again if/when I have something working...

For anybody interested in following progress, my fork is at https://github.com/alanbriolat/clementine-subsonic

@Clementine-Issue-Importer
Copy link
Author

From markurujapan on December 09, 2011 05:24:31

Would be nice :)

@Clementine-Issue-Importer
Copy link
Author

From seanssel on December 24, 2011 11:52:35

+1 This would be a wonderful addition.

@Clementine-Issue-Importer
Copy link
Author

From gezuru on January 05, 2012 09:30:58

Yes please :) Would fit nicely into Clementine next to Grooveshark and Spotify.

@Clementine-Issue-Importer
Copy link
Author

From ldrouet on January 30, 2012 01:41:03

I would use it !!!

@Clementine-Issue-Importer
Copy link
Author

From veryaner on May 13, 2012 10:30:46

Nice feature! I will definitively use it...

@Clementine-Issue-Importer
Copy link
Author

From yochaigal on July 07, 2012 11:49:25

I also support this!

@Clementine-Issue-Importer
Copy link
Author

From olivelias on August 02, 2012 15:53:32

Would be nice !

@Clementine-Issue-Importer
Copy link
Author

From timrobin on August 22, 2012 10:54:33

Yes please.

@Clementine-Issue-Importer
Copy link
Author

From bignatejohnson on September 11, 2012 08:44:21

I am a big Subsonic/iSub user. I have just stumbled on Clementine and am LOVING IT! Having Subsonic integration would be incredible!!

Thanks!

@Clementine-Issue-Importer
Copy link
Author

From pwcazenave on September 11, 2012 08:46:47

If you're on Linux, compiling a binary of Alan's fork is relatively straightforward and works well (github appears to be down at the moment).

On my todo list is compiling a binary for Mac OS, but it's a lot more complicated than it is on Linux. I don't have access to Windows, so have no idea how easy that is.

@Clementine-Issue-Importer
Copy link
Author

From bignatejohnson on September 11, 2012 08:53:23

Ok...thanks! Yeah, I saw that the server was down after I posted (and have edited my comment).

Hope the integration work continues.

Nathan

Sent from Mobile

@Clementine-Issue-Importer
Copy link
Author

From viper0286 on November 02, 2012 12:08:49

Actually I use Alan's fork...realy nice and nearly perfect work!! :)
I hope to see it in official Clementine next time!

Thank you buddy, you made my day!!

@Clementine-Issue-Importer
Copy link
Author

From alan.briolat on January 30, 2013 00:45:29

The Subsonic support I've been working on was merged in fe2fb78 \o/ Still a few little things to tidy up, but the main functionality is there. Please give a recent build ( http://builds.clementine-player.org/ ) a try and report any problems you have.

@Clementine-Issue-Importer
Copy link
Author

From Julian.Held on January 30, 2013 01:09:16

Wow that's great, thanks alan!

Https connections not working yet or am I doing something wrong?

-julian

@Clementine-Issue-Importer
Copy link
Author

From schizosfera on January 30, 2013 01:12:19

i currently get an "unspecified error" when attempting to connect to login on http://_.subsonic.org/ which is a redirect to our server (https://.... inserting the https://_ link including port and terminal backslash yields a "check url" error.

@Clementine-Issue-Importer
Copy link
Author

From djamy.tirouche on January 30, 2013 01:23:48

It's working like a charm ! THANKS A LOT !

@Clementine-Issue-Importer
Copy link
Author

From pwcazenave on January 30, 2013 01:24:34

Nice work Alan :)

@Clementine-Issue-Importer
Copy link
Author

From alan.briolat on January 30, 2013 01:42:14

HTTPS should work - it's what I use all time!

Back when I was first working on this, somebody had a problem that was a strange interaction between a new OpenSSL version on the client and an old OpenJDK on the server. Do you get an error if you try and "curl https://server:port/"? Something like: "curl: (35) error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal error".

If any issues reported could include server OS + version, client OS + version, subsonic version and the Java implementation and version that subsonic is being run with, that would help me reproduce the problem. HTTPS problems would also benefit from knowing the openssl version of the client (for non-Windows platforms, at least).

Also, any relevant log output helps, especially a pair of lines that looks like:

19:58:17.782 ERROR SubsonicService:210 Failed to connect (SslHandshakeFailedError ): "SSL handshake failed"
19:58:17.783 DEBUG SubsonicService:246 Login state changed: LoginState_BadServer

@Clementine-Issue-Importer
Copy link
Author

From alan.briolat on January 30, 2013 01:45:02

As for the ***.subsonic.org redirects, I just tried one of those myself and it doesn't seem to be at all intelligent; it just assumes your server is accessible on your public IP address on port 4040 over HTTP. Can you actually use your .subsonic.org address to get to your subsonic server in your browser?

@Clementine-Issue-Importer
Copy link
Author

From schizosfera on January 30, 2013 01:46:39

both the subsonic.org redirect and the actual https address work in the browser.

curl on the https address yields:

curl: (35) error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal error

@Clementine-Issue-Importer
Copy link
Author

From schizosfera on January 30, 2013 01:47:18

...which might be because of the self-signed certificate

@Clementine-Issue-Importer
Copy link
Author

From alan.briolat on January 30, 2013 01:52:08

I explicitly ignore certificate validation in the Subsonic connection because (almost) nobody is going to have a certificate that validates. This is the strange TLS version mismatch problem I've seen before (see: alanbriolat/clementine-subsonic#1 ).

What about the rest of the OS and version information I mentioned?

@Clementine-Issue-Importer
Copy link
Author

From schizosfera on January 30, 2013 02:06:05

sorry but i currently don't have shell access to the server, so all i can tell is what subsonic tells me:

  • 4.7 (build 3105) – September 11, 2012
  • jetty-6.1.x, java 1.7.0_09, Linux

the client is running Ubuntu 12.04 with OpenSSL 1.0.1 14 Mar 2012.
the debug output is:
11:05:33.489 ERROR SubsonicService:231 Failed to connect ( SslHandshakeFailedError ): "SSL handshake failed"
11:05:33.490 DEBUG SubsonicService:267 Login state changed: LoginState_BadServer

@Clementine-Issue-Importer
Copy link
Author

From ricart.roddy on January 31, 2013 06:52:50

To add to my previous comment, I was finally able to make it work.
Th problem is that I have to use the ip address direcly : https://192.xxx.xxx.xxx:port/ to make it work. It won't work with the xxx.subsonic.org address.

@Clementine-Issue-Importer
Copy link
Author

From uspoerlein on March 13, 2013 03:14:29

While this support is exceedingly cool, I've amassed quite the collection of ratings and playcounts and scores in Clementine (started quite some time ago with Amarok). I've setup subsonic on the same server that hosts my MP3 (Clementine uses NFS to read those) so that I can stream some songs to $WORK or even mobile via Android devices.

The only missing piece would be a way to either do a onetime migration of Clementine scores/ratings/playcounts to Subsonic and then use that exclusively, or a way to convert between the two, so that I do a subsonic -> clementine before starting it up and back again when closing it. I'm the only user of that setup, so this shouldn't de-sync too much, besides a little loss of latest updates is not a dealbreaker.

@Clementine-Issue-Importer
Copy link
Author

From schizosfera on March 13, 2013 04:32:03

@42: this issue is about generic subsonic support. synchronizing ratings/playcounts is a completely different thing, so feel free to open a separate issue :)

@Clementine-Issue-Importer
Copy link
Author

From ross.wolfson on May 04, 2013 19:07:14

I was running into the SSLv3 issue as well, I put in a checkbox to force SSLv3 for Subsonic as a workaround in my Clementine clone; feel free to merge it in if it seems reasonable. On my PC, it looks like the music HTTPS stream is using a TLS 1.2 hello message and is not running into an issue, so using SSLv3 for the initial control stream seems to get past the incompatibility.

I might look into making server connection errors more verbose to help diagnose why Clementine isn't connecting to Subsonic, particularly to hint at that option when there's an SSL issue.

@Clementine-Issue-Importer
Copy link
Author

From ross.wolfson on May 22, 2013 17:13:28

If needed, here's links to the commits I mentioned in my last update.

Add option to toggle SSLv3 -> https://code.google.com/r/rosswolfson-clementine/source/detail?r=25d92f5083330535b4d020e2157955c795a74d73&name=sslv3-ehnancements Add verbosity to error message when Subsonic server connection fails -> https://code.google.com/r/rosswolfson-clementine/source/detail?r=7e32cfc3584b0c6e41563255bf6c0c60f661a78d&name=sslv3-ehnancements

@Clementine-Issue-Importer
Copy link
Author

From ross.wolfson on May 29, 2013 19:01:09

Added one more commit to clean up the NetworkAccessManager behavior -> https://code.google.com/r/rosswolfson-clementine/source/detail?r=40d35faa006aa0d5bf899917d3f4fe303555bffa&name=sslv3-ehnancements

@Clementine-Issue-Importer
Copy link
Author

From ross.wolfson on May 30, 2013 19:18:37

The SSL issue override setting mentioned above got merged into the main branch.

@Clementine-Issue-Importer
Copy link
Author

From ross.wolfson on June 20, 2013 19:05:15

For the folks that tried to use *.subsonic.org addresses, I broke that out into a separate enhancement in issue 3747 .

@Clementine-Issue-Importer
Copy link
Author

From firedragon on July 09, 2013 13:45:41

Is it possible to request that Clementine handles the display of the directory Hierarchy in the same way subsonic does, by grouping tracks by folders instead of trying to sort them by artist/album.etc

I guess it's possible to pull the directory layouts from the subsonic API as the mobile apps I've used follow the same organizational structure as the Subsonic WebUI.

@Clementine-Issue-Importer
Copy link
Author

From rom1dep on July 28, 2013 13:59:17

subsonic support is nice, and works like a charm. Caching (#3459) would be a nice improvement. Do you intend to do something for covers ? And for moodbars ?

@Clementine-Issue-Importer
Copy link
Author

From alan.briolat on July 28, 2013 15:18:19

@FireDragon: I originally implemented it in the way you describe, however it didn't fit with the feel of Clementine very well and didn't allow easy re-use of all the Clementine library functionality, e.g. filtering, configurable grouping, global search, etc. It might be possible to implement both models or a hybrid model and choose which model to show, however it's a much bigger task because of the lack of re-use. The current behavior is the most useful in my mind so I'd be inclined to let somebody else implement the other model if they wanted to. Perhaps submit it as a feature request for more focused discussion?

@Clementine-Issue-Importer
Copy link
Author

From alan.briolat on July 28, 2013 15:23:44

@rom1dep: As far as I can tell, cover art is within the realm of possibility, and wouldn't take too much work - the API call is right there and the library data returns cover art IDs. Moodbars depend on using a library to analyse the music files - as it stands, this wouldn't be possible without lots of excess network traffic, however if caching were implemented it wouldn't be unreasonable to calculate and cache moodbar data for cached tracks.

@Clementine-Issue-Importer
Copy link
Author

From rom1dep on July 28, 2013 16:12:37

Or maybe is it possible to look for .mood files from within the remote directory using the getMusicDirectory api call ?
I know it may sound a bit "corner-case" or over-engineered but in my case, the music I stream through subsonic is directly synced from a local hard drive managed by clementine anyway. In other words, mood files are remotely identical to the local ones that have been rendered by clem. , but unused until now…

Also, thank you for your hard work on this nice feature ;)

@Clementine-Issue-Importer
Copy link
Author

From alan.briolat on July 29, 2013 00:17:46

As far as I can tell, moodbar data is not stored alongside the music files, and even if it was, Subsonic won't serve anything it doesn't recognise as a media file.

@Clementine-Issue-Importer
Copy link
Author

From rom1dep on July 29, 2013 02:49:00

"As far as I can tell, moodbar data is not stored alongside the music files"
→ Settings/Appearance/Moodbars/☐ Save .mood in your music library does the trick

"Subsonic won't serve anything it doesn't recognise as a media file."
→ you are right, I just tested here :/

Two more observations:
It'll be way better to connect using the hex-encoded password feature (my logs shows that QUrl is constructed using a plain pass Brrrrr!)
Also, "File type" information is not properly recognized (tracks appear as type "Unknown" in the playlist view, should be easy to fix using contentType=…)

@Clementine-Issue-Importer
Copy link
Author

From rom1dep on July 29, 2013 07:01:54

Use hex-encoded password instead of plain password

Attachment: passenc.diff

@Clementine-Issue-Importer
Copy link
Author

From arnaud.bienner on July 29, 2013 07:09:37

What's the purpose of having your password hex encoded? This will not make it more secure.

@Clementine-Issue-Importer
Copy link
Author

From rom1dep on July 29, 2013 07:47:42

What's the purpose of not having it ? Anything is better than sending plain passwords…

@Clementine-Issue-Importer
Copy link
Author

From Gerold.Mittelstaedt on July 29, 2013 08:07:24

What's the purpose of fake security? Security through obscurity is IMHO even more worse.

@Clementine-Issue-Importer
Copy link
Author

From rom1dep on July 29, 2013 08:34:30

I never spoke about security, it's more about privacy and homogeneously looking password that doesn't draw attention.
Btw. if security is a concern, why not using the http auth ?

@Clementine-Issue-Importer
Copy link
Author

From arnaud.bienner on July 29, 2013 09:01:26

For me password obfuscation is about security, and doing it this way (i.e. hex encoding) is just useless.
There's an option to enable SSL for subsonic, this looks to be enough and more secure.

I guess you did the patch because you're worrying about having your password showing up in the logs.
Another solution would be not to print debug messages which contain password.
But it looks like the password is included in all messages. Maybe it's better to keep them in debug.
In that case indeed it makes sense to hide the password in some way in the debug messages.

Alan, do you have an opinion about this?

@Clementine-Issue-Importer
Copy link
Author

From alan.briolat on July 29, 2013 12:03:40

I didn't bother with the hex-encoded password for the same reasons stated above: it's a meaningless cosmetic difference.

Password in logs: the only source of credentials in the log (as far as I can tell) is the bit where Clementine resolves the "subsonic://" URL stored in the library to a real URL. This happens for all sources that use URL handlers, it's not Subsonic-specific. The difference is that most other authenticated services have a sane authentication mechanism (e.g. OAuth) so you're only leaking tokens, not passwords. This bit of logging is really useful for debugging when URL handling goes wrong, so I can't see any developers wanting to remove it. It's also already a DEBUG message.

HTTP basic authentication: the limiting factor is needing to give gstreamer a complete, usable URL. Assuming gstreamer allows the usual convention, you'd be trading "http://...?u=username&p=password for "http://username:password@... This would still show up in the log messages mentioned above. It's simpler to have only one generator for API URLs that's only as complicated as necessary.

That being said, there is no actual negative to using the encoded format, so if it makes people happy and there's a patch it can be included, why not? However, the change should only touch one line, preferably the one in BuildRequestUrl. toHex() isn't expensive and it keeps the code self-explanatory.

@Clementine-Issue-Importer
Copy link
Author

From arnaud.bienner on July 31, 2013 04:39:11

Making one person happy for non-obvious reasons (at least, to me) isn't a valid reason to integrate a patch.

Is Subsonic able to support token auth mechanism, so we don't have to keep passwords in URL?
It would be safer.
Do you think it's feasible?

@Clementine-Issue-Importer
Copy link
Author

From alan.briolat on July 31, 2013 06:59:00

No, as it currently stands the only two methods for authentication are plaintext password and thinly-veiled plaintext password.

@Clementine-Issue-Importer
Copy link
Author

From arnaud.bienner on July 31, 2013 07:15:05

What a shame.
So I let you decide if you want to integrate the patch.

If so, IMO it's better to do .hex() in ReloadSettings instead of computing it each time in BuildRequestUrl. Even if it's not that's expensive, it's not worth it IMHO. If you think the code will not be clear enough, maybe a comment around the password_ attribute to specify it's actually the hex representation of the password? (that's what I did for Grooveshark, where we just need the hash value).

Also, should be toLocal8Bit instead of toAscii.

@fmikker
Copy link

fmikker commented Feb 21, 2014

Please correct me if i should create a new issue.

I want to suggest a feature: Allow saving clementine created subsonic playlists on the subsonic server.
There seems to be support for this in the API's for subsonic if I interpered the documentation correctly: http://www.subsonic.org/pages/api.jsp#createPlaylist
http://www.subsonic.org/pages/api.jsp#updatePlaylist

@alanbriolat
Copy link
Contributor

Since there is a release that includes Subsonic support, this issue should probably be closed. New feature requests and bug reports related to Subsonic support should be new issues.

@fmikker Feel free to create a new issue. This isn't as straightforward as it might seem, but if somebody can work out a sane way of exposing it, it might be possible.

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

No branches or pull requests

4 participants