Previous 2.8 on Fedora 38

Started by buckshot, June 10, 2023, 04:59:09 PM

Previous topic - Next topic

buckshot

THE BELOW STEPS FOR R1318 ARE NO LONGER NECESSARY AS WAS RESOLVED IN R1319 FROM THE PREVIOUS 2.8 SOURCEFORGE SVN
MAKE SURE TO INSTALL R1319 AS FOLLOWS:

svn checkout https://svn.code.sf.net/p/previous/code/trunk previous-code
cd previous-code
./configure --disable-rendering-thread
sudo make install    (make sure to do this as sudo or it will fail at very end of install trying to copy binaries and bins to /usr/local/bin)
Previous  (to start it)

If any issue in Wayland, try switching to X11 from fedora login screen





Had a few issues with Previous 2.8 R1318 via SVN from its latest sourceforge (https://sourceforge.net/p/previous/code/HEAD/tree/) on Fedora 38.

Few simple things resolved it:

- Make sure you are using either Gnome Xorg or Gnome Classic Xorg at login (this can be selected at login screen under the cog in bottom right after you type your username). Fedora defaults to Wayland screen manager by default since some release ago, and Previous will not work correctley with Wayland. Luckily you can switch back to Xorg X11 on the fly as of Fedora 38.

- grab the latest Previous SVN which is currently r1318:

[~]$: svn checkout https://svn.code.sf.net/p/previous/code/trunk previous-code

- All packages (SDL, libpcap, readline, zlib) seemed to be installed by Fedora already, but also make sure to install the sdl-devl package (despite sdl.x86_64 already installed, it still seemed to require things from devel as well)

[~]$: dnf install sdl-devel

Head into the previous-code directory and run configure with the option to disable rendering from secondary threads:

[~/previous-code]$: ./configure --disable-rendering-thread


* first error you may encounter: missing uint32_t header in VirtualFS.h and if this occurs, you simply need to add it back in to the "~/previous-code/src/ditool/VirtualFS.h" file with your editor of choice. just add the following under the #includes section:  #include <cstdint>

** second error you may encounter is a missing SDL_RENDERER reference. Basically the --disable-rendering-thread option is pointing to nothing in the code and must be set to something. You'll need to edit the following file "~/previous-code/src/dimension/nd_sdl.cpp" and edit it from SDL_RendererFlags vsync_flag = 0;  to use a failback renderer of  SDL_RendererFlags vsync_flag = SDL_RENDERER_ACCELERATED; . You should find this around line 55 of the .cpp file. Alternatively, if the ACCELERATED renderer gives later issues (black screen running previous), try setting it to SDL_RENDERER_SOFTWARE instead

- rerun the the "./configure --disable-rendering-thread" if needed and upon success, you can now make the install:

[~/previous-code]$: make install


- it should compile and install correctley now and you can run the Previous emulator

[~/previous-code]$: cd src
[~/previous-code/src]$: ./Previous


Should be good to go. If Previous runs and you see terminal output but only a flicker and the GUI app does not load, again you need to switch to X11 mode and you are likely in the default gnome wayland session.



* when running Previous, you may receive a warning that "XDG_RUNTIME_DIR is not defined in path".
  simply check and confirm if the env variable is set with:    echo $XDG_RUNTIME_DIR
** if its not set, just run:    export XDG_RUNTIME_DIR=/tmp/runtime-$UID
*** you can set this in your .bashrc or .bashprofile if you prefer.






andreas_g

Thank you for these instructions! The problems with wayland might be related to SDL2 or do you see any issues in Previous?

What errors do you see with the default (non-development) version of SDL2 and which version is installed by default? You should not need the development version, but Previous requires at least version 2.24.0.

I will add the missing include to VirtualFS.h with the next commit. But I do not understand the problem with vsync_flag. There is the exact same method used in fast_screen.c, Screen_Init(). Do you get an error from the compiler or from SDL during initialization?

buckshot

hiya andreas_g!

Actually was able to get it working in Wayland tonight, i think because originally i had corrected that SDL_Renderer to software, then later recomplied it with it set to accelerated.

This was the error I received for VirtualFS.h which the "#include <cstdint>" resolved:


/home/justin/previous-code/src/slirp/nfs/FileTableNFSD.cpp: In member function 'virtual uint64_t FileTableNFSD::getFileHandle(const VFSPath&)':
/home/justin/previous-code/src/slirp/nfs/FileTableNFSD.cpp:50:32: error: 'getFileHandle' is not a member of 'VirtualFS'
   50 |     uint64_t result(VirtualFS::getFileHandle(absoluteVFSpath));
      |                                ^~~~~~~~~~~~~
make[2]: *** [src/slirp/CMakeFiles/Slirp.dir/build.make:580: src/slirp/CMakeFiles/Slirp.dir/nfs/FileTableNFSD.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:513: src/slirp/CMakeFiles/Slirp.dir/all] Error 2
make: *** [Makefile:136: all] Error 2




This was the error I received received related to the SDL_Renderer being set to "0" when using the --disable-rendering-thread option and resolved by setting to either software or accelerated:

[ 69%] Building CXX object src/dimension/CMakeFiles/Dimension.dir/nd_sdl.cpp.o
/home/justin/previous-code/src/dimension/nd_sdl.cpp: In member function 'void NDSDL::init()':
/home/justin/previous-code/src/dimension/nd_sdl.cpp:55:36: error: invalid conversion from 'int' to 'SDL_RendererFlags' [-fpermissive]
   55 |     SDL_RendererFlags vsync_flag = 0;
      |                                    ^
      |                                    |
      |                                    int
make[2]: *** [src/dimension/CMakeFiles/Dimension.dir/build.make:188: src/dimension/CMakeFiles/Dimension.dir/nd_sdl.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:487: src/dimension/CMakeFiles/Dimension.dir/all] Error 2
make: *** [Makefile:136: all] Error 2



Although now that you mention it, it does seem my SDL is out of date:
[justin@darkSky ~]$ rpm -qa | grep sdl
sdl12-compat-1.2.60-3.fc38.x86_64
sdl12-compat-devel-1.2.60-3.fc38.x86_64



Nevertheless, it is working now and even under wayland:






andreas_g

#3
For the problem with the SDL_Renderer: Does it work if you change SDL_RendererFlags vsync_flag = 0; to uint32_t vsync_flag = 0;?

For the SDL version: The output only shows the version of some SDL to SDL2 compatibility layer which is not used by Previous. Interesting would be the version of SDL2.

Update: The fix for the missing include and the SDL_RendererFlags issue is online (r1319). Please check, if your problems are gone. You should not need to manually select accelerated or software renderer.

buckshot

yep that did it!

did a mkdir ~/r1319
cd into r1319
grabbed everything from the svn (svn checkout https://svn.code.sf.net/p/previous/code/trunk previous-code)
./configure --disable-rendering-thread
make install

no errors, compile and install completed first run!

Thanks andreas_g!!

andreas_g

Glad to hear that! Thank you for the detailed report and suggested solutions! That made it an easy fix.