Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foobar2000 does not report accurate playback information to Windows (Read 2015 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foobar2000 does not report accurate playback information to Windows

On Windows foobar2000 is not reporting some important song metadata to the operating system, mainly:
  • the name of the album
  • the current playback timestamp (how much of the song has played)
  • the duration of the song (how long the song is)

While you can't observe this with the media control overlay in Windows, you can by reading the values that foobar2000 reports with WinRT. I have created an example repository with which you can test this yourself: https://github.com/ungive/media-session-dump. Compile this with MSVC (the CMakeLists.txt should make that straightforward) and observe something like the following output:

Code: [Select]
player:   foobar2000.exe
title:    Normal Fühlen
artist:   Madeline Juno
album:    <empty>
position: 0ms (-11644473600000ms)
duration: 0ms

This data is important for me because I have developed an application to show a Discord Rich Presence which makes use of the data that foobar2000 reports to the operating system (I'm not using the foobar2000 plugin/component). My application works for any media player, not just foobar2000, and foobar appears with way less information in the Discord status because of this issue, which is a negative point for some users. You can find my application here: https://github.com/ungive/discord-music-presence

Regardless, fixing this makes foobar2000 more accessible for other use cases as well.

I hope this can get resolved in a future version of foobar2000! (I have tested this with version v2.1.6 and v2.2 preview 2024-09-11)

Kind regards,
Jonas

Re: foobar2000 does not report accurate playback information to Windows

Reply #1
I'm interesting in seeing this fixed as the possibility for developers to grab now playing details in this way could be interesting, especially when some programs like Rainmeter grab the album information this way iirc.


Re: foobar2000 does not report accurate playback information to Windows

Reply #3
Developers can do pretty much anything they want with the foobar2000 SDK.

https://www.foobar2000.org/SDK

Just as a quick note, my request is about fixing a bug/a problem with an already existing feature of fb2k, not extending it with features it doesn't have. I don't see how the SDK can help in fixing the problem, unless you're suggesting to reimplement this feature from the ground up?



Re: foobar2000 does not report accurate playback information to Windows

Reply #5
My assumption is that "Windows Universal Volume Control" is synonymous with "SMTC" (SystemMediaTransportControls), since SMTC can be used to read the information that foobar2000 reports. I'm not sure what you mean with misleading, the setting name indicates to me it integrates with Windows to report what it's currently playing and that's what it does, just with some missing information.

Anyway, I've gone ahead now and forked the old foo_mediacontrol plugin, compiled it using the newest foobar2000 SDK and added reporting of the current timeline position and song duration.

You can find the source code and binary releases here: https://github.com/ungive/foo_mediacontrol

This is what it ends up looking on Discord if you use Music Presence



In my personal opinion foobar2000 should be fixed to report the additional missing information, so a plugin like this becomes obsolete.

This is what foo_mediacontrol reports with my changes:
Code: [Select]
AppUserModelId: foobar2000.exe
Title: Closer
Artist: The Chainsmokers, Halsey
AlbumTitle: Closer
PlaybackStatus: Playing
Position: 14865ms
Position (live): 189885ms
LastUpdatedTime: 1728647744095ms
StartTime: 0ms
EndTime: 244960ms
EndTime - StartTime (duration): 244960ms
MinSeekTime: 0ms
MaxSeekTime: 244960ms
MaxSeekTime - MinSeekTime (duration): 244960ms

And this is what foobar2000 with "Windows Universal Volume Control" reports for that song:
Code: [Select]
AppUserModelId: foobar2000.exe
Title: Closer
Artist: The Chainsmokers, Halsey
AlbumTitle: <empty>
PlaybackStatus: Playing
Position: 0ms
Position (live): 13373121716571ms
LastUpdatedTime: -11644473600000ms
StartTime: 0ms
EndTime: 0ms
EndTime - StartTime (duration): 0ms
MinSeekTime: 0ms
MaxSeekTime: 0ms
MaxSeekTime - MinSeekTime (duration): 0ms