Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KMSDRM video regression #1294

Closed
cmitu opened this issue Apr 23, 2024 · 6 comments
Closed

KMSDRM video regression #1294

cmitu opened this issue Apr 23, 2024 · 6 comments
Assignees
Labels

Comments

@cmitu
Copy link
Contributor

cmitu commented Apr 23, 2024

Describe the bug

Using v5.7.0 and KMSDRM (current RaspiOS (bookworm), Pi4/64bit), the video output is very slow and basically unusable. Booting the very simple AmigaTestKit results in a flickering mouse cursor and the start 'page' of the kit is shown in about 1 min.

Looking at the log, I see Amiberry is looping while re-creating the SDL2 window (newlines added by me):

Amiberry v5.7.0 (2024-04-20) Logfile

Compiled against SDL2 v2.30.1, Linked against SDL2 v2.30.1
Allocated 16 MB for 24-bit area (0x0000000020000000) and 1152 MB for Z3 and RTG at real address (0x0000000060000000 - 0x00000000a8000020)
Enumerating display devices..
Sorting devices and modes...
SDL_GetDisplayMode failed: index must be in the range of 0 - 15
Enumerating SDL2 playback devices...
Detected 3 sound playback devices
Sound playback device 0: vc4-hdmi-0, MAI PCM i2s-hifi-0
Sound playback device 1: vc4-hdmi-1, MAI PCM i2s-hifi-0
Sound playback device 2: bcm2835 Headphones, bcm2835 Headphones
Enumerating SDL2 recording devices...
Detected 0 sound recording devices
Enumeration end
0:SDL2: vc4-hdmi-0, MAI PCM i2s-hifi-0
1:SDL2: vc4-hdmi-1, MAI PCM i2s-hifi-0
2:SDL2: bcm2835 Headphones, bcm2835 Headphones
Enumerating recording devices:
done
clipboard_init
Serial port enumeration..
MIDI: found devices: 3
MIDI: 0: 'ALSA', 'Midi Through Port-0'    OUT
MIDI: 1: 'ALSA', 'Midi Through Port-0' IN
MIDI: 2: 'ALSA', 'Synth input port (949:0)'    OUT
Controller init_kb_from_retroarch(0): Found
Controller init_kb_from_retroarch(1): Not found
KS ver = 33 (0x21)
Stored port 0/0 d=0: added 200 0
Stored port 0/0 d=0: added 200 0 System mouse MOUSE0
Port0: ID 'mouse' matched
Port1: ID 'joy0' matched
Port2: NONE
...
Getting Current Video Driver...
Current Display mode: bpp 32    SDL_PIXELFORMAT_ARGB8888        1280 x 1024     60Hz
KMSDRM detected, forcing Full-window mode
Creating Amiberry window...
SDL2: Set window not to minimize on focus loss
SNDRATE 312.0*227.0*50.080410=3546894.958099
PAL mode V=50.0804Hz H=15625.0879Hz (227x312+0) IDX=10 (PAL) D=0 RTG=0/0
RTGFREQ: 312*50.0804 = 15625.0879 / 50.1 = 312

Getting Current Video Driver...
Current Display mode: bpp 32    SDL_PIXELFORMAT_ARGB8888        1280 x 1024     60Hz
KMSDRM detected, forcing Full-window mode
Creating Amiberry window...
SDL2: Set window not to minimize on focus loss
SNDRATE 312.0*227.0*50.080410=3546894.958099
PAL mode V=50.0804Hz H=15625.0879Hz (227x312+0) IDX=10 (PAL) D=0 RTG=0/0
RTGFREQ: 312*50.0804 = 15625.0879 / 50.1 = 312

Getting Current Video Driver...
Current Display mode: bpp 32    SDL_PIXELFORMAT_ARGB8888        1280 x 1024     60Hz
KMSDRM detected, forcing Full-window mode
Creating Amiberry window...
SDL2: Set window not to minimize on focus loss
SNDRATE 312.0*227.0*50.080410=3546894.958099
PAL mode V=50.0804Hz H=15625.0879Hz (227x312+0) IDX=10 (PAL) D=0 RTG=0/0
RTGFREQ: 312*50.0804 = 15625.0879 / 50.1 = 312

Getting Current Video Driver...
Current Display mode: bpp 32    SDL_PIXELFORMAT_ARGB8888        1280 x 1024     60Hz
KMSDRM detected, forcing Full-window mode
Creating Amiberry window...
SDL2: Set window not to minimize on focus loss
SNDRATE 312.0*227.0*50.080410=3546894.958099
PAL mode V=50.0804Hz H=15625.0879Hz (227x312+0) IDX=10 (PAL) D=0 RTG=0/0
RTGFREQ: 312*50.0804 = 15625.0879 / 50.1 = 312
--- SIGTERM ---

To Reproduce

Compile Amiberry for Pi4, (PLATFORM=rpi4-64-sdl2) and make sure the installed SDL2 has KMSDRM video support, then start Amiberry outside a desktop env.

Expected behavior
Video output to not be choppy/slow.

Desktop (please complete the following information):

  • OS: RaspiOS 12 bookworm
  • Version: 5.7.0

Additional context
KMSDRM SDL2 video driver used, no desktop (X11/Wayland) involved.
Maybe caused by 2428b30 ?

@solskogen
Copy link
Collaborator

