INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: MPRIS2 Daemon  (Read 3613 times)

Mike Noe

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 792
MPRIS2 Daemon
« on: August 26, 2017, 12:25:52 pm »

Just polling for interest....

I writing a QT-based lib (linux/windows for now) that uses MCWS to work with MC Servers.  One feature it provides is basic MPRIS2 support in a daemon.  It's a little rough, but usable.

Any linux users interested in alpha testing the MPRIS2?  I think I'll have the daemon piece done in a few days.

FWIW, I don't see any other mention of MPRIS, but maybe there's already something available? 
Logged
openSUSE TW/Plasma5 x86_64 | Win10Pro/RX560
S.M.S.L USB-DAC => Transcendent GG Pre (kit) => Transcendent mono OTLs (kit)
(heavily modded) Hammer Dynamics Super-12s (kit)
(optionally) VonSchweikert VR8s

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5240
  • "Linux Merit Badge" Recipient
Re: MPRIS2 Daemon
« Reply #1 on: August 26, 2017, 04:32:53 pm »

I would love to test, and as far as I know there is nothing else available. I rigged up something using libnotify that's crude (no playback controls, etc.), and would love to have actual MPRIS integration.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72536
  • Where did I put my teeth?
Re: MPRIS2 Daemon
« Reply #2 on: August 26, 2017, 04:49:14 pm »

Mike,
Could you describe what a user might experience?

Here's a link to MPRIS:
https://specifications.freedesktop.org/mpris-spec/latest/

Thanks,

Jim
Logged

Awesome Donkey

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 7887
  • Long cold Winter...
Re: MPRIS2 Daemon
« Reply #3 on: August 26, 2017, 05:13:33 pm »

MPRIS is at the top of my MC for Linux wishlist these days so I'd love to see it too. I know Bob is very much aware of it already, and I believe has looked into it and plans on perhaps supporting it at some point in the future.
Logged
I don't work for JRiver... I help keep the forums safe from "male enhancements" and other sources of sketchy pharmaceuticals.

Windows 11 24H2 Update 64-bit + Ubuntu 24.10 Oracular Oriole 64-bit | Windows 11 24H2 Update 64-bit (Intel N305 Fanless NUC 16GB RAM/500GB M.2 NVMe SSD)
JRiver Media Center 33 (Windows + Linux) | iFi ZEN DAC 3 | JBL 306P MkII Studio Monitors | Audio-Technica ATH-M50x Headphones

Mike Noe

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 792
Re: MPRIS2 Daemon
« Reply #4 on: August 26, 2017, 05:53:13 pm »

Mike,
Could you describe what a user might experience?

Yeah, so it's not a "real" daemon, so to speak, but it runs in the background, and can be set up with systemd or just a .desktop if so desired.  It's just a QT console app, simple as pie, statically linked with my lib.  So, you just need a QT runtime installed (he said "just").  A side "benefit" is that the lib also provides a QML binding, fwiw.  The QML binding is part of the lib by default.

Right now, you run it from the command line and you can start it by specifying a MC host that is exposing MCWS (or conf file), with an auth token optional (defaults to localhost:52199).  It is fully multi-zone capable, so you have to also tell it which zone is "current" for MPRIS, otherwise it defaults to zone = 0.  Zone can be changed dynamically from the CLI.  Frankly, there's no reason a simple GUI with a systray icon couldn't be added to make it easy.

The MPRIS plasmoid I'm testing with shows multiple MPRIS sources (and lets you choose), so theoretically, I could expose all zones simultaneously, but currently, it just exposes one zone as default.
Logged
openSUSE TW/Plasma5 x86_64 | Win10Pro/RX560
S.M.S.L USB-DAC => Transcendent GG Pre (kit) => Transcendent mono OTLs (kit)
(heavily modded) Hammer Dynamics Super-12s (kit)
(optionally) VonSchweikert VR8s

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72536
  • Where did I put my teeth?
Re: MPRIS2 Daemon
« Reply #5 on: August 26, 2017, 06:16:44 pm »

Thanks.

What does it do?  ;)

This QT?
https://en.wikipedia.org/wiki/Qt_(software)
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5240
  • "Linux Merit Badge" Recipient
