Author Topic: [TEST RESULT] Test port of RetroArch running on gcw0  (Read 21530 times)

Shin-NiL

  • Posts: 355
    • Shin-NiL's Personal Web Page (Brazilian Portuguese)
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #20 on: September 16, 2013, 02:54:52 pm »
Thank you for clarifying these points Squarepusher2. Such kind of information is valuable ;)

the_gama (OP)

  • Posts: 155
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #21 on: September 16, 2013, 11:01:47 pm »
Yes, very valuable indeed. Thanks squarepusher.

Quote
The sound driver (and configuration)  is crucial to get right - you need to get the audio latency option set exactly right to avoid sound crackling and not getting audio right will result in a bad experience since it blocks on audio - thus audio is the bottleneck in case the driver is bad or it is not configured right. I don't know what sound driver you are using right now - I assume ALSA?

I have tested both SDL and ALSA driver, ALSA works better with threaded video off, while SDL works better with threaded video.

I'm still searching the correct values for audio latency.  And currently I'm trying to test performance using the OpenGL (GLES 2.0) driver, compiled the gl driver files, but it seems an egl context code is needed.  Will try to write one based on the different egl contexts available, the emscripten or android ones seem appropiate.

Shin-Nil, have you tested your build?  It would be nice to compare your port.  As I said before, basically I only wrote a Makefile, and I haven't changed anything to the sources, except for a NULL pointer check in frontend.c when using the SDL gfx driver.

Shin-NiL

  • Posts: 355
    • Shin-NiL's Personal Web Page (Brazilian Portuguese)
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #22 on: September 17, 2013, 01:07:28 am »
I  haven't made any code changes also, just edited the makefile and tested some settings options. I'm using the SDL backend, apparently used only to test the emulator on Windows. Once I have more time I will try to test the sound latency.

the_gama (OP)

  • Posts: 155
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #23 on: September 20, 2013, 03:11:33 pm »
I'm trying to get retroarch's gl driver to work, but I'm getting very slow performance.  Any help from some dev?  What is the correct calls to setup an egl context in the zero?  Currently I'm using code from the EGLport from Pickle (with some minor modifications) to get input from sdl and video using opengles 2.0. 

It compiles fine and video output is working, but performance is very slow.  The opreport script shows that 38% of cpu time is spent in egl_gallium.so, so I believe I'm not using the correct configuration or the gl driver is using unimplemented/unoptimized features. 

Here is Retroarch log output:

Code: [Select]
RetroArch: Adjusting aspect ratio to 1.07
RetroArch: Video @ 240x224
EGL Getting EGL display
EGL Initializing
fbdev_display succesful
Kernel: Vivante GPL kernel driver 4.6.6.1381
Physical address of internal memory: 00000000
* Video memory:
  Internal physical: 0x00000000
  Internal size: 0x00000000
  External physical: 00000000
  External size: 0x00000000
  Contiguous physical: 0x8e2eff00
  Contiguous size: 0x00400000
Succesfully opened device
EGL_VENDOR: Mesa Project
EGL_VERSION: 1.4 (Gallium)
EGL_EXTENSIONS: EGL_MESA_screen_surface EGL_KHR_image_base EGL_KHR_reusable_sync EGL_KHR_fence_sync EGL_KHR_surfaceless_context
EGL Found 3 available configs
EGL Config 0
EGL Binding API
EGL Creating Context
EGL Creating window surface
native_fbdev: 2 buffers of 320x240
Framebuffer format: 6, flip_rb=0
Framebuffer format: 6, flip_rb=0
EGL Making Current
EGL Complete
RetroArch: Found GL context: opendingux
RetroArch: Detecting screen resolution 320x240.
RetroArch: gfx_ctx_set_swap_interval(1).
RetroArch: [GL]: Vendor: etnaviv, Renderer: Gallium 0.4 on Vivante GC860 rev 4621, Vivante GPL kernel driver 4.6.6.1381.
RetroArch: [GL]: Version: OpenGL ES 2.0 Mesa 9.3.0-devel.
RetroArch: Querying GL extension: BGRA8888 => exists
RetroArch: [GL]: BGRA8888 extension found for GLES.
RetroArch: GL: Using resolution 320x240
RetroArch: [GL]: Using GLSL shader backend.
RetroArch [WARN] :: [GL]: Stock GLSL shaders will be used.
RetroArch: Found GLSL vertex shader.
RetroArch: Found GLSL fragment shader.
RetroArch: Linking GLSL program.
RetroArch: Found GLSL vertex shader.
RetroArch: Found GLSL fragment shader.
RetroArch: Linking GLSL program.
RetroArch: Found GLSL vertex shader.
RetroArch: Found GLSL fragment shader.
RetroArch: Linking GLSL program.
RetroArch: GL: Using 4 textures.
RetroArch: GL: Loaded 1 program(s).
RetroArch: [Joypad]: Found pad: analog joystick on /dev/input/js0.
RetroArch: Found joypad driver: "linuxraw".
RetroArch: Using font rendering backend: bitmap.
RetroArch: ALSA: Using signed 16-bit format.
RetroArch: ALSA: Period size: 768 frames
RetroArch: ALSA: Buffer size: 3072 frames
RetroArch: ALSA: Can pause: yes.
RetroArch: Sinc resampler [C]
RetroArch: SINC params (12 phase bits, 8 taps).
RetroArch: [RGUI]: Opening history: retroarch/.retroarch-game-history.txt.

