SVGAlib 1.4.3 with SDL 1.2.2

Hi all,

I’m currently having a problem trying to get the SVGAlib output device
working on SDL 1.2.2.

It appears that the code to detect whether someone is using SVGAlib
1.4.3 or one of the 1.9.x development versions isn’t working completely
proper. If you’re in X when you try to run a SDL program using the
SVGAlib output driver, it’ll report that no device can be found. I’ve
narrowed this is caused by the virtual terminal checking code in
SDL_svgavideo.c:

    /* See if we are connected to a virtual terminal */
    console = STDIN_FILENO;
    if ( console >= 0 ) {
            struct stat sb;
            struct vt_mode dummy;

            if ( (fstat(console, &sb) < 0) ||
                 (ioctl(console, VT_GETMODE, &dummy) < 0) ) {
                    console = -1;
            }
    }

If you’re in X, the ioctl(console, VT_GETMODE, &dummy) command will
return -1 and cause

return(((svgalib2 != -1) || (geteuid() == 0)) && (console >= 0));

to return 0 (i.e. failure).

In my case when I’m root and in X, the following would be set:

svgalib2 = -1
geteuid() = 0
console = -1

Which would cause the return function to look like this:

    return (0 || (1 && 0));

However, if I’m in one of my ttys it would look like the following and
start svgalib:

    return (0 || (1 && 1));

That’s all I’ve been able to figure out so for, but I’m still not
getting any graphics on the screen like I do using the X driver or the
aalib driver… I’m going to keep looking but if anyone happens to find
more fixes, I would like to see them. :slight_smile:

Bryan–
http://www.bokeoa.com/ | @Bryan_Stillwell
GPG fingerprint: 33F7 44F2 8612 E02F 8DE8 97FB 621E 8A36 6DC1 32AF
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20011030/e87957b1/attachment.pgp

Hi all,

I’m currently having a problem trying to get the SVGAlib output device
working on SDL 1.2.2.

It appears that the code to detect whether someone is using SVGAlib
1.4.3 or one of the 1.9.x development versions isn’t working completely
proper. If you’re in X when you try to run a SDL program using the
SVGAlib output driver, it’ll report that no device can be found.

I believe this is correct. Can you actually start an SVGAlib program
when you’re in X?

-Sam Lantinga, Software Engineer, Blizzard Entertainment

Seemed to work while I still had svgalib installed on my RedHat
machines… svgalib switches to a new console, just as when you’re
starting from a text console.

Indeed, it does make the system blow up or freeze occasionally with some
hardware/X combos, as does switching between svgalib and X consoles, but
that’s another story… (A well known problem, I think. Also applies to
fbdev + X, to some extent, although usually non-fatal - garbage on the
text console and the like.)

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Friday 02 November 2001 21:03, Sam Lantinga wrote:

Hi all,

I’m currently having a problem trying to get the SVGAlib output
device working on SDL 1.2.2.

It appears that the code to detect whether someone is using SVGAlib
1.4.3 or one of the 1.9.x development versions isn’t working
completely proper. If you’re in X when you try to run a SDL program
using the SVGAlib output driver, it’ll report that no device can be
found.

I believe this is correct. Can you actually start an SVGAlib program
when you’re in X?

Actually I can with my current set up, and once the svgalib program
finishes it returns me back to X (as long as nothing bad happened).

BryanOn Fri, Nov 02, 2001 at 12:03:01PM -0800, Sam Lantinga wrote:

I’m currently having a problem trying to get the SVGAlib output device
working on SDL 1.2.2.

It appears that the code to detect whether someone is using SVGAlib
1.4.3 or one of the 1.9.x development versions isn’t working completely
proper. If you’re in X when you try to run a SDL program using the
SVGAlib output driver, it’ll report that no device can be found.

I believe this is correct. Can you actually start an SVGAlib program
when you’re in X?


http://www.bokeoa.com/ | @Bryan_Stillwell
GPG fingerprint: 33F7 44F2 8612 E02F 8DE8 97FB 621E 8A36 6DC1 32AF

So, what, in your opinion is the best solution? I don’t have working SVGAlib,
so you’ll have to test anything we come up with…

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment> On Fri, Nov 02, 2001 at 12:03:01PM -0800, Sam Lantinga wrote:

I’m currently having a problem trying to get the SVGAlib output device
working on SDL 1.2.2.

It appears that the code to detect whether someone is using SVGAlib
1.4.3 or one of the 1.9.x development versions isn’t working completely
proper. If you’re in X when you try to run a SDL program using the
SVGAlib output driver, it’ll report that no device can be found.

I believe this is correct. Can you actually start an SVGAlib program
when you’re in X?

Actually I can with my current set up, and once the svgalib program
finishes it returns me back to X (as long as nothing bad happened).

Actually I can with my current set up, and once the svgalib program
finishes it returns me back to X (as long as nothing bad happened).

So, what, in your opinion is the best solution? I don’t have working
SVGAlib, so you’ll have to test anything we come up with…

I don’t see a reason to check if we’re in the console, so how about we
just remove that piece of code?

I tried to think of any problems this might cause, but you have to be
root to use the stable svgalib anyways so it should be ok. As for the
development 1.9.x series (where you can use a kernel module to run as
non-root), we should probably check if they have the correct permissions
first, but since I don’t use the 1.9.x series yet, I don’t know what
that check would be of…

