Skip to content
This repository has been archived by the owner on Aug 4, 2019. It is now read-only.

toxcore conflicts with MobileVLCKit #170

Open
bucky0970 opened this issue Apr 11, 2017 · 13 comments
Open

toxcore conflicts with MobileVLCKit #170

bucky0970 opened this issue Apr 11, 2017 · 13 comments

Comments

@bucky0970
Copy link

bucky0970 commented Apr 11, 2017

I try to implement objcTox to a new project.
Link to Tox - OK
Add friend - OK
Approve friend - OK
Voice Call - OK
When I call with video, it crash.
It stuck at Thread - vpx_codec_encodec.

  1. OCTVideoEngine - (void)captureOutput
  2. OCTToxAV - (BOOL)sendVideoFrametoFriend
  3. toxav - bool toxav_video_send_frame
  4. EXC_BAD_ACCESS

UPDATE:
Can't send video, but can receive...

@dvor
Copy link
Member

dvor commented Apr 11, 2017

@bucky0970 do you have iOS or macOS project?

It might be that you have to add NSCameraUsageDescription to your project settings, without that camera cannot be accessed.

@bucky0970
Copy link
Author

bucky0970 commented Apr 12, 2017

My project is iOS project. I already add NSCameraUsageDescription in my project info.plist.
I will keep trying today~ thanks for your reply!

UPDATE:
Maybe I do not have a self preview. so I add

        submanagerCalls.getVideoCallPreview{ [weak self] layer in
            self?.videoPreviewView.layer.addSublayer(layer!)
            self?.videoPreviewLayer = layer
            self?.videoPreviewLayer?.frame = (self?.videoPreviewView.bounds)!
        }

Now I have a preview view. but it still stuck at following line(in toxav.m line 796):
vpx_codec_err_t vrc = vpx_codec_encode(call->video.second->encoder, &img, call->video.second->frame_counter, 1, 0, MAX_ENCODE_TIME_US);

Should I do something like linking camera to some OCTmanager or vpx?

@dvor
Copy link
Member

dvor commented Apr 12, 2017

Okay, it seems that you are using old version of objcTox. I guess you have eventually added it with CocoaPods and the version you use in 0.6.0.

I've just released 0.7.0 with lots of fixes and improvements, can you please try it out? You can check CHANGELOG for list of changes.

@bucky0970
Copy link
Author

Actually I use the same version as Antidote
pod 'objcTox', :git => 'https://github.com/Antidote-for-Tox/objcTox.git', :commit => 'bf0097c5a98d7be24672f801a6a9e5031e6b0c21'
I am not sure if this cause my crash, but I will update immediately.

Thanks for your advise~

@dvor
Copy link
Member

dvor commented Apr 12, 2017

Hm, okay then. Are you running it on simulator or on device? Can you try both?

@bucky0970
Copy link
Author

I run it on my devices(SE,5s,iPad), it can't run on my simulator. Look like vpx framework not include x86_64 architecture.

Undefined symbols for architecture x86_64:
  "_vp8_copy32xn", referenced from:
      _vp8_create_compressor in vpx(onyx_if.c.o)
     (maybe you meant: _vp8_copy32xn_c, _vp8_copy32xn_sse2 , _vp8_copy32xn_sse3 )
  "_vp8_full_search_sad", referenced from:
      _vp8_create_compressor in vpx(onyx_if.c.o)
     (maybe you meant: _vp8_full_search_sadx8, _vp8_full_search_sadx3 , _vp8_full_search_sad_c )
  "_vp8_diamond_search_sad", referenced from:
      _vp8_create_compressor in vpx(onyx_if.c.o)
     (maybe you meant: _vp8_diamond_search_sadx4, _vp8_diamond_search_sad_c )
  "_vp8_refining_search_sad", referenced from:
      _vp8_create_compressor in vpx(onyx_if.c.o)
     (maybe you meant: _vp8_refining_search_sadx4, _vp8_refining_search_sad_c )
  "_vp8_regular_quantize_b", referenced from:
      _vp8_set_speed_features in vpx(onyx_if.c.o)
      _vp8cx_encode_inter_macroblock in vpx(encodeframe.c.o)
     (maybe you meant: _vp8_regular_quantize_b_c)
  "_vp8_fast_quantize_b", referenced from:
      _vp8_set_speed_features in vpx(onyx_if.c.o)
      _vp8cx_encode_inter_macroblock in vpx(encodeframe.c.o)
     (maybe you meant: _vp8_fast_quantize_b_c)
ld: symbol(s) not found for architecture x86_64

I upgrade to 0.7.0, but app still crash.

@dvor
Copy link
Member

dvor commented Apr 12, 2017

It seems that there is something wrong with vpx setup for you. I'll try to create a new project and try to reproduce it.

Also you mentioned that incoming video is working. Were you actually able to receive incoming video image?

@bucky0970
Copy link
Author

Yes, receiving Video work well.
When I

        do {
            try self.submanagerCalls.enableVideoSending(true, for: self.actCall)
        } catch  {
            print("fail enableVideo")
        }

or

      do {
             self.actCall = try self.submanagerCalls.call(to: chat!, enableAudio: true, enableVideo: true)
        } catch  {
            print("fail call")
        }

will crash.

@dvor
Copy link
Member

dvor commented Apr 13, 2017

I've created sample project, video calls works fine there. Can you please check if it works for you?

https://github.com/dvor/TestingObjcToxVideo

  • run pod install
  • open, build and run TestingObjcToxVideo.xcworkspace
  • after running search for Tox ID: in logs
  • send friend request from other client, TestingObjcToxVideo auto accepts any friend request
  • make a call from other client, TestingObjcToxVideo auto accepts incoming calls

@bucky0970
Copy link
Author

bucky0970 commented Apr 13, 2017

it works perfectly well... I modify the demo to make a call to the other demo, it can send video well.
I will do more research for my project.(I will try to call demo with my project..)

This demo help me a lot, thank you!
If you come to Taiwan, I will buy you a meal ! (Tainan actually)

UPDATE

I paste all codes to my project, it crash at the same point.
I will do it on my full project to test, if I found anything, I will let you know.

@dvor
Copy link
Member

dvor commented Apr 13, 2017

Maybe it is something with configuration. Please note that I've disabled bitcode in project settings (ENABLE_BITCODE flag).

If you come to Taiwan, I will buy you a meal ! (Tainan actually)

Thank you! ;)

@bucky0970
Copy link
Author

Answer is coming..

Finally, it seems that some where in toxcore conflict with MobileVLCKit, when I remove VLC pod, it work well...

@dvor
Copy link
Member

dvor commented Apr 14, 2017

I guess MobileVLCKit also uses VPX.

@dvor dvor changed the title About Video Call EXC_BAD_ACCESS toxcore conflicts with MobileVLCKit Apr 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants