AVplayer#currentTime unrecognized runtime type `{?=qiIq}' (TypeError)

257 views
Skip to first unread message

Jordan Maguire

unread,
Feb 18, 2013, 3:31:55 AM2/18/13
to rubym...@googlegroups.com
Hi guys,

I'm experiencing what I think is a RubyMotion issue when trying to use the AVPlayer#currentTime function.

Calling currentTime on an AVPlayer instance causes this error to occur:

#<TypeError: unrecognized runtime type `{?=qiIq}'>

From the docs I can tell it should be returning a CMTime object. CMTime objects behave fine in my app so far. I am including the CoreMedia framework which is required by CMTime

There's some discussion of the issue in another post here on the RubyMotion google group, which doesn't have any solution for my problem.

There was an issue raised in SugarCube outlining this issue. I am not using SugarCube, and no solution is posted in that thread. One of the dudes who was experiencing this issue knocked up a repo that demos the error.

Anyway. If anyone has seen this error or an error like it let me know. Otherwise, I'll ask the RubyMotion dudes and post a solution in this thread when there is one.

Thanks,
Jordan

Colin T.A. Gray

unread,
Feb 18, 2013, 11:19:25 AM2/18/13
to rubym...@googlegroups.com
I was finally able to reproduce the sugarcube compilation error, and my "fix" was to avoid the issue altogether by using `send` instead of `duration=`.  Not much help to you, I think.

--
 
---
You received this message because you are subscribed to the Google Groups "RubyMotion - Ruby for iOS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubymotion+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jordan Maguire

unread,
Feb 25, 2013, 3:56:12 AM2/25/13
to rubym...@googlegroups.com
So I've sent a support request to the RubyMotion team.

I'll update this thread with any movement on the issue.

Joffrey Jaffeux

unread,
Feb 25, 2013, 5:47:56 AM2/25/13
to rubym...@googlegroups.com
Hi jordan,

I can't find your ticket in the RM support tool, can you give me the id please ?

Jordan Maguire

unread,
Feb 25, 2013, 5:57:39 AM2/25/13
to rubym...@googlegroups.com
Hi Joffrey

I logged the request using `motion support` on the command line about 2 hours ago. When I submitted the request, I wasn't given an id that I could see, it just said that I would be sent a follow up email.

I can try again if you want.

Joffrey Jaffeux

unread,
Feb 25, 2013, 2:58:47 PM2/25/13
to rubym...@googlegroups.com
Please retry as we haven't received anything from you, may be something wrong during the request, I guess it's working as we are receiving some requests from other users :)

Jordan Maguire

unread,
Feb 25, 2013, 8:50:03 PM2/25/13
to rubym...@googlegroups.com
Hey,

I tried again and it looks like the issue is not in the tracker still: http://hipbyte.myjetbrains.com/youtrack/issues/RM?p=0&f=false

I used motion support to log it. When the form was submitted it returned with: "Thank you for reporting a problem. Your support ticket has successfully been submitted. We will get back to you shortly at your_email_address."

Anyway - maybe you could submit a request for me if you have access to do so -

Here's the body of the request I sent:

"AVPlayer#currentTime throws an error.

You can reproduce this error easily by running rake in a new motion project and calling `AVPlayer.alloc.init.currentTime`. This should return a CMTime object according to the docs but instead exceptions with:

(main)> AVPlayer.alloc.init.currentTime
2013-02-26 09:44:37.612 Vu[2985:c07] unrecognized runtime type `{?=qiIq}' (TypeError)
=> #<TypeError: unrecognized runtime type `{?=qiIq}'>


Environment: OSX 10.8.2, RubyMotion 1.32, Xcode 4.5.2

Let me know how you want to proceed.

Daniel Dickison

unread,
Feb 26, 2013, 1:04:28 AM2/26/13
to rubym...@googlegroups.com
Are you including the AVFoundation framework?  That's where AVPlayer is defined.

Jordan Maguire

unread,
Feb 26, 2013, 1:46:11 AM2/26/13
to rubym...@googlegroups.com
Hi Daniel,

Sure am! All of AVPlayer works that I've seen except for that one function.

Daniel Dickison

unread,
Feb 26, 2013, 2:07:18 AM2/26/13
to rubym...@googlegroups.com
Gotcha. For what it's worth, we are doing CMTimeGetSeconds(@player.currentTime) and it is working fine. @player is instantiated earlier as AVQueuePlayer.alloc.init. Perhaps passing the value directly to CMTimeGetSeconds gets around some sort of Ruby-ObjC bridging issue?

Jordan Maguire

unread,
Feb 27, 2013, 1:46:19 AM2/27/13
to rubym...@googlegroups.com
Strange - Daniel what version of RubyMotion do you have installed currently?

These are the frameworks I have installed

  # These frameworks are required for Facebook-iOS-DSK
  app.weak_frameworks += %w(Accounts AdSupport Social)
  # These frameworks are required for audio
  app.frameworks += %w(AVFoundation MediaPlayer CoreMedia)

  # Required for ViewDeck
  app.frameworks += %w(QuartzCore)

Daniel Dickison