Re: MPRIS2 Daemon
« Reply #6 on: August 26, 2017, 06:24:48 pm »

Thanks.

What does it do?  ;)

This QT?
https://en.wikipedia.org/wiki/Qt_(software)

Jim a full MPRIS wrapper would do three things:
1) It would provide system and lock screen notifications for what's playing in MC on Linux systems, so you can see track names at a glance without switching back to MC or unlocking the computer. 
2) It would expose simple playback controls in the task bar and/or on the lock screen on linux systems (start, stop, skip track). 
3) It would (probably) also allow standard keyboard media keys to work correctly on Linux in most desktop environments, because many DE's intercept any media keys and try to hand them off to whatever media player is currently accessible via MPRIS; because MC currently has no MPRIS interface, the media keys never arrive.  This is an issue at least in Gnome, Cinnamon, and KDE in my testing, and may affect others.  It also makes MCE remotes harder to configure as you have to work around the fact that media keys can't get to MC.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72536
  • Where did I put my teeth?
Re: MPRIS2 Daemon
« Reply #7 on: August 26, 2017, 06:44:57 pm »

So the goal of implementing MPRIS is to provide better integration into the Linux desktop?
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5240
  • "Linux Merit Badge" Recipient
Re: MPRIS2 Daemon
« Reply #8 on: August 26, 2017, 07:25:42 pm »

So the goal of implementing MPRIS is to provide better integration into the Linux desktop?

In a nutshell, but with the potential to help with some hardware integration issues as well (i.e. it may simplify using an MCE remote or keyboard media keys with MC on Linux systems).
Logged

Mike Noe

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 792
Re: MPRIS2 Daemon
« Reply #9 on: August 27, 2017, 06:38:21 am »

@Jim:
Yes, it's C++ using the Qt Framework.  And, yes, mwillems got it right in terms of functionality.  Right now, I'm testing his points 1 and 2 on Plasma5 (working fine) using two plasmoids (systray apps):  the built in plasma audio volume control and the addon from here:  Audio Control Plasmoid

Never even considered his point 3 re: media keys.  I will take a look at that.

Right now, I think the only thing not implemented from the MPRIS2 spec is the playlist ordering and a playlist change notify.

A note about MC Zones and the MPRIS2 spec:
You'll notice in the spec that multiple players can expose thru MPRIS.  Most of the MPRIS controllers I've seen then provide the user some option to choose the player to "control".  In MC, since one player can have many zones, we have the ability to expose each zone as a unique MPRIS player.  For those controllers that offer the choice of player selection, works fine, you just choose the zone you want to control.   Otherwise, there has to be some mechanism for the user to choose a zone to be the "current MPRIS2 zone".

My plan is to offer both options, set in the conf file per MC host, checked at host connect:
Code: [Select]
[General]
recentHostlist=localhost:52199,toshiba-laptop:52199
lastHost=localhost:52199
.
.
[localhost]
broadcastAllZones=1
currentZone=10001
.
.
[toshiba-laptop]
broadcastAllZones=0
currentZone=0
.
.
Logged
openSUSE TW/Plasma5 x86_64 | Win10Pro/RX560
S.M.S.L USB-DAC => Transcendent GG Pre (kit) => Transcendent mono OTLs (kit)
(heavily modded) Hammer Dynamics Super-12s (kit)
(optionally) VonSchweikert VR8s

Mike Noe

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 792
Re: MPRIS2 Daemon
« Reply #10 on: August 27, 2017, 06:20:01 pm »

@mwillems,Awesome Donkey:
I have a version that I've tested with Plasma5/Qt 5.9 only.  Send me a PM if you're interested in testing.  I "think" it will run on Qt back to 5.6, but I'm not sure.
Logged
openSUSE TW/Plasma5 x86_64 | Win10Pro/RX560
S.M.S.L USB-DAC => Transcendent GG Pre (kit) => Transcendent mono OTLs (kit)
(heavily modded) Hammer Dynamics Super-12s (kit)
(optionally) VonSchweikert VR8s

zeltak

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 494
Re: MPRIS2 Daemon
« Reply #11 on: September 23, 2018, 01:18:20 am »

Hi

i know this is old but has this been applied? I would also love MPRIS support

thx

Z
Logged
Pages: [1]   Go Up