Amiberry: Sync issues when using full-window and fullscreen modes

Created on 14 Sep 2020  Â·  8Comments  Â·  Source: midwan/amiberry

Describe the bug
When running Amiberry on Manjaro (in XFCE desktop environment) I experience sync issues when using either the _full-window_ or _fullscreen_ display modes. This causes visual lag on the display and significant audio lag which is choppy and out of sync. If I enable _Status Line native_ the FPS counter fluctuates around 30fps and there is a red light illuminated immediately to the right of the FPS counter.

I have narrowed this down to occurring when the display resolution in Manjaro is set to either my monitor native resolution of 2560x1440 or 1920x1080. If I change the display resolution in Manjaro to 1024x768 then the FPS on the status bar stays steady around 50fps and the red light immediately to the right of the FPS counter is not illuminated after launch. Switching to _Windowed_ mode works perfectly at any resolution.

I also tested this on my television at it's native resolution of 1920x1080 and have the same issue. It only works when I set the display resolution in Manjaro to 1024x768. I have also tested various refresh rates which has no affect.

To narrow things down further I can reproduce this consistently when using a _Quickstart_ configuration and booting to the kickstart screen. I can't test lag on the kickstart screen, but the FPS counter clearly shows ~30fps at native resolution and ~50fps at 1024x768.

To Reproduce
Steps to reproduce the behavior:

  1. Set display resolution in Manjaro to 1920x1080 @ 60Hz.
  2. Launch Amiberry and go to _Quickstart_ page.
  3. Under _Amiga Model_ choose "Amiga 1200", then click _Set configuration_.
  4. Go to _Display_ page and set _Screen mode_ to "Full-window".
  5. Go to _Miscellaneous_ page and enable _Status Line native_.
  6. Click the _Start_ button to launch kickstart screen. Inspect status line which fluctuates around 30fps.
  7. Quit Amiberry and set display resolution in Manjaro to 1024x768 @ 60Hz.
  8. Repeat steps 2-6. Inspect status line which stays steady at 50fps.

Expected behavior
Video and audio should be correctly synced to monitor in _full-window_ or _fullscreen_ mode at the displays native resolution.

Screenshots
Amiberry Display configuration:
display configuration

Display resolution 1920x1080 @ 60Hz, full-window, visual and audio lag (see status bar):
status bar 16:9

Display resolution 1024x768 @ 60Hz, full-window, visual and audio in sync (see status bar):
status bar 4:3

Desktop (please complete the following information):

  • Device: Raspberry Pi 4 Model B
  • OS: Manjaro Raspberry Pi 4 XFCE 20.08
  • Amiberry Version: 3.2, 3.2.1, 3.3 beta

Additional context:
I experience the same problem when running Amiberry on Amibian 1.5ee, but have no problems when using Amiberry with RetroPie. Could it be a SDL2 issue that doesn't effect RetroPie as it uses DispmanX?

question

All 8 comments

Try disabling the compositor in Settings -> Window Manager tweaks

On Mon, Sep 14, 2020 at 2:55 PM Jon Patterson notifications@github.com
wrote:

Describe the bug
When running Amiberry on Manjaro (in XFCE desktop environment) I
experience sync issues when using either the full-window or fullscreen
display modes. This causes visual lag on the display and significant audio
lag which is choppy and out of sync. If I enable Status Line native the
FPS counter fluctuates around 30fps and there is a red light illuminated
immediately to the right of the FPS counter.

I have narrowed this down to occurring when the display resolution in
Manjaro is set to either my monitor native resolution of 2560x1440 or
1920x1080. If I change the display resolution in Manjaro to 1024x768 then
the FPS on the status bar stays steady around 50fps and the red light
immediately to the right of the FPS counter is not illuminated after
launch. Switching to Windowed mode works perfectly at any resolution.

I also tested this on my television at it's native resolution of 1920x1080
and have the same issue. It only works when I set the display resolution in
Manjaro to 1024x768. I have also tested various refresh rates which has no
affect.

To narrow things down further I can reproduce this consistently when using
a Quickstart configuration and booting to the kickstart screen. I can't
test lag on the kickstart screen, but the FPS counter clearly shows ~30fps
at native resolution and ~50fps at 1024x768.

To Reproduce
Steps to reproduce the behavior:

  1. Set display resolution in Manjaro to 1920x1080 @ 60Hz.
  2. Launch Amiberry and go to Quickstart page.
  3. Under Amiga Model choose "Amiga 1200", then click Set
    configuration
    .
  4. Go to Display page and set Screen mode to "Full-window".
  5. Go to Miscellaneous page and enable Status Line native.
  6. Click the Start button to launch kickstart screen. Inspect status
    line which fluctuates around 30fps.
  7. Quit Amiberry and set display resolution in Manjaro to 1024x768 @
    60Hz.
  8. Repeat steps 2-6. Inspect status line which stays steady at 50fps.

