Nexus 4 Compatibility

Ask questions about the Android SDK here

Nexus 4 Compatibility

Postby jhuson » Mon Dec 03, 2012 3:03 pm

The github states the Android SDK is compatible with Nexus 4. I'm using a Nexus 7 and Nexus 4. The Nexus 7 connects to the Session, and the Publisher starts streaming. On Nexus 4 I receive this error and crash:

12-03 16:58:00.531: E/AndroidRuntime(5264): FATAL EXCEPTION: main
12-03 16:58:00.531: E/AndroidRuntime(5264): java.lang.RuntimeException: no encoder available for video/avc
12-03 16:58:00.531: E/AndroidRuntime(5264): at com.opentok.media.avc.AndroidAvcEncoder.<init>(AndroidAvcEncoder.java:43)

Same code is running on both devices.

Thanks, Jamie
Was this post helpful? (0)
jhuson
 
Posts: 15
Joined: Mon Dec 03, 2012 2:56 pm
Thumbs Up: 0

Re: Nexus 4 Compatibility

Postby charley » Mon Dec 03, 2012 3:10 pm

Curses! Our 4 hasn't shown up yet. Can you extract your media_codecs.xml from the device (/system/etc/media_codecs.xml) and gist/pastebin it for me?
Was this post helpful? (1)
charley
 
Posts: 418
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 33

Re: Nexus 4 Compatibility

Postby jhuson » Mon Dec 03, 2012 3:20 pm

charley wrote:Curses! Our 4 hasn't shown up yet. Can you extract your media_codecs.xml from the device (/system/etc/media_codecs.xml) and gist/pastebin it for me?


http://pastebin.com/5Q05HWRE :D
Was this post helpful? (0)
jhuson
 
Posts: 15
Joined: Mon Dec 03, 2012 2:56 pm
Thumbs Up: 0

Re: Nexus 4 Compatibility

Postby charley » Mon Dec 03, 2012 3:48 pm

Well there's definitely an avc encoder there; this looks like my fault. I created a test branch (and sample app, re: your other thread) that you should have better luck with, please let me know if this works better for you:
https://github.com/opentok/opentok-andr ... /nexus-fix
https://github.com/opentok/Android-Hell ... /nexus-fix
Was this post helpful? (1)
charley
 
Posts: 418
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 33

Re: Nexus 4 Compatibility

Postby jhuson » Tue Dec 04, 2012 9:35 am

charley wrote:Well there's definitely an avc encoder there; this looks like my fault. I created a test branch (and sample app, re: your other thread) that you should have better luck with, please let me know if this works better for you:
https://github.com/opentok/opentok-andr ... /nexus-fix
https://github.com/opentok/Android-Hell ... /nexus-fix


Using the provided projects I was able to get a video chat going between the Nexus 7 and the Nexus 4. I had to modify the project because it was set to only use the Publisher stream for both SurfaceViews. Also, I was unable to get the video from the Nexus 4 to show on the Nexus 7, but the video from the Nexus 7 did show on the Nexus 4. I'm unsure why this occurred.
Was this post helpful? (0)
jhuson
 
Posts: 15
Joined: Mon Dec 03, 2012 2:56 pm
Thumbs Up: 0

Re: Nexus 4 Compatibility

Postby charley » Tue Dec 04, 2012 10:14 am

