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

CoreFoundation error on OS X #14

Closed
jodal opened this Issue Aug 14, 2010 · 9 comments

Comments

1 participant
@jodal
Member

jodal commented Aug 14, 2010

Both when using the OS X-bundled Python 2.6 and Homebrew's Python 2.7 I get the following error:

DEBUG    2010-08-14 13:15:11,782 [28425:MainThread] mopidy.frontends.mpd.server
  Input from [::ffff:10.37.3.10]:55068: playid "-1"
DEBUG    2010-08-14 13:15:11,782 [28426:MainThread] mopidy.backends.libspotify.playback
  Setting output state to READY ...
The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug.

Mopidy version: jodal/mopidy@da2a44f
Pyspotify version: jodal/pyspotify@e0a5fea4c008c325e06653afc2416d8ae6f9682b
Libspotify version: 0.0.4
Python versions: 2.6.1 from OS X and 2.7.0 from Homebrew

This problem seems similar to http://github.com/ask/celery/issues/issue/146.

@jodal

This comment has been minimized.

Member

jodal commented Aug 21, 2010

If the changes discussed in http://bugs.python.org/issue8713 had been available, it would solve this issue.

We use multiprocessing.Process to create subprocesses, which are done with fork() on Linux. If we could have forced multiprocessing to use exec(), then gstreamer would have access to CoreFoundation.

@jodal

This comment has been minimized.

Member

jodal commented Aug 21, 2010

I'm planning on moving GStreamerProcess into a thread in the main process to solve this issue.

@jodal

This comment has been minimized.

Member

jodal commented Aug 22, 2010

Work on this issue is to be found in the feature/threads-not-processes branch.

Current state of the branch:

  • Everything runs in threads in a single process. Threads subclasses multiprocessing.dummy.Process instead of threading.Thread, as this makes multiprocessing.Queue use automatically "safe".
  • The GStreamer + CoreFoundation problems on OS X is gone.
  • New GStreamer problems has arisen (i.e. pipeline problems), but this is probably mostly related to the GStreamer installation on the machine.
  • Old segfaults when e.g. doing libspotify searches are back.

In other words this is far from done and will be merged in 0.1.1 or more probably 0.2.0.

@jodal

This comment has been minimized.

Member

jodal commented Aug 27, 2010

The feature/threads-not-process branch has been merged into develop as of rev 71014be.

There are no know regressions on Ubuntu due to the merging of this branch.

The two last items in the previous comment are still valid for OS X. In other words, GStreamer pipeline errors and segfaults at libspotify search are still present at OS X, but the CoreFoundation issue has been resolved.

@jodal

This comment has been minimized.

Member

jodal commented Oct 16, 2010

The segfaults when doing libspotify searches are fixed by the pyspotify patch in http://github.com/winjer/pyspotify/issues/#issue/1 in combination with 4284366.

@jodal

This comment has been minimized.

Member

jodal commented Oct 17, 2010

The only remaining issue here is the GStreamer problems:

jodal@iota:~/dev/mopidy:develop$ GST_DEBUG_NO_COLOR=1 GST_DEBUG=2 python mopidy
INFO     -- Starting Mopidy --
** Message: pygobject_register_sinkfunc is deprecated (GstObject)
INFO     Mopidy uses SPOTIFY(R) CORE
INFO     MPD server running at [::]:6600
INFO     Connected to Last.fm
INFO     Connected to Spotify
INFO     MPD client connection from [::ffff:10.37.3.10]:57006
INFO     MPD client connection from [::ffff:10.37.3.10]:57007
INFO     MPD client connection from [::ffff:10.37.3.10]:57008
INFO     MPD client connection from [::ffff:10.37.3.10]:57009
INFO     MPD client connection from [::ffff:10.37.3.10]:57010
INFO     MPD client connection from [::ffff:10.37.3.10]:57011
INFO     MPD client connection from [::ffff:10.37.3.10]:57012
0:00:14.401201000  3288    0x104209980 WARN           basetransform gstbasetransform.c:2073:gst_base_transform_handle_buffer:<convert> error: not negotiated
0:00:14.401236000  3288    0x104209980 WARN           basetransform gstbasetransform.c:2073:gst_base_transform_handle_buffer:<convert> error: not negotiated
0:00:14.401293000  3288    0x104209980 WARN                 basesrc gstbasesrc.c:2550:gst_base_src_loop:<src> error: Internal data flow error.
0:00:14.401304000  3288    0x104209980 WARN                 basesrc gstbasesrc.c:2550:gst_base_src_loop:<src> error: streaming task paused, reason not-negotiated (-4)
ERROR    Element doesn't implement handling of this stream. Please file a bug. gstbasetransform.c(2073): gst_base_transform_handle_buffer (): /GstPipeline:pipeline0/GstAudioConvert:convert:
not negotiated

Accidently, this is the exact same error as we see on Ubuntu 10.10 in issue #24. Thus, fixing this will fix Mopidy support on both Ubuntu 10.10 and OS X.

@jodal

This comment has been minimized.

Member

jodal commented Oct 18, 2010

After the fix for #24 was applied, Mopidy on OS X gets a step further and fails on this when trying to play a track:

jodal@iota:~/dev/mopidy:develop$ GST_DEBUG_NO_COLOR=1 GST_DEBUG=2 python mopidy
INFO     -- Starting Mopidy --
** Message: pygobject_register_sinkfunc is deprecated (GstObject)
INFO     Mopidy uses SPOTIFY(R) CORE
INFO     Connected to Last.fm
INFO     MPD server running at [::]:6600
INFO     Connected to Spotify
INFO     MPD client connection from [::ffff:10.37.3.10]:48601
0:00:52.278484000 15391    0x104737370 WARN           basetransform gstbasetransform.c:1065:gst_base_transform_acceptcaps_default:<volume> transform could not transform 0x10098a240 in anything we support
Segmentation fault
@jodal

This comment has been minimized.

Member

jodal commented Oct 21, 2010

I'm marking this bug as resolved in the develop branch, as the original issue has been solved. I'll open a new bug report for the current issue blocking OS X support.

@jodal

This comment has been minimized.

Member

jodal commented Oct 24, 2010

This is fixed in 0.2.0. Closing.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment