vincelwt / harmony

:musical_note: Sleek music player for Spotify, SoundCloud, Google Play Music and your local files
http://getharmony.xyz
859 stars 58 forks source link

Correct MPRIS implementation? #147

Closed JasonLG1979 closed 7 years ago

JasonLG1979 commented 7 years ago

A few problems.

1st: I'm not familiar with the mpris module you're using but judging purely from:

https://github.com/vincelwt/harmony/blob/44490093d5d3525dada4ba6d9fe22ed033612a29/app/js/player.js#L63-L69

You are missing A LOT of properties. i.e. All of the MediaPlayer2.Player properties. Not having those properties basically breaks your implementation.

2nd: mpris:trackid is expected to unique to each track even to the point that if a song repeats it should have a new unique id. https://github.com/vincelwt/harmony/blob/44490093d5d3525dada4ba6d9fe22ed033612a29/app/js/player.js#L159

Full disclosure: I am a contributor to https://github.com/eonpatapon/gnome-shell-extensions-mediaplayer and https://github.com/pithos/pithos and am very well versed in the MPRIS spec from both the client and server side.

vincelwt commented 7 years ago

Hey, The MediaPlayer2.Player properties are later declared: https://github.com/vincelwt/harmony/blob/44490093d5d3525dada4ba6d9fe22ed033612a29/app/js/player.js#L157-L167 Are those properties what you are talking about? I remember only adding the properties supported by Ubuntu because I couldn't test the others.

Didn't knew about mpris:trackid needing to be unique, thanks! So I could basically create the trackid by combining the original track id and the playback timestamp in a Base64 string? I guess it should work.

JasonLG1979 commented 7 years ago

It really doesn't matter what the trackid is as long as it's a valid dbus object path.

vincelwt commented 7 years ago

trackid will now be completely unique.

JasonLG1979 commented 7 years ago

trackid will not be completely unique.

They're suppose to be. According to spec It doesn’t matter if your playlist repeats the same song 100 times. There better be 100 unique mpris:trackid’s.

JasonLG1979 commented 7 years ago

That can be as simple as adding a counter. So += 1 for each repeat.

vincelwt commented 7 years ago

sorry I meant 'now' instead of 'not', typo :)

JasonLG1979 commented 7 years ago

Right on.

JasonLG1979 commented 7 years ago

Now how about Playlists and Tracklist interfaces?

JasonLG1979 commented 7 years ago

It would be kinda cool if you got them right. ATM there are no players on Linux that I can find that implement all of the MPRIS interfaces correctly. There are a couple that claim to but they are broken. I've got a PR in for Pithos. https://github.com/pithos/pithos/pull/431 to add the Tracklist interface, I already redid the player interface and implemented the Playlists interface.

JasonLG1979 commented 7 years ago

Well I see that you've made Harmony non-free you know that you could have still kept the source open and charged for the binary right? I was going to maybe give a stab at implementing those interfaces but that kinda puts a stop to that.

JasonLG1979 commented 7 years ago

Well I see up until 5 days ago Harmony was released under the GPL v3 I'll just clone your repo and reset to just before that point.

vincelwt commented 7 years ago

I think the Tracklist interface could be implemented pretty easily, but I'm not sure about the Playlists one. My current distro (xubuntu) only offers the basics MPRIS features so that's why I haven't tried to implement the less used ones.

About the pricing, there's a discussion about that here. I'm still not sure about the future of Harmony, maybe I will make it open-source again with paying binaries, Idk. Of course you're totally free to use the source-code of when it was still open-source, but I've made a lot of changes with 0.5, and rewrote a part of the MPRIS feature.

JasonLG1979 commented 7 years ago

I think the Tracklist interface could be implemented pretty easily, but I'm not sure about the Playlists one.

They are actually kinda a PITA to get right. That's why literally NO ONE implements the tracklist or playlists interfaces 100% right.

My current distro (xubuntu) only offers the basics MPRIS features so that's why I haven't tried to implement the less used ones.

I can test all the interfaces. I added tracklist interface support to the GNOME media extension a couple weeks ago.

About the pricing, there's a discussion about that here. I'm still not sure about the future of Harmony, maybe I will make it open-source again with paying binaries, Idk.

I'm not really a fan of charging for the binaries either but if think you must I guess, whatever. I really don't see a compelling reason why anyone would pay money for a music player on Linux. There are about a million native players. Why would someone pay money for a electron based player. Electron is a huge resource hog. You realistically will never make any money off this. You should either except that and do it for fun or just walk away from it.

As far as the source goes you're pretty much guaranteeing it will always be a one man show by closing it. If it's more than you can handle you should have either just let it die or engaged the community and asked for help.

vincelwt commented 7 years ago

I disagree with you. First, I am not really charging for the binaries as they're free to download, only you can buy a license to support Harmony & disable the annoying popup, in the same way as Sublime Text.

Then, Harmony isn't just another music player, it offers desktop support for the most used streaming services and provides a clean interface, where most music players offer a pretty loaded UI. I do believe I am not the only one interested by this. Even though you're right about the Electron problem, I do think a lot of persons do not care about it (the downloads stats confirm it) and it allows features to come faster, and make a cross-platform app as a one-man team.

I've also earned more in the 5 days of the license system than in an entire year of open-source donations.

About the sources, my hope is turn forward a plugin system first for services, allowing users to add their favorite services, then for styling the app (theme engine) and maybe later a more complete plugin system for entirely customizing the app.