Are you only seeing flickering in the GUI? In that case, that's normal. If you turn on the status line, what kind of FPS do you get?

@cmitu
Copy link
Contributor Author

cmitu commented Apr 23, 2024

The flickering is not in the GUI, I just start directly AmigaTestKit.adf.

If you turn on the status line, what kind of FPS do you get?

I'll try to add that to the .conf and re-test.

@solskogen
Copy link
Collaborator

Can you also show all un-commented lines from config.txt?

@cmitu
Copy link
Contributor Author

cmitu commented Apr 23, 2024

Here is the amiberry.conf file I have (saved with 5.6.6 I think).

amiberry.conf
Quickstart=1
read_config_descriptions=yes
write_logfile=yes
default_line_mode=0
rctrl_as_ramiga=no
gui_joystick_control=yes
input_default_mouse_speed=100
input_keyboard_as_joystick_stop_keypresses=no
default_open_gui_key=F12
default_quit_key=
default_ar_key=Pause
default_fullscreen_toggle_key=
rotation_angle=0
default_horizontal_centering=no
default_vertical_centering=no
default_scaling_method=-1
default_frameskip=no
default_correct_aspect_ratio=yes
default_auto_crop=no
default_width=720
default_height=568
default_fullscreen_mode=1
default_stereo_separation=7
default_sound_buffer=8192
default_sound_pull=yes
default_joystick_deadzone=33
default_retroarch_quit=yes
default_retroarch_menu=yes
default_retroarch_reset=no
default_retroarch_vkbd=no
default_controller1=joy1
default_controller2=joy2
default_controller3=
default_controller4=
default_mouse1=mouse
default_mouse2=joy0
default_whd_buttonwait=no
default_whd_showsplash=yes
default_whd_configdelay=0
default_whd_writecache=no
default_whd_quit_on_exit=no
disable_shutdown_button=no
allow_display_settings_from_xml=yes
default_soundcard=0
default_vkbd_enabled=no
default_vkbd_hires=no
default_vkbd_exit=no
default_vkbd_language=US
default_vkbd_style=Original
default_vkbd_transparency=0
default_vkbd_toggle=guide
path=/opt/retropie/emulators/amiberry
config_path=/opt/retropie/emulators/amiberry/conf/
controllers_path=/opt/retropie/emulators/amiberry/controllers/
retroarch_config=/opt/retropie/emulators/amiberry/conf/retroarch.cfg
whdboot_path=/opt/retropie/emulators/amiberry/whdboot/
rom_path=/opt/retropie/emulators/amiberry/kickstarts/
rp9_path=/opt/retropie/emulators/amiberry/rp9/
floppy_sounds_dir=/opt/retropie/emulators/amiberry/data/floppy_sounds/
data_dir=/opt/retropie/emulators/amiberry/data/
saveimage_dir=/opt/retropie/emulators/amiberry/savestates/
savestate_dir=/opt/retropie/emulators/amiberry/savestates/
ripper_dir=/opt/retropie/emulators/amiberry/ripper/
inputrecordings_dir=/opt/retropie/emulators/amiberry/inputrecordings/
screenshot_dir=/opt/retropie/emulators/amiberry/screenshots/
nvram_dir=/opt/retropie/emulators/amiberry/nvram/
ROMs=5
ROMName=Freezer: Action Replay Mk III v3.17 (256k)
ROMPath=/opt/retropie/emulators/amiberry/kickstarts/Action Replay Mk III v3.17 (1991)(Datel Electronics).rom
ROMType=524290
ROMName=CDTV/A570 extended ROM v2.30 (256k) [391298-01]
ROMPath=/opt/retropie/emulators/amiberry/kickstarts/CDTV Extended-ROM v2.3 (1992)(Commodore)(CDTV).rom
ROMType=2048
ROMName=KS ROM v1.2 (A500,A1000,A2000) rev 33.180 (256k) [315093-01]
ROMPath=/opt/retropie/emulators/amiberry/kickstarts/Kickstart v1.2 rev 33.180 (1986)(Commodore)(A500-A1000-A2000).rom
ROMType=256
ROMName=Freezer: HRTMon v2.37 (built-in)
ROMPath=:HRTMon
ROMType=524291
ROMName=AROS KS ROM (built-in) (1024k)
ROMPath=:AROS
ROMType=256
MRUDiskList=0
MRUCDList=0
MRUWHDLoadList=0
  

Interestingly, if I toggle the GUI via F12, there is no slowdown. Also, if I toggle Show Line native and save the configuration for the AmigaTestKit.adf file, then subsequent starts don't show the slowdown and also the cursor mouse is gone/non flickering. Once I remove the .uae saved config and start it, the issue comes back.

@midwan midwan self-assigned this May 3, 2024
@midwan midwan added the bug label May 4, 2024
@midwan
Copy link
Collaborator

midwan commented May 4, 2024

I can recreate it, it only happens if you skip loading the GUI on startup.

@midwan midwan closed this as completed in ea91211 May 4, 2024
midwan added a commit that referenced this issue May 4, 2024
When KMSDRM was detected, the currprefs were set to Full-Window. However, changed_prefs was not updated also, triggering a detection loop since the prefs were different.
@cmitu
Copy link
Contributor Author

cmitu commented May 5, 2024

Thank you @midwan for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants