Menu

#430 Fuse 1.5.7 SDL2 patch

future
open
nobody
5
2023-05-12
2020-04-25
serdeliuk
No

Hello,

I have created a patch to port fuse 1.5.7 to SDL2 was tested and works well on Ubuntu 18 LTS
It is based on diff.sdl2_09.patch , modified all existing pathes and added few more.

Best regards,

Marc

1 Attachments

Discussion

1 2 > >> (Page 1 of 2)
  • serdeliuk

    serdeliuk - 2020-04-25

    I am terribly sorry, i didn't saw the discussions forum, this ticket can be closed.

     
    • Alberto Garcia

      Alberto Garcia - 2020-04-26

      I think that patches belong here rather than in the discussion forum :)

      This is great stuff, thanks a lot for the work! There was some work on SDL2 already (patch #326) but I think it had some issues. I think Sergio Baldoví was the one testing it ?

       
  • serdeliuk

    serdeliuk - 2020-04-26

    You're welcome, my pleaasure :)

    The patch is based on diff.sdl2_09.patch and i think indeed is Sergio Baldoví's work or Gergely Szasz, or both :),
    I have modified some of their work to fit 1.5.7 and added some extra things to work with the latest version.
    On Ubuntu with SDL1/2+X11 , SDL or ALSA sound seems to work properly, inluding full-screen/window resize with F11, on my arm machine i still have few issues with keys and i am working to solve them. And does not resize properly, but this will not be an issue as it will run only in full_screen mode afterall.

    Are you able to get from the dicussion forum latest attahment and add it here then and there replace the attachment with a link? Or maybe i need to upload the latest version?

     

    Last edit: serdeliuk 2020-04-26
  • serdeliuk

    serdeliuk - 2020-04-26

    In diff.sdl2_10.1_fuse-1.5.7.patch i have fixed/replaced some delimiters with tabs to avoid coplie erros on my arm machine

     
    • Alberto Garcia

      Alberto Garcia - 2020-04-27

      Hi! I just gave it a quick test, so far it seems to work fine, thanks !! When I have some time I would like to give a closer look to the code itself.

       
  • serdeliuk

    serdeliuk - 2020-04-27

    If you think will be easier i can give you patches per file instead a single patch

     
    • Alberto Garcia

      Alberto Garcia - 2020-04-27

      Oh, don't worry, it won't be necessary :-) I'm used to handling and reviewing large patches.

      Ideally the patch would need to apply on top of the current master branch (it seems to conflict with the recent changes in configure.ac), but no need to worry about that now. I can actually do that, I was the one making a lot of changes to configure.ac since Fuse 1.5.7 came out.

      Thanks again!

       
  • serdeliuk

    serdeliuk - 2020-04-27

    Ah, i didn't thought that the master is not 1.5.7 i can refactor the patch to match the master as well if you prefer

     
  • serdeliuk

    serdeliuk - 2020-04-27

    I see, it fails on configure.ac and Makefile.am on master, i can easily repair them, just give few minutes.

     
  • serdeliuk

    serdeliuk - 2020-04-28

    I have created a patch for master branch it adds --with-sdl2 beside --with-sdl i have tested the patch under Ubbuntu 18LTS and works with sdl1, sdl2 and default gtk+

     
  • serdeliuk

    serdeliuk - 2020-04-28

    The master branch is the developement branch and 1.5.7 latest stable? Or how it is?

     
  • serdeliuk

    serdeliuk - 2020-04-28

    Fixed audio driver auto detection while using SDL1 or SDL2 video driver, and replaced some space delimiters with tabs.

     

    Last edit: serdeliuk 2020-04-28
    • Alberto Garcia

      Alberto Garcia - 2020-04-28

      It seems that it's not possible to use the GTK UI and the SDL audio driver now, is that intentional?

      Available audio drivers: alsa oss null

      I have SDL 1.2 and SDL 2 installed in my system. Without the patch:

      Available audio drivers: alsa sdl oss null

       
  • serdeliuk

    serdeliuk - 2020-04-28

    the configure script does not detect the sdl env if it is not specified, i will add a loop in case sdl is selected just for audio and upload the patch, probably two loops to allow sdl1 vs sdl2 probably

     
    • Alberto Garcia

      Alberto Garcia - 2020-04-28

      Ok, you can have a look at the current method in configure.ac:

      AM_PATH_SDL($SDL_VERSION, sdl_available=yes, sdl_available=no)

      and then use the value of $sdl_available as needed. You could use the same for SDL2 using AM_PATH_SDL2.

      Also, in Debian at least both SDL versions come with pkg-config files so you don't really need sdl.m4 or sdl2.m4 and you can use PKG_CHECK_MODULES instead:

      PKG_CHECK_MODULES([SDL2], [sdl2], [sdl2_available=yes], [sdl2_available=no])

      But maybe there's a good reason why we need to ship sdl.m4 that I'm not aware of ?

       
  • serdeliuk

    serdeliuk - 2020-04-28

    if --with-sdlX is not specified the $sdl_available variable is not set and must be set elsewhere, i think in the audio loop will be better than in the video loop, and must be specified per sdl version as well, because i didn't thought that sdl audio driver will be used (as i use alsa with sdl2 on my arm machine where i am porting fuse) i didn't cared too much :) i will fix the audio/video probably setting sdl2 by default/auto

     
  • serdeliuk

    serdeliuk - 2020-04-28

    I have fixed the SDL audio select using other UI than SDL
    In regards the sdl2.m4 .... welll.... i am not a programmer, that was my solution to fix my issues :)

    ./configure
    Available audio drivers: alsa sdl1 sdl2 oss null

    ./configure --with-audio-driver=sdl2 --with-sdl
    configure: error: requested audio driver sdl2 cannot be used with SDL UI

    ./configure --with-audio-driver=sdl2
    User interface: gtk
    Using GTK+ 3: no
    Joystick support: no
    zlib support: yes
    libxml2 support: no
    libpng support: yes
    Available audio drivers: alsa sdl1 sdl2 oss null
    Selected audio driver: sdl2
    Spectranet support: yes
    SpeccyBoot support: yes
    Desktop integration: no

     
    • Alberto Garcia

      Alberto Garcia - 2020-04-29

      Thanks for the new patch!

      A few things:

      • This patch breaks joystick support. Passing --with-x --with-audio-driver=sdl should enable the GTK UI, SDL audio and joystick support (using also SDL). This works in master.

      • There's three audio drivers now: sdl, sdl1 and sdl2. There should only be one. In general I would not treat SDL and SDL2 as two separate drivers, neither for audio nor for the UI. Bear in mind that it's not possible to use both SDL versions at the same time, you cannot have SDL1 UI and SDL2 audio.

      • The user should only need to choose "SDL yes" or "SDL no", and if the user wants SDL (for the audio driver or for the UI) then the configure script should use SDL2 if available, and SDL1 if not. Optionally we could add something like --disable-sdl2 in case the user really doesn't want to use SDL2 (we already have --disable-gtk3 for the GTK2/GTK3 case).

      • Because of all the above I wouldn't have UI_SDL and UI_SDL2. I would simply have UI_SDL. If in some case you need to know the exact version then you can use the macros that SDL provides for that, see here for example.

      And I didn't have the time to check more.

      I'm quite familiar with autoconf and automake, and I was doing most of the changes to configure.ac lately. I can help with that part if you want!

       
  • serdeliuk

    serdeliuk - 2020-04-29

    Well..., on systems where sdl1 and sdl2 audio drivers exists both there are already two diferent SDL_audio drivers with two diferent sets of headers and two diferent linking libraries and thats why you and me have sdl1 and sdl2 options for audio (we have both SDL versions installed) those two audio drivers cannot be used with SDL1 or SDL2 UI, where added just to be used only with other UIs

    In regards the plain sdl audio driver, it is added by the --with-sdl or --with-sdl2 when enabled the desired SDL UI and it is the default for the corect linkend version of SDL library, it can be changed by --with-audio-driver=alsa for example, or to any other available audio drivers but not sdl1 or sdl2

    Unfortunately I do not have resources to pursue the path of corectly enabling SDL2 into the fuse emulator without breaking other functions as i want to channel my resources porting fuse-sdl2 to my ARM device with RC instead of keyboard, i have provided those patches, as i was already created them for my project, in case anyone else needs SDL2 with fuse 1.5.7/master, now should work, but indeed there are better ways to add SDL2 which now already works, it is just a matter of fine tune configuration options.

     

    Last edit: serdeliuk 2020-04-29
    • Alberto Garcia

      Alberto Garcia - 2020-04-29

      Unfortunately I do not have resources to pursue the path of corectly enabling SDL2 into the fuse emulator without breaking other functions

      No problem, I can help with that part! :-)

      We actually have the situation that right now it's already possible to use SDL2 as long as it's only for the joystick and audio driver and not for the UI. So the GTK build can benefit from that.

      If you want I can prepare the necessary changes to configure.ac to support SDL2 for audio and joystick, and then we try to integrate the rest of your patch that adds UI support.

      What do you think? Thanks!

       
      • serdeliuk

        serdeliuk - 2020-04-29

        great, add all your modifications then and see from there what we should modify to add the SDL2 UI

         
  • serdeliuk

    serdeliuk - 2020-04-29

    Just to mention, the --with-audio-driver=sdl does not exists per-se sdl without a number appear only when a SDL UI it is used.

    I have fixed the joystick support and attached a new patch.

     
  • serdeliuk

    serdeliuk - 2020-04-29

    It seems that the joystick module should be ported to SDL2 too, it only works with sdl1 at this stage.
    [UPDATE] False alarm, passing --with-x render a working joystick in SDL2 too
    Otherwise following error occur
    ./fuse: error: sorry, joystick 1 is inadequate! Error: Failed loading udev_device_get_action: /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0: undefined symbol: _udev_device_get_action

     

    Last edit: serdeliuk 2020-04-29
  • Alberto Garcia

    Alberto Garcia - 2020-04-29

    Ok, here's the patch to add SDL 2 support for the audio and joystick drivers.

    SDL 2 is now selected by default but there's the new --disable-sdl2 option to select SDL 1 instead.

    The SDL UI still requires SDL 1, so if Fuse is built using --with-sdl then SDL 1 is also selected.

    One benefit of this is that users of the GTK UI don't need to depend on the obsolete SDL 1 library anymore, so I think this patch can already be applied (in fact I started using it for the Flatpak build because the Flatpak runtime comes with SDL 2 only).

    If we want to add SDL 2 support for the UI I think that we would only need to remove the if test "$sdl_ui" = yes -a "$sdl2" = yes block from configure.ac

     
    • Sergio Baldoví

      Sergio Baldoví - 2021-02-24

      Thank you. Committed in [9650fe].

       

      Related

      Commit: [9650fe]

1 2 > >> (Page 1 of 2)

Log in to post a comment.