And this is opreport output:

Code: [Select]
Using /var/lib/oprofile/samples/ for samples directory.
warning: /no-vmlinux could not be found.
CPU: CPU with timer interrupt, speed 1188 MHz (estimated)
Profiling through timer interrupt
samples  %        app name                 symbol name
16277    52.3258  no-vmlinux               /no-vmlinux
12122    38.9687  egl_gallium.so           /usr/lib/egl/egl_gallium.so
495       1.5913  fceumm_libretro_gcw0.so  X6502_Run
460       1.4788  fceumm_libretro_gcw0.so  retro_run
399       1.2827  fceumm_libretro_gcw0.so  RefreshLine
216       0.6944  libuClibc-0.9.33.2.so    /lib/libuClibc-0.9.33.2.so
204       0.6558  fceumm_libretro_gcw0.so  FCEU_SoundCPUHook
196       0.6301  fceumm_libretro_gcw0.so  FCEUPPU_Loop
137       0.4404  fceumm_libretro_gcw0.so  CartBR
125       0.4018  retroarch-gcw0           resampler_sinc_process
52        0.1672  libpthread-0.9.33.2.so   pthread_mutex_lock
47        0.1511  fceumm_libretro_gcw0.so  RDoTriangleNoisePCMLQ
46        0.1479  fceumm_libretro_gcw0.so  RDoSQLQ
40        0.1286  libpthread-0.9.33.2.so   __pthread_mutex_unlock_usercnt
37        0.1189  ld-uClibc-0.9.33.2.so    /lib/ld-uClibc-0.9.33.2.so
35        0.1125  libpthread-0.9.33.2.so   __pthread_cleanup_push_defer
30        0.0964  retroarch-gcw0           audio_flush.part.57
21        0.0675  libpthread-0.9.33.2.so   __pthread_cleanup_pop_restore
20        0.0643  fceumm_libretro_gcw0.so  SexyFilter
16        0.0514  libm-0.9.33.2.so         /lib/libm-0.9.33.2.so
15        0.0482  busybox                  /bin/busybox
11        0.0354  libpthread-0.9.33.2.so   pthread_mutex_unlock
8         0.0257  libasound.so.2.0.0       /usr/lib/libasound.so.2.0.0
7         0.0225  retroarch-gcw0           gl_frame
6         0.0193  fceumm_libretro_gcw0.so  FCEUPPU_LineUpdate
6         0.0193  oprofiled                /usr/bin/oprofiled
5         0.0161  retroarch-gcw0           gl_glsl_set_params
4         0.0129  libEGL.so.1.0.0          /usr/lib/libEGL.so.1.0.0
4         0.0129  libGLESv2.so.2.0.0       /usr/lib/libGLESv2.so.2.0.0
4         0.0129  retroarch-gcw0           font_renderer_init
3         0.0096  fceumm_libretro_gcw0.so  FrameSoundUpdate
3         0.0096  fceumm_libretro_gcw0.so  X6502_DMR
3         0.0096  libSDL-1.2.so.0.11.4     /usr/lib/libSDL-1.2.so.0.11.4
3         0.0096  libpthread-0.9.33.2.so   pthread_getspecific
3         0.0096  retroarch-gcw0           gfx_ctx_update_window_title
3         0.0096  retroarch-gcw0           linuxraw_joypad_button
3         0.0096  retroarch-gcw0           rarch_main_iterate
3         0.0096  retroarch-gcw0           resampler_sinc_new
2         0.0064  fceumm_libretro_gcw0.so  X6502_DMW
2         0.0064  fceumm_libretro_gcw0.so  crc32
2         0.0064  fceumm_libretro_gcw0.so  md5_process
2         0.0064  libpthread-0.9.33.2.so   pthread_cond_signal
2         0.0064  retroarch-gcw0           audio_sample_batch
2         0.0064  retroarch-gcw0           do_state_checks
2         0.0064  retroarch-gcw0           gl_alive
2         0.0064  retroarch-gcw0           gl_glsl_set_coords.part.32
2         0.0064  retroarch-gcw0           input_joypad_pressed
2         0.0064  retroarch-gcw0           sdl_input_state
2         0.0064  retroarch-gcw0           video_frame
1         0.0032  fceumm_libretro_gcw0.so  ARAML
1         0.0032  fceumm_libretro_gcw0.so  B2004
1         0.0032  fceumm_libretro_gcw0.so  B2007
1         0.0032  fceumm_libretro_gcw0.so  B4014
1         0.0032  fceumm_libretro_gcw0.so  BRAML
1         0.0032  fceumm_libretro_gcw0.so  FCEUMOV_AddJoy
1         0.0032  fceumm_libretro_gcw0.so  FCEU_DrawSaveStates
1         0.0032  fceumm_libretro_gcw0.so  FlushEmulateSound
1         0.0032  fceumm_libretro_gcw0.so  setprg16r
1         0.0032  libpthread-0.9.33.2.so   __pthread_mutex_cond_lock
1         0.0032  libpthread-0.9.33.2.so   pthread_cond_wait
1         0.0032  retroarch-gcw0           alsa_write
1         0.0032  retroarch-gcw0           check_shader_dir
1         0.0032  retroarch-gcw0           gl_glsl_use
1         0.0032  retroarch-gcw0           gl_viewport_info
1         0.0032  retroarch-gcw0           msg_queue_pull
« Last Edit: September 20, 2013, 03:18:42 pm by the_gama »

