DOSbox and SDL error on Wayland
I tried installing DOSbox tonight to run some old games from the 90s. On first run, I got Exit to error: Can't init SDL No available video device
as output in my shell (Shell mode in Emacs). I looked up the SDL packages I had installed and seemed to have everything needed. After an extensive search that did not really give me any solution, I tried something someone in a forum had tried, but in a slightly different way than they did and it worked.
I echoed out $SDL_VIDEODRIVER
and got wayland
as my answer since I run the tiling window manager Sway. I checked to make certain I had xwayland installed and then tried launching DOSbox again with SDL_VIDEODRIVER=X11 dosbox
in a terminal and it worked. It will probably work for other programs that use SDL that won't launch on Wayland as well.
My search for solutions found a lot of users of different programs that used SDL that had trouble with getting their programs to run and with no credible solution given in any of the forums I visited. I hope this blog post will help people in that situation. Since most of the major desktop environments use Wayland by default now and some of us tiling WM users also use it, these kinds of problems should hopefully be eliminated by developers of most FOSS projects in the not too distant future. X11 has not been under active development since 2012 except for security updates, and Wayland is no longer the future, but has been the present for a long time.