User avatar
Aloshi
Posts: 359
Joined: Sat Jun 23, 2012 6:42 pm

Problems re-initializing EGL stuff

Tue Sep 04, 2012 3:00 am

So, I've been working on an emulator front-end (GitHub here), and recently rewrote the renderer to use EGL and OpenGL ES. Everything works right, but by the nature of the program, I need to uninitialize the renderer and reinitialize it frequently - every time a game is launched.

What I've noticed that after the third time a game is launched, the renderer stops properly initializing - I just get a black screen. None of my error checks for the EGL methods failing are tripped.

I do get some interesting errors, though:

Code: Select all

723013802: tvservice-client: Failed to connect to TV service: -1
723014284: cecservice-client: Failed to connected to CEC service: -1
723014527: cecservice-client: Failed to connected to CEC async service: -1
726846705: tvservice-client: Failed to connect to TV service: -1
...
Creating surface...
726860689: Display size is 1680x1050.
tvservice-client: TV service failed to send command get_state length 0, error code -1
I'm not expecting anyone to comb through my code and figure out what I'm doing wrong, but does anyone know what these errors could be from? I have no idea what they mean.

Relevant portion of my code (the init() and deinit() functions are what is called, and init is called as init(0, 0)): http://pastebin.com/nhJq9wGN

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6154
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Problems re-initializing EGL stuff

Tue Sep 04, 2012 9:14 am

Does it help if you only call bcmhost_init once?

Pendor
Posts: 48
Joined: Tue Jul 24, 2012 3:21 am

Re: Problems re-initializing EGL stuff

Tue Sep 04, 2012 2:35 pm

dom wrote:Does it help if you only call bcmhost_init once?
Apparently that did it. I'll tell Aloshi next time he's online, thanks.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6154
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Problems re-initializing EGL stuff

Tue Sep 04, 2012 3:20 pm

Pendor wrote:
dom wrote:Does it help if you only call bcmhost_init once?
Apparently that did it. I'll tell Aloshi next time he's online, thanks.
I'll look into it. May avoid future confusion if allow multiple calls to bcm_host_init.

User avatar
Aloshi
Posts: 359
Joined: Sat Jun 23, 2012 6:42 pm

Re: Problems re-initializing EGL stuff

Tue Sep 04, 2012 4:52 pm

Yep, all fixed! Thanks for the help.

deadindenver
Posts: 1
Joined: Mon Mar 23, 2015 5:55 pm

Re: Problems re-initializing EGL stuff

Sun May 17, 2015 4:46 am

Hello :)

Excuse me but I am unsure where to exactly insert the call "bcmhost_init" in my code, could you possibly give me a pointer.

I too am having the same TV client error.

I am trying to use a motion sensor to play a video.

Attached the error and my code.
Attachments
Screen Shot 2015-05-16 at 10.40.49 PM.png
Screen Shot 2015-05-16 at 10.40.49 PM.png (12.46 KiB) Viewed 2995 times
Screen Shot 2015-05-16 at 10.39.32 PM.png
Screen Shot 2015-05-16 at 10.39.32 PM.png (16.08 KiB) Viewed 2995 times
Screen Shot 2015-05-16 at 10.33.27 PM.png
Screen Shot 2015-05-16 at 10.33.27 PM.png (35.09 KiB) Viewed 2995 times

Return to “Graphics programming”