wumpus

  • Posts: 12
    • Visucore
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #24 on: September 23, 2013, 04:30:14 pm »
CPU load shouldn't be that high. It looks like it  making a lot of calls to the GLES2 driver. What does the GL rendering code look like? (for example if it's doing a glDraw call per quad, that's the problem)
Can you maybe make an apitrace? Run with:
Code: [Select]
apitrace trace -a egl <executable>
Then send the .trace file.

the_gama (OP)

  • Posts: 155
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #25 on: September 24, 2013, 03:50:35 am »

zear

  • * Moderator
  • Posts: 2381
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #26 on: September 24, 2013, 02:37:47 pm »
I'm getting "403 - Forbidden" on an attempt to download the file from your link.

wumpus

  • Posts: 12
    • Visucore
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #27 on: September 24, 2013, 04:57:57 pm »
He sent it to me by mail, I can send it through if you're interested.
It appears that the problem causing the high CPU (and underutilized GPU) load is texture conversion overhead. It's even spending a lot of time converting floats to/from ints. We don't know yet which program behaviour causes this.

Code: [Select]
3265     11.0099  egl_gallium.so           _mesa_apply_rgba_transfer_ops
3113     10.4974  egl_gallium.so           _mesa_make_temp_ubyte_image
3024     10.1973  egl_gallium.so           extract_float_rgba
2983     10.0590  egl_gallium.so           _mesa_unpack_color_span_ubyte
1103      3.7194  egl_gallium.so           pack_row_ubyte_XRGB8888

the_gama (OP)

  • Posts: 155
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #28 on: September 24, 2013, 07:09:11 pm »
Here is another link, it should work now: http://www.speedyshare.com/fS4Xk/retroarch-gcw0.7z

wumpus

  • Posts: 12
    • Visucore
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #29 on: September 27, 2013, 08:11:40 am »
I've committed this to remove the texture conversion overhead when using non-RGBx8888 formats:

https://github.com/laanwj/mesa/commit/0c71bcf1c5cc06e26bfed7a72507555fe7e7ad97
« Last Edit: September 27, 2013, 08:14:26 am by wumpus »

the_gama (OP)

  • Posts: 155
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #30 on: September 29, 2013, 01:18:49 am »
I'm trying to test wumpus patch, I have successfully built the rootfs.squashfs file, renamed it to update_r.bin and copy it to /media/data on the device but after I reboot there is the following error: unable to mount /dev/loop.  The unit restarts and I have to press Y to fix it.  After that the update_r.bin file is deleted.

Any idea of what could be happening? Does the rootfs.squashfs file is corrupted?
It was built following the instructions from the wiki.
« Last Edit: September 29, 2013, 01:59:50 am by the_gama »

pcercuei

  • Posts: 1666
    • My devblog
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #31 on: September 29, 2013, 08:15:08 am »
Maybe the transfer failed? Anyway, do *not* transfer a new update_r.bin while you run the backup roots, you will brick the device if it's another unbootable rootfs and you'd have to reflash. Instead, replace directly the regular rootfs.bin on the data partition.

the_gama (OP)

  • Posts: 155
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #32 on: September 30, 2013, 12:48:54 am »
Thanks pcercuei, I was about to copy update_r.bin again!.  Ok, rebuilt the rootfs image, copied it as rootfs.bin and it worked fine, maybe the transfer failed the first time as you suggested.

I have tested the app again using the gl driver, it works fine already.  It's not working fine without the smooth filter though, it seems that the vsync option is not working or a visual artifact caused by scaling is occurring.

Unfortunately the snes core is still running too slow, tested the Street Fighter II rom and it runs very slow.  I'm a bit surprised actually of how slow it runs, will do some profiling again to find the cause of this poor performance.


Awakened

  • Posts: 96
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #33 on: September 30, 2013, 01:50:27 am »
There was an update to VBA Next that added tiled rendering. It's sped up that core enough to make it fullspeed for most games on the Wii. Maybe it's enough for the Zero as well.

the_gama (OP)

  • Posts: 155
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #34 on: September 30, 2013, 03:21:03 am »
That's right, I have to try it out, but there is already a fullspeed gba emu though. 

Anyway I have to wait for a new firmware update that includes wumpus patch, to make a release.

the_gama (OP)

  • Posts: 155
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #35 on: October 11, 2013, 03:51:03 am »
Ok, finally got time to test the new firmware, which comes with the latest etnaviv driver.

I can confirm the gl driver and retroarch's gui (rgui) are working now.  There are still things to be done before working on a public release, like commiting the port changes to the libretro team.

But first, there is currently a bug which causes the app to freeze when resuming or resetting a game.  I have tracked the issue using gdb but I haven't been able to find the cause of it.

I don't have much free time now, so if any dev would like to help with the port, please contact me.

Shin-NiL

  • Posts: 355
    • Shin-NiL's Personal Web Page (Brazilian Portuguese)
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #36 on: October 11, 2013, 03:33:34 pm »
It's fantastic, the_gama! I've tried again, but I was not able to build a working gl driver.

And about performance? It's better than SDL driver? Which cores did you test this time?


Thanks.

the_gama (OP)

  • Posts: 155
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #37 on: October 12, 2013, 01:10:22 am »
I think it has the same performance as the SDL driver, but it adds several nice and usefull features: support for retroarch builtin gui, shaders, hardware scaling and filtering, and some additional cores like the model and scene viewers.

I have found the cause of the issue I described in my previous post, so now I will test which cores could be included in a release to work on it.

There are still things to be done though, like cleaning the sources, commit the changes to the libretro team, testing, etc. Shin, if you are interested and have some time, I can send you the sources so you can try the app.

BlockABoots

  • Posts: 131
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #38 on: November 09, 2013, 02:17:49 pm »
I cant wait for RetroArch to be released on the GCW-Zero, will just be sooo nice to have just one continuity for a frontend to be used for all emulators. Is there any update on a possible release date the_gama, im guessing PS1 emulation will be out of the question? Im hoping the boost to the cpu clock that the latest FW contains will help performance

pcercuei

  • Posts: 1666
    • My devblog
Re: [TEST RESULT] Test port of RetroArch running on gcw0
« Reply #39 on: November 09, 2013, 04:52:18 pm »
Im hoping the boost to the cpu clock that the latest FW contains will help performance
What the hell are you talking about? The CPU clock has not been changed since the debuts of OD on the Zero.

 

Post a new topic
Post a new topic