ungive / discord-music-presence

Rich presence for sharing your music listening activity in your Discord status. Works with any media player on your system. For Windows and Mac (and soon Linux).
https://musicpresence.app
Other
40 stars 0 forks source link

My media player is not detected (Apple Music, Windows Media Player) #20

Closed naufalkharits closed 3 weeks ago

naufalkharits commented 4 weeks ago

Players I am using, that aren't supported yet:

win_winrt: AppleInc.AppleMusicWin_nzyj5cx40ttqa!App - AppleInc.AppleMusicWin_nzyj5cx40ttqa!App (disabled)
win_winrt: Microsoft.ZuneMusic_8wekyb3d8bbwe!Microsoft.ZuneMusic - Microsoft.ZuneMusic_8wekyb3d8bbwe!Microsoft.ZuneMusic (disabled)
signature: 238418a17ce4d6ad

Media Player (by Microsoft) and Apple Music (Windows 11) weren't detected.

ungive commented 4 weeks ago

I've added the identifier you submitted for Apple Music, so Apple Music should be detected for you, after you restart Music Presence (see here).

I previously decided to not support the Windows Media Player because it could contain media other than music (like a home video that may contain personal data), which I don't want to enable by default. I only want to enable pure music players by default.

That being said, I will add support for the Windows Media Player with the next release nevertheless, but it will be disabled by default, leaving the user the option to enable it by hand, if desired.

@naufalkharits Let me know if Apple Music works for you now!

naufalkharits commented 4 weeks ago

It won't detect Discord now, shows waiting for discord status.

ungive commented 4 weeks ago

It should connect after at most ~30 seconds. Perhaps restart Discord. Make sure you are using the Discord desktop app (I assume you are). Also make sure that Music Presence is only opened once, not multiple times.

naufalkharits commented 4 weeks ago

restarted my PC, it detected both Discord and Apple Music. But, shows waiting for media playback.

image

ungive commented 4 weeks ago

Are you playing local music files?

It might be that the music you are playing does not have artist metadata. Music Presence skips all media that doesn't have an artist.

The log file would be helpful here, as it reports whenever it skips any detected media. You can find it here: C:\Users\USER\AppData\Roaming\Music Presence\presence.log

naufalkharits commented 4 weeks ago

played a song from Apple Music (bought from iTunes), I think it downloads automatically, so yah I guess it's on offline mode. I'll check the logs.

naufalkharits commented 4 weeks ago

you're right.

music-presence 2024-06-03T16:29:46.931Z INFO Skipping media from player AppleInc.AppleMusicWin_nzyj5cx40ttqa!App (AppleInc.AppleMusicWin_nzyj5cx40ttqa!App): Title "Kataomoi - From THE FIRST TAKE" is missing an artist

even tho I've deleted it from local (which I assuming it's should be on online mode now), it still shows waiting for media playback

ungive commented 4 weeks ago

Figured.

I wasn't able to fully test Apple Music because I don't have a subscription, but it seems odd to me that downloaded music from iTunes doesn't have proper song metadata. From my testing with local files (mp3) that hat proper metadata it worked just fine, so Apple Music itself is reporting it correctly, but your song files/downloads must have an empty "Artist" tag field.

Generally speaking, one might argue Music Presence shouldn't skip media that doesn't have an artist and just show it in the status anyway. I've disabled it before because I'm not able to reliably search for song metadata online with just a title, so I decided to just disable it. I might as well enable it again. Might do that in the next release.

naufalkharits commented 4 weeks ago

have tried several things but won't work, weird tho the file has fully metadata. I guess I just wait to next releases.

lemme know if I could help something.

ungive commented 3 weeks ago

You could show me what the media overlay looks like in Windows 10:

grafik

If you're on Windows 11 that information should be located here:

grafik

If there's no separation between title and artist Apple Music just reports it wrong.

naufalkharits commented 3 weeks ago

after cleanup my Apple Music (previously still mixed with the old iTunes folder, since Apple migrated from old iTunes to new Apple Music app), Windows 11 Media Player couln't detect the artwork now 😂 image

Artwork files in directory Apple Music > Apple Music Library.musiclibrary and music files in directory Apple Music > Media > Music image

tho the Apple Music media overlay looks normal same like what you sent. image

ungive commented 3 weeks ago

And the logs still say that the media you are currently playing is missing an artist?

naufalkharits commented 3 weeks ago

yes