Did the 7 at least seem to be receiving the stream created notification for the peer? You can also load up a javascript application to view streams (our tutorials are useful here: http://tokbox.com/opentok/api/tools/js/ ... s/overview), this will help us isolate the misbehaving component (eg. publisher vs. subscriber)
Was this post helpful? (0)
charley
 
Posts: 418
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 33

Re: Nexus 4 Compatibility

Postby jhuson » Tue Dec 04, 2012 2:18 pm

charley wrote:Did the 7 at least seem to be receiving the stream created notification for the peer? You can also load up a javascript application to view streams (our tutorials are useful here: http://tokbox.com/opentok/api/tools/js/ ... s/overview), this will help us isolate the misbehaving component (eg. publisher vs. subscriber)


On Nexus 7 the callback for Subscriber.Listener.onSubscriberDidConnect(Stream stream) is never called for the Nexus 4 subscriber stream. On Nexus 4 I get the callback when the Nexus 7 Subscriber streams connects and begins to play. I noticed the Nexus 4 is throwing a lot of System.err level LogCat messages. I can post a full PasteBin if needed but here is something I thought might be relevant:

12-04 16:14:12.505: I/OMXClient(20893): Using client-side OMX mux.
12-04 16:14:12.535: I/ACodec(20893): setupVideoEncoder succeeded
12-04 16:14:12.735: W/opentok-avc-enc(20893): input size mismatch expected 118784 got 115200
12-04 16:14:12.735: E/ACodec(20893): [OMX.qcom.video.encoder.avc] ERROR(0x80001009)
12-04 16:14:12.745: E/MediaCodec(20893): Codec reported an error. (omx error 0x80001009, internalError -2147483648)
12-04 16:14:12.745: W/System.err(20893): java.lang.IllegalStateException
12-04 16:14:12.745: W/System.err(20893): at android.media.MediaCodec.dequeueOutputBuffer(Native Method)
12-04 16:14:12.745: W/System.err(20893): at com.opentok.media.avc.AndroidAvcEncoder.offerEncoder(AndroidAvcEncoder.java:165)
12-04 16:14:12.745: W/System.err(20893): at com.opentok.media.avc.AndroidAvcEncoder.offerEncoder(AndroidAvcEncoder.java:1)

Seems like the Nexus 4 stream isnt outputting correctly which explains why the its not coming through on the other end. Let me know if there's additional testing I can perform to help.
Was this post helpful? (0)
jhuson
 
Posts: 15
Joined: Mon Dec 03, 2012 2:56 pm
Thumbs Up: 0

Re: Nexus 4 Compatibility

Postby charley » Tue Dec 04, 2012 2:36 pm

I've seen that bug before, and it can get pretty nasty. There tend to be a lot of device-specific issues with the MediaCodec and Camera APIs. I pushed a potential fix to the nexus-fix branch, give it a whirl and let me know if it breaks differently (or the same, even! :-D )
Was this post helpful? (0)
charley
 
Posts: 418
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 33

Re: Nexus 4 Compatibility

Postby jhuson » Wed Dec 05, 2012 8:06 am

charley wrote:I've seen that bug before, and it can get pretty nasty. There tend to be a lot of device-specific issues with the MediaCodec and Camera APIs. I pushed a potential fix to the nexus-fix branch, give it a whirl and let me know if it breaks differently (or the same, even! :-D )


The image is coming through now, but it's incorrect. I attached a screenshot taken from my Nexus 7 showing the Subscriber stream coming from Nexus 4. I'm not seeing anything in LogCat.

Screenshot_2012-12-05-10-00-56.png
Nexus 4 incorrect video output
Was this post helpful? (0)
jhuson
 
Posts: 15
Joined: Mon Dec 03, 2012 2:56 pm
Thumbs Up: 0

Re: Nexus 4 Compatibility

Postby charley » Wed Dec 05, 2012 10:30 am

Delightful! That's a pixel format mismatch. I've pushed a build to nexus-fix that will dump some configuration info that I will need to make a proper patch. Run this build and send me the logcat, I only need it up to the point where the publisher starts streaming.
Was this post helpful? (0)
charley
 
Posts: 418
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 33

Re: Nexus 4 Compatibility

Postby jhuson » Wed Dec 05, 2012 10:48 am

charley wrote:Delightful! That's a pixel format mismatch. I've pushed a build to nexus-fix that will dump some configuration info that I will need to make a proper patch. Run this build and send me the logcat, I only need it up to the point where the publisher starts streaming.


Here's the pastebin: http://pastebin.com/PGEL5kZ4
Was this post helpful? (0)
jhuson
 
Posts: 15
Joined: Mon Dec 03, 2012 2:56 pm
Thumbs Up: 0

Re: Nexus 4 Compatibility

Postby charley » Wed Dec 05, 2012 11:19 am

That's perfect, thanks. I need to inspect what that Qualcomm chipset can do. I've pushed a build to nexus-fix that *should* force greyscale on your publisher, and also gives me more debugging info in order to write a filter for that encoder. Please pull and rerun, then send updated logcat, same as before.
Was this post helpful? (0)
charley
 
Posts: 418
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 33

Re: Nexus 4 Compatibility

Postby jhuson » Wed Dec 05, 2012 11:31 am

charley wrote:That's perfect, thanks. I need to inspect what that Qualcomm chipset can do. I've pushed a build to nexus-fix that *should* force greyscale on your publisher, and also gives me more debugging info in order to write a filter for that encoder. Please pull and rerun, then send updated logcat, same as before.


Here it is: http://pastebin.com/0xA0vnWQ
Was this post helpful? (0)
jhuson
 
Posts: 15
Joined: Mon Dec 03, 2012 2:56 pm
Thumbs Up: 0

Re: Nexus 4 Compatibility

Postby charley » Wed Dec 05, 2012 11:35 am

Did the greyscale work?
Was this post helpful? (0)
charley
 
Posts: 418
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 33

Re: Nexus 4 Compatibility

Postby jhuson » Wed Dec 05, 2012 12:01 pm

charley wrote:Did the greyscale work?


Greyscale is working (on both N7 and N4). The picture from N4 seems scaled however. I'm only able to see a portion of the top of the frame magnified.
Was this post helpful? (0)
jhuson
 
Posts: 15
Joined: Mon Dec 03, 2012 2:56 pm
Thumbs Up: 0

Re: Nexus 4 Compatibility

Postby charley » Wed Dec 05, 2012 12:12 pm

I'm not sure I understand; do you mind posting a screencap for the Nexus 4?
Was this post helpful? (0)
charley
 
Posts: 418
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 33

Re: Nexus 4 Compatibility

Postby jhuson » Wed Dec 05, 2012 12:52 pm

charley wrote:I'm not sure I understand; do you mind posting a screencap for the Nexus 4?


The left picture and right picture should be the same scale of the image but a slightly different angle of myself. As you can see, the right image is magnified, as it shows the top of my head up close.
Was this post helpful? (0)
Attachments
Screenshot_2012-12-05-14-36-53.png
Notice my hair shows but that is only a small portion of the video I'm sending from the Nexus 4
jhuson
 
Posts: 15
Joined: Mon Dec 03, 2012 2:56 pm
Thumbs Up: 0

Re: Nexus 4 Compatibility

Postby charley » Wed Dec 05, 2012 2:25 pm

Okay, I've got another build up that should blacklist the bad config. Try again and let me know; we're still shooting for a clear image in greyscale.
Was this post helpful? (0)
charley
 
Posts: 418
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 33

Re: Nexus 4 Compatibility

Postby jhuson » Thu Dec 06, 2012 8:50 am

charley wrote:Okay, I've got another build up that should blacklist the bad config. Try again and let me know; we're still shooting for a clear image in greyscale.


Unfortunately, don't see any change. This screenshot shows with more clarity that the image is split somehow also.
Was this post helpful? (0)
Attachments
Screenshot_2012-12-06-10-47-53.png
jhuson
 
Posts: 15
Joined: Mon Dec 03, 2012 2:56 pm
Thumbs Up: 0

Re: Nexus 4 Compatibility

Postby charley » Thu Dec 06, 2012 9:27 am

Believe it or not, I think we're making progress. May I have the logcat from that last run? Thanks.
Was this post helpful? (0)
charley
 
Posts: 418
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 33

Re: Nexus 4 Compatibility

Postby jhuson » Thu Dec 06, 2012 9:53 am

charley wrote:Believe it or not, I think we're making progress. May I have the logcat from that last run? Thanks.


http://pastebin.com/TPeySqG8
Was this post helpful? (0)
jhuson
 
Posts: 15
Joined: Mon Dec 03, 2012 2:56 pm
Thumbs Up: 0

Re: Nexus 4 Compatibility

Postby charley » Thu Dec 06, 2012 1:56 pm

Looks like the encoder is making some assumptions about the data. I've pushed a build that adds more config specification, please give it a try when you have a chance, thanks.
Was this post helpful? (0)
charley
 
Posts: 418
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 33

Re: Nexus 4 Compatibility

Postby jhuson » Fri Dec 07, 2012 9:57 am

charley wrote:Looks like the encoder is making some assumptions about the data. I've pushed a build that adds more config specification, please give it a try when you have a chance, thanks.


These are two screens taken approximately at the same time. This should give you a reference of what the Nexus 4 camera was displaying locally and what was being received by the Nexus 7.
Was this post helpful? (0)
Attachments
Screenshot_2012-12-07-11-53-27.png
Nexus 4
Screenshot_2012-12-07-11-53-13.png
Nexus 7
jhuson
 
Posts: 15
Joined: Mon Dec 03, 2012 2:56 pm
Thumbs Up: 0

Re: Nexus 4 Compatibility

Postby charley » Fri Dec 07, 2012 10:39 am

Grumble. Can you shoot me an email? My email address is the same as my forum username (@tokbox.com).
Was this post helpful? (0)
charley
 
Posts: 418
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 33

Re: Nexus 4 Compatibility

Postby charley » Mon Dec 10, 2012 4:26 pm

Jamie-
I got my hands on a Nexus 4, and I think I fixed the stride issue. We're still stuck in greyscale for now. I'm not sure if this will get fixed until either I get smarter or Google acknowledges a problem. Both are known to be slow processes. Give the latest at origin/nexus-fix a spin and let me know if you have similar results.
Was this post helpful? (0)
Attachments
Screenshot_2012-12-10-15-25-29.png
woot
charley
 
Posts: 418
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 33


Return to Android (Native)



Who is online

Users browsing this forum: No registered users and 3 guests

cron