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

Possible to run two instances ? #14

Open
daxid opened this issue Sep 1, 2021 · 3 comments
Open

Possible to run two instances ? #14

daxid opened this issue Sep 1, 2021 · 3 comments

Comments

@daxid
Copy link

daxid commented Sep 1, 2021

Hi,

Thanks again for this wonderful port that the whole Deezer team could just not make in years !

Just a quick question here :

What would it take to have the possibility of two instances installed (with completely separate config/cache/offline folders) and running at the same time ?

Do you think I can just modify the installation paths to have two binaries and two "config" folders ? or might something else prevent them from running at the same time (at the moment if I launch a second instance, it is immediately closed) .

Use case is for cheap party djing (ish !)

Best regards

@SibrenVasse
Copy link
Owner

Yes it is possible to run two instances at the same time. Some changes to the source and package are required.
I'll try to think of a more elegant way to do this (not having to install a second package), but the way Deezer does the authentication process makes this kind of a PITA.

You can check it out at https://github.com/SibrenVasse/deezer/tree/second_instance (and build using makepkg)
If you have both packages installed, they can run both at the same time using the desktop files using your launcher or the cli commands deezer and deezer2

Before trying to authenticate on one of the instances, you have to make sure the return value from the browser ends up at the correct application.
So before logging in run this command to set the handling of the deezer:// url to the second instance:
xdg-mime default deezer2.desktop x-scheme-handler/deezer

After logging in, you can change this back with:
xdg-mime default deezer.desktop x-scheme-handler/deezer

Please let me know if this solution works for you. It worked on my machine :)

P.S. Of course you can't use the same account on both instances, playback will stop on the first when you click play in the second.

@daxid
Copy link
Author

daxid commented Sep 3, 2021

Man, you're too nice to be true ! I'll give all this a shot in the weekend :-)

To address some of your remarks :
I have a family subscription with an unused account so each instance will run on its own account.
Of course this is not the nicest way, but it gets the job done... To play offline I'll need two copies of the music database but well... who cares 10GB of drive nowadays ?

I plan on completing this with a jack setup to have a cross fader between the two applications. I'll report here in case someone is interested...

@daxid
Copy link
Author

daxid commented Sep 14, 2021

Howdy,

The setup is working great !
I'll try to make a PR in order to just change the name of the instance as a variable and have every modifications following automatically. It will make the update process of the second instance easier.

Also, I have a rough script using PulseAudio to fade between the two instances. It's working OK with key binding. I'll put a link here when it's a bit less quirky.

Best regards, keep up the good work :-)

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

No branches or pull requests

2 participants