music-presence 2024-06-04T03:41:21.554Z INFO No media players detected music-presence 2024-06-04T03:45:59.589Z INFO Skipping media from player AppleInc.AppleMusicWin_nzyj5cx40ttqa!App (AppleInc.AppleMusicWin_nzyj5cx40ttqa!App): Title "A Million Dreams" is missing an artist music-presence 2024-06-04T03:47:37.451Z INFO No media players detected music-presence 2024-06-04T03:47:37.812Z INFO No media players detected music-presence 2024-06-04T04:04:04.625Z INFO Discord: Disconnected (1): Pipe closed

ungive commented 3 weeks ago

I've tried it myself with a local MP3 file and it's not working anymore here either:

music-presence 2024-06-04T16:43:21.367Z INFO Skipping media from player Apple Music (AppleMusic.exe): Title "Ava" is missing an artist

The metadata of the mp3 file I am playing is complete (it has title and artist):

grafik

It worked before with the very same file (I haven't changed it).

If I look at the raw data from Windows it's apparent that Apple Music does not report any artist (or Windows drops the data along the way somewhere):

grafik

Yet it looks just fine with the media controls:

grafik

I haven't updated Apple Music and I've also tried it with older builds of Music Presence (previous version), to no avail.


Some more digging revealed that it's setting the "album artist" now and apparently completely omits the "artist" (?):

grafik

The data is just completely wrong now, the album artist contains the "album + artist" as a single string, even though it's meant to contain the artist of the album (see https://mkoby.com/2007/02/18/artist-versus-album-artist/).

Someone messed up at Apple it seems..

There's nothing I can do about that unfortunately. I'll see if I can report this to Apple somehow, but their application is at fault here..

ungive commented 3 weeks ago

I don't have an Apple ID and I don't intend to create one just to report this issue.

@naufalkharits You (or any other Apple user here) can consider reporting this issue to Apple by creating a bug report here: https://developer.apple.com/bug-reporting/

Here's my explanation of the issue, so you won't have to write it yourself. You can just copy paste it:

I am contacting you on behalf of an application/software developer who has experienced issues when interfacing with Apple Music for Windows through Windows system APIs. This is his explanation of the issue:

Apple Music for Windows reports music metadata (title, artist, album, playback position, etc.) to the operating system, so that other applications can see what the Apple Music media player is currently playing. I am using a low-level C++ API, called WinRT, to access that information. When I attempt to read the artist name it reports no information at all. This has worked before (a few weeks ago). Also, when I look at the "album artist" it reports e.g. "Famy - Ava" which is a combination of the album name ("Ava") and the artist name ("Famy"). This is malformed information, it should only report the artist name who worked on the album and not some combination of multiple fields.

The following low-level C++ functions (of the WinRT API) are used to retrieve this information: Artist: Windows.Media.Control.GlobalSystemMediaTransportControlsSessionMediaProperties.Artist() AlbumArtist: Windows.Media.Control.GlobalSystemMediaTransportControlsSessionMediaProperties.AlbumArtist() Documentation: https://learn.microsoft.com/en-us/uwp/api/windows.media.control.globalsystemmediatransportcontrolssessionmediaproperties?view=winrt-22621

The return value of Artist() is empty (null). The return value of AlbumArtist() is a combination of the artist and the album name. The purpose of the WinRT is to be able to access the artist and album separately, not combined in a single string. The album artist is supposed to only contain the name of the artist and nothing else.

This is a bug that should be fixed, so that other applications are able to detect what media is played in the Apple Music media player.

Link to an issue on GitHub, that explains this further: github.com/ungive/discord-music-presence/issues/20

Thank you.

Let me know if you had the time to report it to Apple!

I'll close this issue, as this is not an issue with Music Presence anymore.

naufalkharits commented 3 weeks ago

thanks for the explanation, I've reported it to Apple. but unfortunately I didn't find a category for the Windows platform (as expected tho, Apple users on other platforms are always lower class citizens), but let's see if this can find some light.

naufalkharits commented 3 weeks ago

v2.1.2 fixed the issue image

tho the artwork is still missing accurated. image image

well, somes accurated. image

ungive commented 3 weeks ago

This is expected, as an external service (MusicBrainz) is used to retrieve the album cover for the song that you're currently playing, It doesn't have all songs available and sometimes doesn't find the right song, if the song name or artist contains unexpected things like "feat. xyz" or "(Acoustic Version)".

A solution for that is being tracked in #27.