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

When started, chromecast_mpris mutes my Chromecast sometimes #7

Open
logix2 opened this issue Feb 17, 2021 · 5 comments
Open

When started, chromecast_mpris mutes my Chromecast sometimes #7

logix2 opened this issue Feb 17, 2021 · 5 comments

Comments

@logix2
Copy link

logix2 commented Feb 17, 2021

When starting chromecast_mpris, it sometimes (most times, but not always) mutes my Chromecast. I also get this when I run it (but this is also shown when it doesn't mute my Chromecast, so it shouldn't be related, but I'll post it here anyway, in case it helps), but it doesn't prevent chromecast_mpris from working:

chromecast_mpris
/usr/lib/python3/dist-packages/gi/overrides/GLib.py:123: Warning: g_variant_builder_end: assertion 'GVSB(builder)->offset >= GVSB(builder)->min_items' failed
  return builder.end()
ERROR:pydbus.registration:Exception while handling org.freedesktop.DBus.Properties.GetAll()
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pydbus/registration.py", line 81, in call_method
    result = method(*parameters, **kwargs)
  File "/usr/lib/python3/dist-packages/pydbus/registration.py", line 110, in GetAll
    ret[local] = GLib.Variant(type, getattr(self.object, local))
  File "/usr/lib/python3/dist-packages/gi/overrides/GLib.py", line 190, in __new__
    v.format_string = format_string
AttributeError: 'NoneType' object has no attribute 'format_string'

I'm using Ubuntu 20.10 with GNOME 3.38.2.

[[Edit]] One more thing: when casting something, e.g. YouTube, there's no volume slider in the Mpris Indicator Button I'm using on my GNOME Shell desktop. However, when I close the Chromecast application, the volume slider appears in Mpris Indicator Button, and it allows controlling the Chromecast volume with no issues.

@alexdelorenzo
Copy link
Owner

alexdelorenzo commented Mar 12, 2021

Hi @logix2, thanks for including logs with your bug report. Can you provide the output of the following two commands?

$ python3 --version
$ python3 -m pip show chromecast_mpris mpris_server PyGObject pydbus

@logix2
Copy link
Author

logix2 commented Mar 12, 2021

Sure:

$ python3 --version

Python 3.8.6
$ python3 -m pip show chromecast_mpris mpris_server PyGObject pydbus

Name: chromecast-mpris
Version: 0.7.3
Summary: 📺 Control Chromecasts from Linux and D-Bus
Home-page: https://github.com/alexdelorenzo/chromecast_mpris
Author: Alex DeLorenzo
Author-email: None
License: AGPL-3.0
Location: /home/logix/.local/lib/python3.8/site-packages
Requires: PyChromecast, pydbus, click, PyGObject, mpris-server
Required-by: 
---
Name: mpris-server
Version: 0.2.16
Summary: Publish a MediaPlayer2 MPRIS device to D-Bus.
Home-page: https://alexdelorenzo.dev
Author: Alex DeLorenzo
Author-email: None
License: AGPL-3.0
Location: /home/logix/.local/lib/python3.8/site-packages
Requires: unidecode, pydbus, PyGObject, emoji
Required-by: chromecast-mpris
---
Name: PyGObject
Version: 3.38.0
Summary: Python bindings for GObject Introspection
Home-page: https://pygobject.readthedocs.io
Author: James Henstridge
Author-email: james@daa.com.au
License: GNU LGPL
Location: /usr/lib/python3/dist-packages
Requires: pycairo
Required-by: mpris-server, chromecast-mpris, terminator, screenkey
---
Name: pydbus
Version: 0.6.0
Summary: Pythonic DBus library
Home-page: https://github.com/LEW21/pydbus
Author: Linus Lewandowski
Author-email: linus@lew21.net
License: LGPLv2+
Location: /usr/lib/python3/dist-packages
Requires: 
Required-by: mpris-server, chromecast-mpris, key-mapper

@alexdelorenzo
Copy link
Owner

alexdelorenzo commented Mar 20, 2021

Thanks, @logix2

As for the second bug, I've introduced an update to a chromecast_mpris dependency, mpris_server, that should address the bug that's causing this error:

AttributeError: 'NoneType' object has no attribute 'format_string'

You can install it like so:

$ python3 -m pip install mpris_server==0.2.17

Ignore the pip warning about chromecast_mpris requiring version 0.2.16 of the library.

As for the first bug that causes muting, I'm having trouble reproducing it myself. If you run:

$ python3 -m chromecast_mpris --log-level debug | tee > debug_log.txt

and leave it running until you encounter the bug again, it might be able to tell us more about what's causing it.

Desktops like Plasma or GNOME might trigger a pause or a mute command via D-Bus and MPRIS, for example when I shut my laptop's lid Plasma tells MPRIS devices to pause, which pauses my Chromecast. This bug might be related to that, as well.

@logix2
Copy link
Author

logix2 commented Mar 23, 2021

There's no version 0.2.17 though:

ERROR: Could not find a version that satisfies the requirement mpris_server==0.2.17 (from versions: 0.0.2, 0.0.3, 0.1.0, 0.1.1, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.1.7, 0.1.8, 0.2.0, 0.2.1, 0.2.2, 0.2.4, 0.2.7, 0.2.8, 0.2.11, 0.2.12, 0.2.14, 0.2.16)
ERROR: No matching distribution found for mpris_server==0.2.17

@alexdelorenzo
Copy link
Owner

@logix2, sorry about that, I didn't push the update to PyPI. It's there now, though.

If you're still getting AttributeError after updating mpris_server, share a link to whatever media is triggering it that way I can debug it further.

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

No branches or pull requests

2 participants