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

D-Bus wrong volume output #2741

Closed
YodaEmbedding opened this issue Sep 3, 2017 · 3 comments · Fixed by #3513
Closed

D-Bus wrong volume output #2741

YodaEmbedding opened this issue Sep 3, 2017 · 3 comments · Fixed by #3513

Comments

@YodaEmbedding
Copy link

YodaEmbedding commented Sep 3, 2017

When the volume is at exactly 0% or 100%, the following command:

qdbus org.mpris.MediaPlayer2.google-play-music-desktop-player \
      /org/mpris/MediaPlayer2 \
      org.mpris.MediaPlayer2.Player.Volume

outputs the raw byte 0x01:

Expected behavior is of course either the string 0 or 1, respectively.

All other numbers between 0 and 1 are outputted correctly.

@MarshallOfSound
Copy link
Owner

@jostrander Is this one of those weird int type issues from the node-dbus library?

@jostrander
Copy link
Collaborator

This is probably related, but I don't have my ubuntu machine anymore to test on.

@fcastilloec
Copy link

fcastilloec commented Dec 19, 2017

This is indeed an upstream bug on node-dbus because of int types. On Headset we just add 1e-15 to the volume so neither a 0 or 1 are ever sent to MPRIS. In other words it would look something like this:

if (volume === 0) {
  mprisPlayer.volume = volume + 1e-15;
} else if (volume === 1) {
  mprisPlayer.volume = volume - 1e-15;
} else {
  mprisPlayer.volume = volume;
}

This code doesn't affect the volume output. Of course, we can use any value but on my tests 1e-15 is the smallest value I can use before node rounds it up to a 0 or 1

acrisci added a commit to acrisci/Google-Play-Music-Desktop-Player-UNOFFICIAL- that referenced this issue Mar 5, 2019
Update the mpris-service dependency to the latest version. This update
should fix many of the outstanding issues with the GPMDP mpris
implementation.

fixes MarshallOfSound#2741
acrisci added a commit to acrisci/Google-Play-Music-Desktop-Player-UNOFFICIAL- that referenced this issue Mar 7, 2019
Update the mpris-service dependency to the latest version. This update
should fix many of the outstanding issues with the GPMDP mpris
implementation.

fixes MarshallOfSound#2741
acrisci added a commit to acrisci/Google-Play-Music-Desktop-Player-UNOFFICIAL- that referenced this issue Mar 7, 2019
Update the mpris-service dependency to the latest version. This update
should fix many of the outstanding issues with the GPMDP mpris
implementation.

fixes MarshallOfSound#2741
MarshallOfSound pushed a commit that referenced this issue Mar 19, 2019
Update the mpris-service dependency to the latest version. This update
should fix many of the outstanding issues with the GPMDP mpris
implementation.

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

Successfully merging a pull request may close this issue.

4 participants