To come back to MPRIS, is a 100% perfect implementation really needed? It seems like the system adapts pretty well to missing informations.

JasonLG1979 commented 7 years ago

is a 100% perfect implementation really needed?

Well I would think you'd want to do it right. Not following spec puts the burden of working around a players shit code on the client's authors. A good part of the code in the GNOME Media extension is working around broken interfaces. The point of a spec is so you don't have to worry if something will work or not if you follow the spec. I have toyed with the idea of removing all workaround code as a way to pressure players to actually follow the spec.

JasonLG1979 commented 7 years ago

I disagree with you. First, I am not really charging for the binaries as they're free to download, only you can buy a license to support Harmony & disable the annoying popup, in the same way as Sublime Text.

That's even worse so Harmony is nagware.

Then, Harmony isn't just another music player, it offers desktop support for the most used streaming services and provides a clean interface, where most music players offer a pretty loaded UI.

There are other players that provide the same functionally that are free.

I do think a lot of persons do not care about it (the downloads stats confirm it) and it allows features to come faster, and make a cross-platform app as a one-man team.

Resource usage and native look and feel is still a big consideration for a lot of Linux users. As far as coming faster. Unless Harmony is your full time job it's still a hobby. If you charge money you owe people, are you ready to owe people?

JasonLG1979 commented 7 years ago

I've also earned more in the 5 days of the license system than in an entire year of open-source donations.

So 3 licenses then? You said you've earned less than $40 in the last year.

vincelwt commented 7 years ago

Yes you can call it a nagware. I don't see why it's worse, a lot of quality software use it while still satisfying users. Take Sublime Text or Fman.

What other players are you talking about? Tomahawk? Nuvola? They are both far from my vision for Harmony. If not, I'd be curious to hear what music player you are referring to.

Resource usage and native look and feel is still a big consideration for a lot of Linux users. As far as coming faster. Unless Harmony is your full time job it's still a hobby. If you charge money you owe people, are you ready to owe people?

I do agree, and I'd have taken the native route if it was the best choice for me. I actually made the first version of Harmony (back then called Nem) with Python. But it was not, because I already knew web technologies, wanted to make Harmony cross-platform without too much struggle and wanted to be able to implement features fast. Now I totally understand if that is a problem for you and other people, nobody is forcing you to install Harmony. You should however understand that it may be useful to some people.

Still, Harmony has proven to be liked by Linux users, actually over 45% of the user base is Linux users.

And I don't owe people. I'm a sole individual, working on Harmony on free time as a hobby when I'm not at school, and people are aware of it. I will however make my best to satisfy people if it benefits the project.

So 3 licenses then?

Actually 4, yes.

About MPRIS, I agree with you, I do want to make it as best as possible but there is also a lot of other important stuff to be worked on, especially since as you say other MPRIS features are a PITA to implement. It may still be nice to perfect the MPRIS implementation when less urgent work is needed.

JasonLG1979 commented 7 years ago

What other players are you talking about? Tomahawk? Nuvola? They are both far from my vision for Harmony. If not, I'd be curious to hear what music player you are referring to.

Among others.

Everybody and their brother does Spotify and/or SoundCloud. This app does deezer and looks to be plug-able: http://webmusic.tiede.org/

And there are already at least 2 other Google Music Electron apps.

Look I'm not saying there's anything wrong with Harmony but lets not pretend it's revolutionary.

wanted to make Harmony cross-platform without too much struggle and wanted to be able to implement features fast.

It's really hard to get cross-platform right. The Qt framework comes close to getting it right but really if you want to have a truly cross-platform app you'd write a separate native UI for each platform and make the underlying base portable. What you're really talking about is prototyping, because that's what you're doing now. As it sits Harmony will run on Windows, Mac and Linux but it will always be a 2nd class citizen.

And I don't owe people. I'm a sole individual, working on Harmony on free time as a hobby when I'm not at school, and people are aware of it. I will however make my best to satisfy people if it benefits the project.

They paid money you owe them software support, at least they're going to think so..

Still, Harmony has proven to be liked by Linux users, actually over 45% of the user base is Linux users.

Is that based on continuous use or people who download it, try it once and uninstall it?

vincelwt commented 7 years ago

Webmusic and the 2 Google Music players I think you are talking about are web wrappers, meaning that it depends on the original webpage and needs an internet connectivity. That's why I don't think there is any app like Harmony. I never said it was revolutionary, it don't need to be.

To answer your last question, stats are based on active users.

JasonLG1979 commented 7 years ago

Webmusic and the 2 Google Music players I think you are talking about are web wrappers, meaning that it depends on the original webpage and needs an internet connectivity.

They are I believe. But Harmony also depends on an internet connection for it's online content I'd imagine. I really don't see being a web wrapper as a problem from the users point of view. It does make it more fragile from the devs point of view I'd imagine though.

I'm not trying to knock Harmony. It could be a really neat app. I just hate to see programs go closed source. All things being equal opensource is just a better development model IMHO. I especially hate to see apps go nagware. Instead of nagware I'd go Freemium. Just have the licence unlock online features for example, and drop the nags or just have a nag on the 1st run and/or in the prefs window or wherever you would enable online features.

vincelwt commented 7 years ago

Why do you hate nagware? In Harmony's case, I don't think the popup really is annoying. I don't think a freemium model would work for Harmony. Currently, the popup asking for registration is only showing when you refresh your library, which isn't so often. So even free users have access to all the features without too much trouble. Going freemium would block free users of important features, which I don't really want to do.