Closed gbcox closed 2 years ago
Hello Gerald, thank you for the report and for using mpris-scrobbler. :)
Unfortunatelly I can't do too much about media players that don't conform to the MPRIS specification like the ones you mention. If the data format they're using is not conformant to the spec I can't load the information about the played track. In my opinion you should submit tickets with those respective players, so they improve their spec conformance. As a side comment, youtube in general doesn't provide enough meta information to be able to build a last.fm valid track submission, so even that might be for nothing.
Now, the crash you submitted to the redhat tracker happens most likely because you have installed the debug version of the scrobbler. I remember I disscused it with @jwflory before and he updated the build scripts, so if you update you should be fine.
Please let me know if updating fixes your problem.
First of all, thank you very much for the very quick response. I'd also like to express my appreciation for you having created this application. It's a great idea. I downloaded the app just a few days ago from the Fedora repositories: https://koji.fedoraproject.org/koji/buildinfo?buildID=1635213 - that was built on October 27th - and there is nothing more recent.
I can definitely work with qmmp upstream, but want to make sure that the problem is on their end first - since as I mentioned the system tray media player seems to be getting all the info from mpris correct, as does the qmmp widget in the panel.
Here are the messages from systemctl status:
ERROR mpris::failed_to_load_player_name: This message iterator must have variant type INFO mpris_player::opened[0]: org.mpris.MediaPlayer2.qmmp:1.1325
and here is the output from properties changed from the qbus viewer:
Received signal from :1.1325, path /org/mpris/MediaPlayer2, interface org.freedesktop.DBus.Properties, member PropertiesChanged
Arguments: "org.mpris.MediaPlayer2.Player", [Argument: a{sv} {"Metadata" = [Variant: [Argument: a{sv} {"mpris:artUrl" = [Variant(QString): "file:///vault/music/maluma/papi_juancho/folder.jpg"], "mpris:length" = [Variant(qlonglong): 200066000], "mpris:trackid" = [Variant: [ObjectPath: /org/qmmp/MediaPlayer2/Track/103460153]], "xesam:album" = [Variant(QString): "PAPI JUANCHO"], "xesam:albumArtist" = [Variant(QStringList): {"Maluma"}], "xesam:artist" = [Variant(QStringList): {"Maluma"}], "xesam:comment" = [Variant(QStringList): {"Interprètes : Colin Leonard, Mastering Engineer
Maluma, MainArtist, AssociatedPerformer
Edgar Barrera, Composer, Lyricist, Recording Engineer
Jowan, Producer
Kevin Mauricio Jiménez Londoño, Composer, Lyricist
Andrés Uribe Marín, Composer, Lyricist
Luis..."}], "xesam:contentCreated" = [Variant(QString): "2020"], "xesam:discNumber" = [Variant(int): 1], "xesam:genre" = [Variant(QStringList): {"Musique du monde"}], "xesam:title" = [Variant(QString): "Hawái"], "xesam:trackNumber" = [Variant(int): 3], "xesam:url" = [Variant(QString): "file:///vault/music/maluma/papi_juancho/01-03-Maluma-Hawai-SMR.flac"]}]]}], {}
Received signal from :1.1325, path /org/mpris/MediaPlayer2, interface org.freedesktop.DBus.Properties, member PropertiesChanged
Arguments: "org.mpris.MediaPlayer2.Player", [Argument: a{sv} {"Metadata" = [Variant: [Argument: a{sv} {"mpris:artUrl" = [Variant(QString): "file:///vault/music/maluma/papi_juancho/folder.jpg"], "mpris:length" = [Variant(qlonglong): 200066000], "mpris:trackid" = [Variant: [ObjectPath: /org/qmmp/MediaPlayer2/Track/1225566188]], "xesam:album" = [Variant(QString): "PAPI JUANCHO"], "xesam:albumArtist" = [Variant(QStringList): {"Maluma"}], "xesam:artist" = [Variant(QStringList): {"Maluma"}], "xesam:comment" = [Variant(QStringList): {"Interprètes : Colin Leonard, Mastering Engineer
Maluma, MainArtist, AssociatedPerformer
Edgar Barrera, Composer, Lyricist, Recording Engineer
Jowan, Producer
Kevin Mauricio Jiménez Londoño, Composer, Lyricist
Andrés Uribe Marín, Composer, Lyricist
Luis..."}], "xesam:contentCreated" = [Variant(QString): "2020"], "xesam:discNumber" = [Variant(int): 1], "xesam:genre" = [Variant(QStringList): {"Musique du monde"}], "xesam:title" = [Variant(QString): "Hawái"], "xesam:trackNumber" = [Variant(int): 3], "xesam:url" = [Variant(QString): "file:///vault/music/maluma/papi_juancho/01-03-Maluma-Hawai-SMR.flac"]}]]}], {}
Received signal from :1.1325, path /org/mpris/MediaPlayer2, interface org.freedesktop.DBus.Properties, member PropertiesChanged
Arguments: "org.mpris.MediaPlayer2.Player", [Argument: a{sv} {"Metadata" = [Variant: [Argument: a{sv} {"mpris:artUrl" = [Variant(QString): "file:///vault/music/daddy_yankee/con_calma_&_mis_grandes_Éxitos/folder.jpg"], "mpris:length" = [Variant(qlonglong): 200066000], "mpris:trackid" = [Variant: [ObjectPath: /org/qmmp/MediaPlayer2/Track/1225566188]], "xesam:album" = [Variant(QString): "Con Calma & Mis Grandes Éxitos"], "xesam:albumArtist" = [Variant(QStringList): {"Daddy Yankee"}], "xesam:artist" = [Variant(QStringList): {"Daddy Yankee"}], "xesam:contentCreated" = [Variant(QString): "2019"], "xesam:discNumber" = [Variant(int): 1], "xesam:genre" = [Variant(QStringList): {"Reggaeton"}], "xesam:title" = [Variant(QString): "Dura"], "xesam:trackNumber" = [Variant(int): 2], "xesam:url" = [Variant(QString): "file:///vault/music/daddy_yankee/con_calma_&_mis_grandes_Éxitos/02_dura.flac"]}]]}], {}
Received signal from :1.1325, path /org/mpris/MediaPlayer2, interface org.freedesktop.DBus.Properties, member PropertiesChanged
Arguments: "org.mpris.MediaPlayer2.Player", [Argument: a{sv} {"Metadata" = [Variant: [Argument: a{sv} {"mpris:artUrl" = [Variant(QString): "file:///vault/music/daddy_yankee/con_calma_&_mis_grandes_Éxitos/folder.jpg"], "mpris:length" = [Variant(qlonglong): 267980000], "mpris:trackid" = [Variant: [ObjectPath: /org/qmmp/MediaPlayer2/Track/1225566188]], "xesam:album" = [Variant(QString): "Con Calma & Mis Grandes Éxitos"], "xesam:albumArtist" = [Variant(QStringList): {"Daddy Yankee"}], "xesam:artist" = [Variant(QStringList): {"Daddy Yankee"}], "xesam:contentCreated" = [Variant(QString): "2019"], "xesam:discNumber" = [Variant(int): 1], "xesam:genre" = [Variant(QStringList): {"Reggaeton"}], "xesam:title" = [Variant(QString): "Dura"], "xesam:trackNumber" = [Variant(int): 2], "xesam:url" = [Variant(QString): "file:///vault/music/daddy_yankee/con_calma_&_mis_grandes_Éxitos/02_dura.flac"]}]]}], {}
Received signal from :1.1325, path /org/mpris/MediaPlayer2, interface org.freedesktop.DBus.Properties, member PropertiesChanged
Arguments: "org.mpris.MediaPlayer2.Player", [Argument: a{sv} {"Metadata" = [Variant: [Argument: a{sv} {"mpris:artUrl" = [Variant(QString): "file:///vault/music/daddy_yankee/con_calma_&_mis_grandes_Éxitos/folder.jpg"], "mpris:length" = [Variant(qlonglong): 267980000], "mpris:trackid" = [Variant: [ObjectPath: /org/qmmp/MediaPlayer2/Track/425953392]], "xesam:album" = [Variant(QString): "Con Calma & Mis Grandes Éxitos"], "xesam:albumArtist" = [Variant(QStringList): {"Daddy Yankee"}], "xesam:artist" = [Variant(QStringList): {"Daddy Yankee"}], "xesam:contentCreated" = [Variant(QString): "2019"], "xesam:discNumber" = [Variant(int): 1], "xesam:genre" = [Variant(QStringList): {"Reggaeton"}], "xesam:title" = [Variant(QString): "Dura"], "xesam:trackNumber" = [Variant(int): 2], "xesam:url" = [Variant(QString): "file:///vault/music/daddy_yankee/con_calma_&_mis_grandes_Éxitos/02_dura.flac"]}]]}], {}
Received signal from :1.1325, path /org/mpris/MediaPlayer2, interface org.freedesktop.DBus.Properties, member PropertiesChanged
Arguments: "org.mpris.MediaPlayer2.Player", [Argument: a{sv} {"Metadata" = [Variant: [Argument: a{sv} {"mpris:artUrl" = [Variant(QString): "file:///home/gbcox/music/abba/thank_you_for_the_music__disc_4/folder.jpg"], "mpris:length" = [Variant(qlonglong): 267980000], "mpris:trackid" = [Variant: [ObjectPath: /org/qmmp/MediaPlayer2/Track/425953392]], "xesam:album" = [Variant(QString): "Thank You For The Music - Disc 4"], "xesam:artist" = [Variant(QStringList): {"ABBA"}], "xesam:contentCreated" = [Variant(QString): "1994"], "xesam:genre" = [Variant(QStringList): {"Pop"}], "xesam:title" = [Variant(QString): "Put On Your White Sombrero"], "xesam:trackNumber" = [Variant(int): 1], "xesam:url" = [Variant(QString): "file:///home/gbcox/music/abba/thank_you_for_the_music__disc_4/01_put_on_your_white_sombrero.m4a"]}]]}], {}
OK, so I installed Qmmp on my machine, and for me it seems to be working fine, from the loading of the player name to the scrobbling of the tracks.
qmmp --version
QMMP version: 1.4.3
Compiled with Qt version: 5.15.2
Using Qt version: 5.15.2
INFO mpris_player::opened[0]: org.mpris.MediaPlayer2.qmmp:1.120
DEBUG changed::volume: yes
DEBUG changed::position: no
DEBUG changed::playback_status: yes
DEBUG changed::track: yes
...
DEBUG events::add_event:now_playing[Qmmp] in 0.000s, elapsed 0.000s
DEBUG events::add_event:queue[Qmmp] in 167.000 seconds
DEBUG events::triggered(0x7ffc8a795f40:0x7ffc8a795f48):now_playing
INFO scrobbler::now_playing[Qmmp]: Nightmare (Ranger)//Markie Music//Arena Eternal
DEBUG events::add_event:now_playing[Qmmp] in 65.000s, elapsed 0.000s
INFO api::submitted_to[listenbrainz.org:2]: ok
INFO api::submitted_to[last.fm:0]: ok
INFO api::submitted_to[libre.fm:1]: ok
Tell me, which version of Qmmp are you using?
Also, regarding the crash, I looked at the build log from the page you posted and indeed @jwflory's build script uses --buildtype=plain
instead of --buildtype=release
.
I have managed to reproduce it once (or at least, what I think is the crash) (see #81) but I am not sure when I'll release a fix for it.
I suggest we keep here the discussion about getting Qmmp working for you and there I'll update as I work on a fix. No promises for a time line, as I'm busy with another project.
I'm running the same version as you:
qmmp --version
QMMP version: 1.4.3
Compiled with Qt version: 5.15.2
Using Qt version: 5.15.2
OS: Fedora 33 (Workstation Edition) x86_64
Kernel: 5.9.16-200.fc33.x86_64
Uptime: 28 mins
Packages: 4277 (rpm), 12 (flatpak)
Shell: bash 5.0.17
Resolution: 1920x1080
DE: Plasma 5.20.4
WM: KWin
WM Theme: breeze
Theme: Breeze [Plasma], Adwaita [GTK2]
Icons: breeze [Plasma], breeze [GTK2/3]
Terminal: konsole
CPU: AMD FX-8350 (8) @ 2.085GHz
GPU: AMD ATI Radeon HD 7850 / R7 265 / R9 270 1024SP
Memory: 4766MiB / 32005MiB
As I mentioned, if I open qmmp, then systemctl restart mpris-scrobbler (while qmmp stays open), it works fine. However, if mpris-scrobbler is already running and I just open qmmp to play something, it fails with the above listed errors.
Also, if I do the following it works fine:
of course, it's not practical to do that everytime you want to play and scrobble some music.
Hopefully we can figure out what is going on.
So the crash is definitely something that @jwflory can fix in his build scripts. We must wait for him to have time for a new release.
On my side I made a couple of changes regarding #81 so it's less likely to crash even in debug mode, but I want to test some more before I tag a new version.
If you are able, could you please try compiling the scrobbler directly from git master and let me know if the crash still happens on your side? Thank you again.
I recompiled. Still same results with qmmp as far as getting it to work. Haven't seen a dump yet. Works the same as I mentioned in my previous comment. Continues to throw this error unless mpris is recycled each time qmmp is opened:
ERROR mpris::failed_to_load_player_name: This message iterator must have variant type
If there is additional debugging I can do on my side, let me know and I'll try.
I thought it might be helpful to as qmmp upstream if they had any insights. Here is the ticket: https://sourceforge.net/p/qmmp-dev/tickets/1073/
Hey @gbcox, could you use QDBusViewer
and after opening Qmmp get the value for Identity
like the following image? As you can see on my machine the value is a Variant type holding a QString, which is what the scrobbler expects. I'm not sure why it would be different for you.
I also tried starting with vvv rather than vv, and it didn't seem to make a difference in the info displayed from the status command.
Here is when mpris.scrobbler is already running and I open qmmp. I get the error messages:
ERROR mpris::failed_to_load_player_name: This message iterator must have variant type INFO mpris_player::opened[0]: org.mpris.MediaPlayer2.qmmp:1.976
and here is the display from QDBusViewer:
and if I restart mpris-scrobbler (while qmmp is still open): Here are the messages: DEBUG changed::volume: no DEBUG changed::position: no DEBUG changed::playback_status: no DEBUG changed::track: yes DEBUG events::add_event:now_playing[Qmmp] in 0.000s, elapsed 0.000s DEBUG events::add_event:queue[Qmmp] in 100.000 seconds DEBUG events::triggered(0x7fffa2cc08f0:0x7fffa2cc08f8):now_playing INFO scrobbler::now_playing[Qmmp]: Hawái//Maluma//PAPI JUANCHO DEBUG events::add_event:now_playing[Qmmp] in 65.000s, elapsed 0.000s INFO api::submitted_to[listenbrainz.org:0]: ok
Output from QDBusViewer is the same.
I decided to recompile with the debug option and see if I got any additional information. Here is the information when it will not scrobble:
mpris-scrobbler[138929]: TRACING metadata.genre changed: no
mpris-scrobbler[138929]: TRACING from: Musique du monde
mpris-scrobbler[138929]: TRACING to: Musique du monde
mpris-scrobbler[138929]: TRACING changed after 8359936
mpris-scrobbler[138929]: TRACING changed before 1024
mpris-scrobbler[138929]: TRACING playback_status changed: no: 'Stopped' - 'Stopped'
mpris-scrobbler[138929]: TRACING changed after 1024
mpris-scrobbler[138929]: INFO mpris_player::closed[0]: org.mpris.MediaPlayer2.qmmp:1.1071
mpris-scrobbler[138929]: ERROR mpris::failed_to_load_player_name: This message iterator must have variant type
mpris-scrobbler[138929]: INFO mpris_player::opened[0]: org.mpris.MediaPlayer2.qmmp:1.1073
mpris-scrobbler[138929]: Kevin Mauricio Jiménez Londoño, Composer, Lyricist
mpris-scrobbler[138929]: Andrés Uribe Marín, Composer, Lyricist
mpris-scrobbler[138929]: Luis...
mpris-scrobbler[138929]: TRACING metadata.title changed: no: 'Hawái' - 'Hawái'
mpris-scrobbler[138929]: TRACING metadata.track_number changed: no: ' 3' - ' 3'
mpris-scrobbler[138929]: TRACING metadata.url changed: no: 'file:///vault/music/maluma/papi_juancho/01-03-Maluma-Hawai-SMR.flac' - 'file:///vault/music/maluma/papi_juancho/01-03-Maluma-Hawai-SMR.f>
mpris-scrobbler[138929]: TRACING metadata.genre changed: no
mpris-scrobbler[138929]: TRACING from: Musique du monde
mpris-scrobbler[138929]: TRACING to: Musique du monde
mpris-scrobbler[138929]: TRACING changed after 8359936
and here it is when I restarted mpris while qmmp was still open:
systemd[2045]: Started daemon to scrobble tracks loaded from the MPRIS DBus interface to compatible services.
mpris-scrobbler[139741]: DEBUG main::loading_credentials: ok
mpris-scrobbler[139741]: DEBUG main::loading_config: ok
mpris-scrobbler[139741]: TRACING main::writing_pid: /run/user/1000/mpris-scrobbler.pid
mpris-scrobbler[139741]: TRACING dbus::add_match: type='signal',interface='org.freedesktop.DBus.Properties',member='PropertiesChanged',path='/org/mpris/MediaPlayer2'
mpris-scrobbler[139741]: TRACING dbus::add_match: type='signal',interface='org.freedesktop.DBus',member='NameOwnerChanged',path='/org/freedesktop/DBus'
mpris-scrobbler[139741]: TRACING events::add_event(0x56387d03d200):add_watch
mpris-scrobbler[139741]: TRACING mpris_player::namespace[0]: org.mpris.MediaPlayer2.qmmp :1.1073
mpris-scrobbler[139741]: TRACING scrobble::position: 0.00
mpris-scrobbler[139741]: TRACING scrobble::scrobbled: no
mpris-scrobbler[139741]: TRACING scrobble::track_number: 3
mpris-scrobbler[139741]: TRACING scrobble::start_time: 1609360847
mpris-scrobbler[139741]: TRACING scrobble::play_time[0.000]: 0.000
mpris-scrobbler[139741]: INFO scrobbler::now_playing[Qmmp]: Hawái//Maluma//PAPI JUANCHO
mpris-scrobbler[139741]: TRACING scrobbler::connection_init[listenbrainz.org:0:0x56387d061b70]:curl_easy_handle(0x56387d066c90)
mpris-scrobbler[139741]: DEBUG events::add_event:now_playing[Qmmp] in 65.000s, elapsed 0.000s
mpris-scrobbler[139741]: TRACING curl::transfer::done[0]: https://api.listenbrainz.org/1/submit-listens
mpris-scrobbler[139741]: INFO api::submitted_to[listenbrainz.org:0]: ok
So, from what I can see Qmmp reports correctly the player name, so the problem must be somewhere else. You probably can close the issue you opened with them.
Another possibility is that the DBus library has a bug. Can you tell me which dbus-1
version is your system running on?
pkgconf --print-provides dbus-1
dbus-1 = 1.12.20
However since the debug build didn't crash when it couldn't load the player name, I imagine the problem is actually fixed (if the logs you've posted are from latest master, I mean). The assert that was failing was modifed, and the scrobbling process works fine, the player name is loaded just for convenience.
Here is the output:
pkgconf --print-provides dbus-1
dbus-1 = 1.12.20
Yes, the build I made was from the latest master with the debug feature on. I then used the tracing option of "vvv"
The problem however is that for whatever reason, qmmp is not scrobbling IF it is started AFTER mpris-scrobbler. Is the logic flow somehow different at mpris initialization? It appears that if a player is active at the time of initialization, everything appears to work fine.
I've attached another log file, it starts showing a restart of mpris-scrobbler while qmmp is open. You can see it scrobbles fine, then I close qmmp (which you can see in the logfile) and reopen. You then can see messages about the music which is playing, but notice, no scrobbles now.
If you can think of a way I can gather additional information for you, I'll be happy to try it. In the meantime, I'm going to keep the qmmp upstream bug open - maybe he can think of something also.
Thanks for your help and patience. Very odd issue.
OK, so what I said earlier that the player name is not required seems to be false. Ooops. :D
I'll look into this new thing. I'll keep you updated.
Hi guys. I just wanted to let you know I am having a similar issue with Sublime Music player. A typical verbose output:
DEBUG main::loading_credentials: ok
DEBUG main::loading_config: ok
WARNING mpris_player::unable to load properties from message
ERROR dbus::value_error: xesam:artist, This message iterator must have array type
ERROR dbus::value_error: xesam:artist, This message iterator must have array type
INFO mpris_player::already_opened[0]: org.mpris.MediaPlayer2.sublimemusic:1.551
DEBUG changed::volume: yes
DEBUG changed::position: no
DEBUG changed::playback_status: yes
DEBUG changed::track: yes
Works fine with Strawberry and Clementine. But they both have their own scrobbling support...
EDIT: Compiling Sublime Music from the master branch seems to work fine with mpris-scrobbler so, please ignore my message. The error was present in v0.11.10, just FYI.
EDIT 2: Works but sends a listen instead of a now listening, in the end scrobbles twice. I guess this player is not MPRIS-compliant.
@gbcox hello again, after many many moons.
I have released some fixes in v0.4.99, and at least locally I don't have any more issues with qmmp. Can you take a look and get back to me if the issues are fixed for you too?
I'll be able to test the week of May 22nd. I'm accessing my server remote right now I can't get the application to recognize a player if I start it remotely. Will advise. Thanks!
Thanks @gbcox for also helping out with the Fedora package. Hopefully we can work out faster updates for Fedora repositories going forward. I've also had my hands busier than normal this year to keep up with all my Fedora packages.
No problem, happy to help!
This is resolved with 5.0. Closing.
Thanks for helping to package this update downstream @gbcox 🎉
I submitted a crash report here: https://bugzilla.redhat.com/show_bug.cgi?id=1910992 In all the examples that following, mpris seems to be working fine with the plasma media player in the systray and communicating back to the widget in the panel, but:
when I try to use Fx with youtube music, the scrobbler shows: ERROR dbus::value_error: xesam:artist, This message iterator must have array type WARNING events::invalid_scrobble INFO mpris_player::closed[1]: org.mpris.MediaPlayer2.firefox.instance3992:1.115
when I try qmmp: ERROR mpris::failed_to_load_player_name: This message iterator must have variant type INFO mpris_player::opened[1]: org.mpris.MediaPlayer2.qmmp:1.159 INFO mpris_player::closed[1]: org.mpris.MediaPlayer2.qmmp:1.159
when I try elisa, third time is charm: INFO scrobbler::now_playing[Elisa]: Hawái//Maluma//PAPI JUANCHO DEBUG events::add_event:now_playing[Elisa] in 65.000s, ellapsed 0.000s INFO api::submitted_to[listenbrainz.org:0]: ok
Now, if I turn off and then turn on mpris in qmmp, it works: DEBUG changed::volume: no DEBUG changed::position: no DEBUG changed::playback_status: no DEBUG changed::track: yes DEBUG events::add_event:now_playing[Qmmp] in 0.000s, ellapsed 0.000s DEBUG events::add_event:queue[Qmmp] in 134.000 seconds DEBUG events::triggered(0x7ffd442e5120:0x7ffd442e5128):now_playing INFO scrobbler::now_playing[Qmmp]: Put On Your White Sombrero//ABBA//Thank You For The Music - Disc 4 DEBUG events::add_event:now_playing[Qmmp] in 65.000s, ellapsed 0.000s INFO api::submitted_to[listenbrainz.org:0]: ok
but if I exit qmmp and then restart, with mpris enabled: DEBUG changed::volume: no DEBUG changed::position: no DEBUG changed::playback_status: yes DEBUG changed::track: yes INFO mpris_player::closed[0]: org.mpris.MediaPlayer2.qmmp:1.179 ERROR mpris::failed_to_load_player_name: This message iterator must have variant type INFO mpris_player::opened[0]: org.mpris.MediaPlayer2.qmmp:1.196
Then, if I stop the song playing, restart the scrobbler then start the music without exiting qmmp and restarting: DEBUG events::triggered(0x7ffc2269de40:0x7ffc2269de48):now_playing INFO scrobbler::now_playing[Qmmp]: Dura//Daddy Yankee//Con Calma & Mis Grandes Éxitos DEBUG events::add_event:now_playing[Qmmp] in 65.000s, ellapsed 0.000s INFO api::submitted_to[listenbrainz.org:0]: ok
but if I exit and restart qmmp, it again stops working with the above failures.