Bryan–
http://www.bokeoa.com/ | @Bryan_Stillwell
GPG fingerprint: 33F7 44F2 8612 E02F 8DE8 97FB 621E 8A36 6DC1 32AF

Actually I can with my current set up, and once the svgalib program
finishes it returns me back to X (as long as nothing bad happened).

So, what, in your opinion is the best solution? I don’t have working
SVGAlib, so you’ll have to test anything we come up with…

I don’t see a reason to check if we’re in the console, so how about we
just remove that piece of code?

I tried to think of any problems this might cause, but you have to be
root to use the stable svgalib anyways so it should be ok. As for the
development 1.9.x series (where you can use a kernel module to run as
non-root), we should probably check if they have the correct permissions
first, but since I don’t use the 1.9.x series yet, I don’t know what
that check would be of…

The only thing I can think of is the SVGAlib driver would try to init
if you’re logged in remotely, but I’m not sure how big a problem that is.

Try the latest CVS snapshot - I just committed your suggestion to CVS.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

OTOH, what if you want it to, and SDL refuses?

Then again, that would probably apply only to embedded systems, and even
there, it’s probably a rare situation. (When I rlogin, telnet or whatever
into an embedded target system, it’s usually because it’s headless…)

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Friday 02 November 2001 23:44, Sam Lantinga wrote:

Actually I can with my current set up, and once the svgalib
program finishes it returns me back to X (as long as nothing bad
happened).

So, what, in your opinion is the best solution? I don’t have
working SVGAlib, so you’ll have to test anything we come up with…

I don’t see a reason to check if we’re in the console, so how about
we just remove that piece of code?

I tried to think of any problems this might cause, but you have to be
root to use the stable svgalib anyways so it should be ok. As for
the development 1.9.x series (where you can use a kernel module to
run as non-root), we should probably check if they have the correct
permissions first, but since I don’t use the 1.9.x series yet, I
don’t know what that check would be of…

The only thing I can think of is the SVGAlib driver would try to init
if you’re logged in remotely, but I’m not sure how big a problem that
is.

[clip]

I believe this is correct. Can you actually start an SVGAlib program
when you’re in X?

Seemed to work while I still had svgalib installed on my RedHat
machines… svgalib switches to a new console, just as when you’re
starting from a text console.

Indeed, it does make the system blow up or freeze occasionally with some
hardware/X combos, as does switching between svgalib and X consoles, but
that’s another story… (A well known problem, I think. Also applies to
fbdev + X, to some extent, although usually non-fatal - garbage on the
text console and the like.)

to confirm from here: Matrox G450-dualhead (ignoring second head:)
I run FB+svga+X from time to time; svgalib-1.9, XFree86-4* with current
Matrox driver, and kernel with matrox driver. I do not enable svgalib in
SDL btw…

svgalib does start in a new console from X
svgalib coexists with FB fine (since 2.4.9 IIRC :slight_smile:
svgalib acts funny with Matrox card, so I run it as rarely as I can get
away with… My monitor’s a little weird (an old Tystar noname 14"
monitor) so I need special definitions for monitor types for both FB and
X, and have never -quite- gotten them tuned right sigh. svgalib’s never
worked right on this monitor ever since I switched from an S3-Virge
videocard…

so yes, svgalib coexists on this hardware though.

G’day, eh? :slight_smile:
- Teunis PetersOn Fri, 2 Nov 2001, David Olofson wrote:

On Friday 02 November 2001 21:03, Sam Lantinga wrote:

Indeed, it does make the system blow up or freeze occasionally with
some hardware/X combos, as does switching between svgalib and X
consoles, but that’s another story… (A well known problem, I
think. Also applies to fbdev + X, to some extent, although usually
non-fatal - garbage on the text console and the like.)

Well, don’t fry fb + X with geforce and rivafb (which according to
the docs works for all nvidia cards, including geforce…)

Bombs the whole system here when switching from fb to X, even sysrq
doesn’t work …–
Trick


Linux User #229006 * http://counter.li.org

Space is to place as eternity is to time.
– Joseph Joubert

This depends on hardware actually. You cant, however, switch between any terminal at all when svgalib is running, it will screw up (except, i think, on one or two cards) But it will run when X is running (same idea as fbcon text consoles and X running at the same time, now, of course, if that doesnt work on your box, neither will svgalib and x) But, if you were asking about weather you can start an svgalib program in x, thats an obvious no. Use svgalib->ggi wrapper, and use the ggi->x output lib, or just use sdl’s x11 stuff.On 02-Nov-2001, Sam Lantinga wrote:

Hi all,

I’m currently having a problem trying to get the SVGAlib output device
working on SDL 1.2.2.

It appears that the code to detect whether someone is using SVGAlib
1.4.3 or one of the 1.9.x development versions isn’t working completely
proper. If you’re in X when you try to run a SDL program using the
SVGAlib output driver, it’ll report that no device can be found.

I believe this is correct. Can you actually start an SVGAlib program
when you’re in X?

-Sam Lantinga, Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Patrick “Diablo-D3” McFarland || unknown at panax.com

I believe this is correct. Can you actually start an SVGAlib program
when you’re in X?

Most people seems to use a call to openvt (or similar) to create a new vt
and change to it, before starting the actual svgalib program.

MadsOn Mon, 5 Nov 2001, Patrick McFarland wrote:


Mads Bondo Dydensborg. @Mads_Bondo_Dydensbor
If a man says something in a forest and there are no women around to
hear him, is he still wrong?

                                    - Anonymous