Expected behavior
Video and audio should be correctly synced to monitor in full-window or
fullscreen mode at the displays native resolution.

Screenshots
Amiberry Display configuration:
[image: display configuration]
https://camo.githubusercontent.com/1eba8c014dbab2fd278881e881010edcaab11547/68747470733a2f2f692e696d6775722e636f6d2f764d47704463522e706e67

Display resolution 1920x1080 @ 60Hz, full-window, visual and audio lag
(see status bar):
[image: status bar 16:9]
https://camo.githubusercontent.com/2e69722309685c05fee853c9c23d4cbf66294683/68747470733a2f2f692e696d6775722e636f6d2f776673724b61702e706e67

Display resolution 1024x768 @ 60Hz, full-window, visual and audio in sync
(see status bar):
[image: status bar 4:3]
https://camo.githubusercontent.com/06b0943e0b1e3763a841356021f202dd7edda0d8/68747470733a2f2f692e696d6775722e636f6d2f746d57555773642e706e67

Desktop (please complete the following information):

  • Device: Raspberry Pi 4 Model B
  • OS: Manjaro Raspberry Pi 4 XFCE 20.08
  • Amiberry Version: 3.2, 3.2.1, 3.3 beta

Additional context:
I experience the same problem when running Amiberry on Amibian 1.5ee, but
have no problems when using Amiberry with RetroPie. Could it be a SDL2
issue that doesn't effect RetroPie as it uses DispmanX?

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/midwan/amiberry/issues/693, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAHY72FAVR2NHX5KIZBHX23SFYHFTANCNFSM4RLSEV4A
.

That seems to have resolved it! Many thanks, it took you a lot less time for you to suggest a fix than it took for me to describe the issue!

Is this a known issue then? Seeing I seem to experience the same thing running Amiberry under Amibian 1.5ee is there a way to disable compositor in that environment, or is this specific to Manjaro?

Thanks!

I think it is because of a v-sync issue due to the compositor and SDL
together. But please don't quote me on that ;-)

On Mon, Sep 14, 2020 at 3:24 PM Jon Patterson notifications@github.com
wrote:

That seems to have resolved it! Many thanks, it took you a lot less time
for you to suggest a fix than it took for me to describe the issue!

Is this a known issue then? Seeing I seem to experience the same thing
running Amiberry under Amibian 1.5ee is there a way to disable compositor
in that environment, or is this specific to Manjaro?

Thanks!

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/midwan/amiberry/issues/693#issuecomment-692049691,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAHY72AU2IEFWYIZQREU6MTSFYKPNANCNFSM4RLSEV4A
.

I've got no idea on how Amibian works, so I can't comment on that. Sorry.

@jonpatterson
Amibian is running on top of a 32-bit RPI OS distro, so the problem there is probably due to the lower performance vs the 64-bit platform (and/or possibly the latest versions of SDL2 and drivers, that Manjaro comes with).

When 64-bit RPI OS comes out of beta, we'll have to compare the performance and see if it's the libraries/drivers or not. But for now, 32-bit platforms seem to be much slower when running the pure SDL2 version vs the Dispmanx one. On Manjaro, they have about the same performance.

One thing that should improve the performance further, when running under a desktop environment (this goes for both Manjaro and RPI OS), is to enable the SDL2 render thread setting in Amiberry. This only works with X11 currently, so don't try it if you are running it from the console with KMSDRM... ;)

To enable the setting, you'll have to edit the conf/amiberry.conf file, from where the Amiberry binary directory is, locate the line mentioning use_sdl2_render_thread and set that to yes. Then restart the emulator to pick up the changes.

Ah, that makes sense regarding performance on Amibian, as if I recall I was usually able to resolve it by reducing the audio frequency. Perhaps the new audio buffer size setting might help here as well.

I'll give the _sdl2_render_thread_ setting a try as well. So far I've always been using Amiberry under a desktop environment. I had tried to run it from console, but ran into problems building SDL2. To be honest it's been running so well under Manjaro that I'll probably stick with that, especially seeing the Ami Hybrid setup is letting me boot straight to Workbench and enjoy Linux apps at the same time!

Thanks for all your hard work @midwan, and to contributors like @solskogen! Really appreciate what you're doing with this application. and what it's allowing me to do on this humble piece of hardware!

@jonpatterson
Thanks for your kind words. I hope you will enjoy it!

@jonpatterson Side note: On Manjaro you don't need to build SDL2 yourself in order to get amiberry to work under console.
(sdl2_render_thread must be set to 0)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

henrikstengaard picture henrikstengaard  Â·  7Comments

ransom1122 picture ransom1122  Â·  5Comments

tenleftfingers picture tenleftfingers  Â·  8Comments

AnalogHero picture AnalogHero  Â·  5Comments

andreavitali picture andreavitali  Â·  6Comments