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

GST plugins 1.20.x break mopidy audio playback on intel machines #41

Open
troyxmccall opened this issue Apr 4, 2022 · 7 comments
Open

Comments

@troyxmccall
Copy link
Contributor

troyxmccall commented Apr 4, 2022

i haven't pinpointed the root cause, but running a standard brew update broke mopidy audio playblack

changes/formula updates

gst-plugins-bad (1.18.5) -> 1.20.1
gst-plugins-base (1.18.5) -> 1.20.1
gst-plugins-good (1.18.5) -> 1.20.1
gst-plugins-ugly (1.18.5) -> 1.20.1
gst-python (1.18.5) > 1.20.1
gstreamer (1.18.5) > 1.20.1

Error:

ERROR    2022-04-03 23:39:01,816 [18108:Audio-2] pykka
  Unhandled exception in Audio (urn:uuid:b91a9751-5106-48bf-b6ba-7c2fde717ad6):
Traceback (most recent call last):
  File "/usr/local/Cellar/mopidy/3.2.0/libexec/lib/python3.9/site-packages/pykka/_actor.py", line 186, in _actor_loop
    self.on_start()
  File "/usr/local/Cellar/mopidy/3.2.0/libexec/lib/python3.9/site-packages/mopidy/audio/actor.py", line 460, in on_start
    self._setup_playbin()
  File "/usr/local/Cellar/mopidy/3.2.0/libexec/lib/python3.9/site-packages/mopidy/audio/actor.py", line 481, in _setup_playbin
    playbin.set_property("flags", _GST_PLAY_FLAGS_AUDIO)
AttributeError: 'NoneType' object has no attribute 'set_property'

restoring /usr/local/bin from a snapshot with GST plugins @1.18.5 fixed playback

in the interim, I suggest NOT upgrading homebrew

@crossjam
Copy link

Just stopped by to ask if there's any suggestions for those of us latecomers to Mopidy who don't have 1.18.5 available? Can't see an easy way to downgrade on Mac OS.

@spijet
Copy link

spijet commented Jun 1, 2022

I got the same issue on an Apple Silicon machine, so it's not architecture-dependent.

The error log from Mopidy:

DEBUG    2022-06-01 10:46:38,820 [43130:MainThread] mopidy.commands
  Available Mopidy mixers: SoftwareMixer
INFO     2022-06-01 10:46:38,820 [43130:MainThread] mopidy.commands
  Starting Mopidy mixer: SoftwareMixer
DEBUG    2022-06-01 10:46:38,821 [43130:MainThread] mopidy.commands
  Mixer volume left unchanged
INFO     2022-06-01 10:46:38,821 [43130:MainThread] mopidy.commands
  Starting Mopidy audio
ERROR    2022-06-01 10:46:38,821 [43130:Audio-2] pykka
  Unhandled exception in Audio (urn:uuid:0ee60950-ce88-4b2d-ac46-29127b8254d9):
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/pykka/_actor.py", line 179, in _actor_loop
    self.on_start()
  File "/opt/homebrew/lib/python3.9/site-packages/mopidy/audio/actor.py", line 460, in on_start
    self._setup_playbin()
  File "/opt/homebrew/lib/python3.9/site-packages/mopidy/audio/actor.py", line 481, in _setup_playbin
    playbin.set_property("flags", _GST_PLAY_FLAGS_AUDIO)
AttributeError: 'NoneType' object has no attribute 'set_property'
INFO     2022-06-01 10:46:38,821 [43130:MainThread] mopidy.commands
  Starting Mopidy backends: FileBackend, M3UBackend, StreamBackend, SubidyBackend

...

ERROR    2022-06-01 10:46:50,067 [43130:Core-7] mopidy.core.playback
  SubidyBackend backend caused an exception.
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/mopidy/core/playback.py", line 350, in _change
    if not backend.playback.change_track(pending_tl_track.track).get():
  File "/opt/homebrew/lib/python3.9/site-packages/pykka/_threading.py", line 55, in get
    raise exc_value
  File "/opt/homebrew/lib/python3.9/site-packages/pykka/_actor.py", line 186, in _actor_loop
    response = self._handle_receive(envelope.message)
  File "/opt/homebrew/lib/python3.9/site-packages/pykka/_actor.py", line 286, in _handle_receive
    return callee(*message.args, **message.kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/mopidy/backend.py", line 318, in change_track
    self.audio.set_uri(
  File "/opt/homebrew/lib/python3.9/site-packages/pykka/_threading.py", line 55, in get
    raise exc_value
  File "/opt/homebrew/lib/python3.9/site-packages/pykka/_ref.py", line 106, in ask
    raise ActorDeadError(f"{self} not found")
pykka._exceptions.ActorDeadError: Audio (urn:uuid:0ee60950-ce88-4b2d-ac46-29127b8254d9) not found
WARNING  2022-06-01 10:46:50,069 [43130:Core-7] mopidy.core.tracklist
  Track is not playable: subidy:song:tr-45080

@troyxmccall
Copy link
Contributor Author

hey @crossjam @spijet

I don't have an ETA on this fix, a lot of Open Source projects I contribute to are on life-support, and sadly, I don't have the time work on even 5% of the outstanding issues.

My suggestion would be to look into building/running your own Mopidy Docker image with pulseaudio running as a brew service in the interim

these might help you get started:

https://github.com/troyxmccall/pulseaudio-macos

https://github.com/jaedb/Iris/blob/master/Dockerfile

You're also more than welcome to fork this repo and build your own bottles/tap for GST 1.18

@crossjam
Copy link

No worries @troyxmccall ! Thanks for your previous Open Source contributions. Just saw a recent update of the gst libs on homebrew. Maybe that'll be the fix. 🤞

@2e0byo
Copy link

2e0byo commented Jul 21, 2022

The problem seems to be that gstreamer somehow doesn't know where to look for plugins when called from within python, i.e. it's an env problem. See this SO question.

Setting the env var GST_PLUGIN_PATH fixes it (at least for me):

gst-inspect-1.0 playbin | grep Filename # to get the filename
GST_PLUGIN_PATH=/usr/local/lib/gstreamer-1.0/ mopidy

This is probably an upstream issue, but I don't know what the expectation is with load paths and python, and I barely know the gstreamer ecosystem.

For the time being a fix would be just to set the env var in the mopidy script installed by this repo.

@crossjam
Copy link

@2e0byo Thanks much! It's been a while since I got stuck into this but even a cursory attempt seems to improve things. I can actually do a mopidy local scan successfully.

@crossjam
Copy link

Can now also confirm that appropriately setting the GST_PLUGIN_PATH environment variable allows for proper audio playback. Here's what I did on my M1 MacBook Air (YMMV):

export GST_PLUGIN_PATH=/opt/homebrew/lib/gstreamer-1.0/

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

4 participants