unread,
Feb 27, 2013, 10:23:26 AM2/27/13
to rubym...@googlegroups.com
1.33, but it was also working before the recent update (I guess 1.32). Not sure if it'll help, but here's our frameworks list:
app.frameworks += ['AVFoundation', 'MediaPlayer']
> You received this message because you are subscribed to a topic in the Google Groups "RubyMotion - Ruby for iOS" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubymotion/AayQT5ZcmgY/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to rubymotion+...@googlegroups.com.

colinta

unread,
Feb 27, 2013, 10:46:04 AM2/27/13
to rubym...@googlegroups.com
Try adding 'CoreMedia.framework' to app.frameworks, that's where CMTime is defined.

Is there a repo that reproduces this error?  I created https://github.com/colinta/cmtime-bug to try and recreate it, but it is compiling correctly for me. :-/

Also, there was an issue with `motion support` that has been worked out, and we're importing tickets that were submitted manually.  I'll make sure this one gets some eyeballs on it.  Watson is looking into it now, but he is also not able to reproduce it yet.

#colinta

Francis Chong

unread,
Feb 27, 2013, 12:04:10 PM2/27/13
to rubym...@googlegroups.com
This is a known issue: http://hipbyte.myjetbrains.com/youtrack/issue/RM-36

Adding CoreMedia to the project is working for me, in your Rakefile add following:

  app.frameworks << 'CoreMedia'

Colin T.A. Gray

unread,
Feb 27, 2013, 12:43:59 PM2/27/13
to rubym...@googlegroups.com
@Jordan - I just noticed you already posted a repo to show this!  I'll pass this on to the team.

Jordan Maguire

unread,
Feb 27, 2013, 6:22:05 PM2/27/13
to rubym...@googlegroups.com
Hi all,

Thanks for your help so far.

I'm already including CoreMedia as a framework. Here's what the output of my `rake config` includes:

frameworks             : ["CoreGraphics", "Foundation", "UIKit", "CoreLocation", "QuartzCore", "AVFoundation", "MediaPlayer", "CoreMedia", "QuartzCore"]

I can access CMTime normally outside of this one function. For example: I can set the time of the AVPlayer with the AVPlayer#seekToTime function.

Interestingly enough, the AVPlayer#addPeriodicTimeObserverForInterval:queue:usingBlock: works, and can be used to asynchronously check the time of the AVPlayer.

It's just the one function nowPlaying that errors out for me

@colinta - I checked that repo and it doesn't really demonstrate anything. Running AVPlayer.alloc.init.currentTime is sufficient for me to reproduce the error.

Jordan Maguire

unread,
Feb 27, 2013, 8:04:30 PM2/27/13
to rubym...@googlegroups.com
I'll knock up a test repo tonight demoing all these things

Jordan Maguire

unread,
Feb 28, 2013, 8:38:05 AM2/28/13
to rubym...@googlegroups.com
Hi everyone,

So in the process of knocking up the test repo (https://github.com/jordanmaguire/avplayer_test) I have proven to myself that I can use #currentTime. It works in this repo on a valid playing sound clip. However, AVPlayer.alloc.init.currentTime still blows up with the same error - perhaps because it doesn't have a playerItem. This is definitely a RubyMotion/Objective C bug and is related to the state of the AVPlayer. I imagine if there is no playerItem it should just return nil, not raise a gibberish exception.

That doesn't explain why it is happening in my original repo, as the AVPlayer at that point has a playerItem and is playing. However, that must be something I'm doing incorrectly. Even so, as I discussed above, I still think AVPlayer.alloc.init.currentTime should not blow up so catastrophically. That may just be wishful thinking though.

I'll dig deeper into the issue and see if I can determine exactly what is causing it to blow up in my first code on a working AVPlayer, but not in my test repo. For the record, I copied my exact code from the test repo to my first repo and it worked fine there too, so it is definitely NOT a configuration issue.

Colin Thomas Arnold Gray

unread,
Feb 28, 2013, 10:21:00 AM2/28/13
to rubym...@googlegroups.com
Last night Watson (does everyone know who watson is?) said that there is a race condition going on here, which is why this bug "comes and goes". It's definitely on the radar. 



#colin

Sean Dick

unread,
Feb 28, 2013, 2:55:56 PM2/28/13
to rubym...@googlegroups.com
I had this same error for a while and as it happened for me it was mostly related to calling it from the REPL. It's a barely visible struct made up of a int_64t and an int_32t. That said, I was having trouble with CMTimeMake and using it to append a pixel buffer to a media stream rather than reading off the current time from an existing one. Hope that helps.

Jordan Maguire

unread,
Feb 28, 2013, 6:11:18 PM2/28/13
to rubym...@googlegroups.com
Looks like Sean is right - the problem only exists calling currentTime from the REPL

Guess that's the end of that then.

Sean Dick

unread,
Feb 28, 2013, 6:49:59 PM2/28/13
to rubym...@googlegroups.com
For reference, the bug filed for this can be found here:

--
Sean
405 514 3801
sent from my five iphones

Jordan Maguire

unread,
Apr 4, 2013, 10:23:55 PM4/4/13
to rubym...@googlegroups.com
The changelog for RubyMotion 1.35 says this bug is fixed:

"* Fixed a bug where the AVPlayer#currentTime method caused a `{?=qiIq}@:' not
    precompiled' error."

However, it still blows up for me in the REPL
Reply all
Reply to author
Forward
0 new messages