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

Bug: Media Player is_volume_muted #100

Open
2 of 4 tasks
TarheelGrad1998 opened this issue Jun 7, 2024 · 10 comments
Open
2 of 4 tasks

Bug: Media Player is_volume_muted #100

TarheelGrad1998 opened this issue Jun 7, 2024 · 10 comments
Labels
bug Something isn't working fixed in beta fix for this issue/request is already present in one of the beta versions
Milestone

Comments

@TarheelGrad1998
Copy link

Please make sure that the issue you're planning to report is not already registered :)


Describe the bug
For some reason, the is_volume_muted attribute of the media player entity does not update. The numeric volume_level however updates just fine. The separate sensor (audio_default_device_muted) does update however with some delay. I'm not sure if this is a bug or if it is something with my config. As a result, when I call the mute service it is always a toggle (and ignores the is_volume_muted parameter value), sometimes resulting in an undesired state.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
is_volume_muted attribute is updated in near real time.

Screenshots
If applicable, add screenshots to help explain your problem.

Misc info (please complete the following information):

  • Windows build (ideally screenshot/info of winver.exe output):
  • Windows' UI language:
  • HASS.Agent version:

Please check what's applicable (multiple answers possible):

  • Installed via installer
  • Installed manually
  • Problem occurs in HASS.Agent
  • Problem occurs in Satellite Service

Additional context
Add any other context about the problem here.

Logs
If possible, please provide the logs of HASS.Agent and - if applicable - the Satellite Service. You can find HASS.Agent's logs by going to the main window, then Configuration -> Logging -> open logs folder. The Satellite Service's logs are in the same window, but the Satellite Service tab -> open service logs folder.

@amadeo-alex
Copy link
Collaborator

Fixed in 2.1.0-beta2 that will be released in a matter of days.

@amadeo-alex amadeo-alex added this to the 2.1.0-beta2 milestone Jun 16, 2024
@TarheelGrad1998
Copy link
Author

I've just been setting my volume to 0 as a workaround, but finally tried the new beta. This still doesn't update for me, and now it seems neither does the volume level. It is always reported as 0, which breaks my workaround. :(

@TarheelGrad1998
Copy link
Author

It would have been nice if it were fixed, but I guess it's not going to be. Nice.

@amadeo-alex
Copy link
Collaborator

I'm sorry, I've missed your comment but I don't think I deserve the cynism.
Issue was closed since I closed the 2.1.0 milestone, I'll reopen it and take a deeper look tomorrow.

@amadeo-alex amadeo-alex reopened this Sep 29, 2024
@amadeo-alex amadeo-alex modified the milestones: 2.1.0, 2.1.1 Sep 29, 2024
@amadeo-alex
Copy link
Collaborator

I've just been setting my volume to 0 as a workaround, but finally tried the new beta. This still doesn't update for me, and now it seems neither does the volume level. It is always reported as 0, which breaks my workaround. :(

I've just tested on the 2.1.0 version and (delay between action-reaction is a bit less than one second):

  • muting/unmuting the sound in Windows : media player in HA is updated accordingly
  • muting/unmuting the HA media player causes Windows default device to get muted/unmuted
  • moving the volume slider to 0 on Windows causes the media player to be muted (setting any volume has opposite reaction of course)
  • moving the HA media player volume slider (while something is playing) to 0 causes the volume on Windows' to be set to 0 but not muted
  • moving the HA media player volume slider (while nothing is playing) to 0 does not have any action on Windows (that' not intuitive at all and I need to fix it in one of the patch versions)

With exception of the last one, that I think is a "new bug", is there anything not working for you?

@TarheelGrad1998
Copy link
Author

I just retested with 2.1.0 and my results match yours.

Long explanation: I had used the "set volume to 0" as a workaround for when muting wasn't working. I tested the beta-2 and neither muting nor the "set to 0" workaround worked for me. When I updated to 2.1.0 my "set to 0" workaround still wasn't working so I assumed none of it was. As it turns out, muting is working now so I've switched my automations to using that again. Thanks!

The only other oddness is calling the media_player.volume_mute is always a toggle regardless of what is passed for is_volume_muted. But it's easy to work around that by just checking the state before calling it. This may be a HA issue not a HASS.Agent issue, though.

@TarheelGrad1998
Copy link
Author

Hrm, then this morning, I decided to try to simplify my automations, and is_volume_muted was not updating. Based on the previous testing, I started playing a video in YouTube, and it did immediately update. It still updates as well if the YT video is paused. Once I closed YouTube, the sensor is not updating. I believe I did have a video up and paused during testing yesterday.

So the whole issue may be related to whether there is active media?

@amadeo-alex
Copy link
Collaborator

amadeo-alex commented Oct 12, 2024

Sorry for the delay.
So starting with

The only other oddness is calling the media_player.volume_mute is always a toggle regardless of what is passed for is_volume_muted.

Let me have a look, maybe at least I'll be able to verify where the issue is - although my hunch is on HASS.Agent or HASS.Agent integration.

It still updates as well if the YT video is paused. Once I closed YouTube, the sensor is not updating. I believe I did have a video up and paused during testing yesterday.

So the whole issue may be related to whether there is active media?

Yup, also something I noticed although this is purely "windows quirk". I'm still thinking if/how to approach this to be honest, maybe as part of the integration rewrite we could add a functionality to mute system when someone tries to mute "media player" but no media (from window's API perspective) is playing. Not 100% sure on that yet though.

@amadeo-alex
Copy link
Collaborator

Sorry for the delay. So starting with

The only other oddness is calling the media_player.volume_mute is always a toggle regardless of what is passed for is_volume_muted.

Let me have a look, maybe at least I'll be able to verify where the issue is - although my hunch is on HASS.Agent or HASS.Agent integration.

It still updates as well if the YT video is paused. Once I closed YouTube, the sensor is not updating. I believe I did have a video up and paused during testing yesterday.

So the whole issue may be related to whether there is active media?

Yup, also something I noticed although this is purely "windows quirk". I'm still thinking if/how to approach this to be honest, maybe as part of the integration rewrite we could add a functionality to mute system when someone tries to mute "media player" but no media (from window's API perspective) is playing. Not 100% sure on that yet though.

Let me have a look, maybe at least I'll be able to verify where the issue is - although my hunch is on HASS.Agent or HASS.Agent integration.

Both HASS.Agent itself and integration are at fault, looks like when it was originally coded the idea was to always toggle.
I'll work on the fix.

@amadeo-alex
Copy link
Collaborator

Ok, I have POC ready and working (changes in both HASS.Agent and integration).
I'll probably put this as part of beta2 of HASS.Agent and next release of integration that will also try to fix #178

@amadeo-alex amadeo-alex added the fixed in beta fix for this issue/request is already present in one of the beta versions label Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in beta fix for this issue/request is already present in one of the beta versions
Projects
None yet
Development

No branches or pull requests

2 participants