(no subject)
Jul. 31st, 2004 01:51 amI got Wine running Starcraft with decent interactive performance. I spent a long time trying to work around the direct graphics access problem by some fairly bizarre means, but this was really a bit of a red herring: the reason that the mouse and keyboard didn't work as root was because DGA was available as root but that wine's support for it had a bug which prevented the mouse and keyboard working at all. Having found someone's patch for this latter problem under a rock, it didn't take long before it was all running relatively smoothly.
Tomorrow I try to get Brood War working too, and if that doesn't take too long see about getting network play working too.
The first attempt at "bizarre means" was to try to use Linux's capabilities support to allow Wine access to /dev/mem (which is what DGA needs). (File permissions aren't enough, you need CAP_SYS_RAWIO too.) Unfortunately the actual support for this feature is poorly documented and has bits missing that I had to bodge up, and in the end I couldn't make it behave like I wanted even then. I did't think this was a "bizarre means" when I started but I've revised this opinion.
The second attempt was to use a setuid helper and and LD_PRELOADed wrapper for open() to smuggle in a root-opened file descriptor onto /dev/mem. People who've previously noticed my fondness for LD_PRELOAD might reasonably wonder why I only tried this second. This worked fine but since it brought up the mouse/keyboard problem again was what made me realize that the problem was nothing to do with root and all to do with DGA. (So trying to fix the wrong problem can be helpful after all, if it leads you to the right problem.)