Simple newbie question

Dear SDL list,

I have a simple question but can’t find the correct search to find the answer. I am using linux on a beagleboard
which boots with an X session on its DVI output. Since the device has no mouse or keyboard I access it remotely over ssh.

For my application I want to use SDL to control the DVI output but I have no idea how to do this - generally when I run my
test application it sends the output over X to the development host. If I disable X-forwarding it just says no video device
available. Both of which are sensible. Beyond this I am not sure where to start - I presume that I should find a way to disable
the X-session and install a framebuffer device (but I don’t know how) and then I will need a way to grab this interface even
though I don’t own the console.

Any suggestions for starting points?

thanks,

Sa_________________________________________________________________
More than messages?check out the rest of the Windows Live?.
http://www.microsoft.com/windows/windowslive/

This is actually not an SDL question so much as it is an X question.
But it’s very simple, so here’s what you need to concern yourself
with:

X applications determine which server they connect to by checking the
DISPLAY environment variable. Here is a pretty good guess:

DISPLAY=:0.0 ./testvidinfo

See how that works out for you!On Thu, Jul 2, 2009 at 7:08 AM, not disclosed wrote:

Dear SDL list,

I have a simple question but can’t find the correct search to find the
answer.? I am using linux on a beagleboard
which boots with an X session on its DVI output.? Since the device has no
mouse or keyboard I access it remotely over ssh.

For my application I want to use SDL to control the DVI output but I have no
idea how to do this - generally when I run my
test application it sends the output over X to the development host.? If I
disable X-forwarding it just says no video device
available. Both of which are sensible. Beyond this I am not sure where to
start - I presume that I should find a way to disable
the X-session and install a framebuffer device (but I don’t know how) and
then I will need a way to grab this interface even
though I don’t own the console.

Any suggestions for starting points?

thanks,

Sa


check out the rest of the Windows Live?. More than mail?Windows Live? goes
way beyond your inbox. More than messages


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


http://codebad.com/

For my application I want to use SDL to control the DVI output but I have no
idea how to do this - generally when I run my
test application it sends the output over X to the development host.? If I
disable X-forwarding it just says no video device
available. Both of which are sensible. Beyond this I am not sure where to
start - I presume that I should find a way to disable
the X-session and install a framebuffer device (but I don’t know how) and
then I will need a way to grab this interface even
though I don’t own the console.

If you have no input device whatsoever, X won’t cut it for you (well,
unless you can deal with having no input in your application?!? might
be the case if your thing is used as a monitoring/status display,
say). If you used the framebuffer support, I think you could SSH in,
and the keyboard input could come from your SSH session, but there
would be no mouse. I’m not sure if SDL can deal with keyboard input
through stdin, or if the framebuffer support tries to open
/dev/console or something like that? You might have to hack it a bit,
or just do your keyboard input yourself.

The beagleboard has USB, no? The easiest thing to do would probably be
to plug a mouse in there, which would allow you to both use the mouse
with the framebuffer (and get keyboard input through SSH), or to just
run an X server (which won’t be able to get the keyboard input from
your SSH, but you could also plug in a USB keyboard, of course).On Thu, Jul 2, 2009 at 7:08 AM, not disclosed wrote:


Thanks to pphaneuf and donny.viszneki for swift replies:

Donny’s suggestion works* but I still have the pointer on the screen.

I thought I might explain a little more about what I am after:

I need no keyboard or mouse input, I am just using the beagleboard to drive a
video projector chip. The input will come over the network via a home made protocol
or from a USB webcam attached to the device. Its a bit complex but in simple terms
I’ll read input from the webcam, process it and output the results to the video
device.

I’d prefer it if I could strip X out of the system. It might be that I don’t even need
SDL, although it is a nice interface that I like. If I need to stick with X I need
to find a way to get rid of the pointer (which is present even though there is no
mouse).

Any more suggestions?

Thanks for you help,

Sa

  • I suppose I am so used to X barring none owners from the display when ,
    someone is logged on it didn’t occur to me this was possible!> Date: Thu, 2 Jul 2009 16:16:41 -0400

From: pphaneuf at gmail.com
To: sdl at lists.libsdl.org
Subject: Re: [SDL] Simple newbie question

On Thu, Jul 2, 2009 at 7:08 AM, not disclosed<@not_disclosed> wrote:

For my application I want to use SDL to control the DVI output but I have no
idea how to do this - generally when I run my
test application it sends the output over X to the development host. If I
disable X-forwarding it just says no video device
available. Both of which are sensible. Beyond this I am not sure where to
start - I presume that I should find a way to disable
the X-session and install a framebuffer device (but I don’t know how) and
then I will need a way to grab this interface even
though I don’t own the console.

If you have no input device whatsoever, X won’t cut it for you (well,
unless you can deal with having no input in your application?!? might
be the case if your thing is used as a monitoring/status display,
say). If you used the framebuffer support, I think you could SSH in,
and the keyboard input could come from your SSH session, but there
would be no mouse. I’m not sure if SDL can deal with keyboard input
through stdin, or if the framebuffer support tries to open
/dev/console or something like that? You might have to hack it a bit,
or just do your keyboard input yourself.

The beagleboard has USB, no? The easiest thing to do would probably be
to plug a mouse in there, which would allow you to both use the mouse
with the framebuffer (and get keyboard input through SSH), or to just
run an X server (which won’t be able to get the keyboard input from
your SSH, but you could also plug in a USB keyboard, of course).


http://www.google.com/profiles/pphaneuf


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Invite your mail contacts to join your friends list with Windows Live Spaces. It’s easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us

I need no keyboard or mouse input, I am just using the beagleboard to drive
a
video projector chip.? The input will come over the network via a home made
protocol
or from a USB webcam attached to the device. Its a bit complex but in simple
terms
I’ll read input from the webcam, process it and output the results to the
video
device.

Ah, well then, if that’s the case, you might want to take a look at
the SDL_ShowCursor function, should let you hide the cursor. :slight_smile:

I’d prefer it if I could strip X out of the system.? It might be that I
don’t even need
SDL, although it is a nice interface that I like.? If I need to stick with X
I need
to find a way to get rid of the pointer (which is present even though there
is no
mouse).

If you need no input at all, you can keep developing with X, and
whenever you feel like getting rid of it, take a look at compiling a
version of SDL with framebuffer support. Normally, your program should
work pretty much unmodified, you just won’t need X to be running
anymore! Note that the framebuffer support doesn’t include OpenGL
(that I know of), so you might be restricted to 2D only (on the other
hand, I suspect that if there’s hardware 3D at all on the beagleboard,
it’s probably not much to speak of anyway)…On Fri, Jul 3, 2009 at 3:45 AM, not disclosed wrote:


Thanks again-

I have just discovered I can do this:

main(){
int fbdev;
unsigned int *fb;

fbdev=open("/dev/fb0", O_RDWR);
fb=(unsigned int )mmap(0, 640480*sizeof(unsigned int), PROT_WRITE, MAP_SHARED, fbdev, 0);

Which is ideal for me and I think all I need to do is get rid of X now…

Thanks,

SA> Date: Fri, 3 Jul 2009 04:43:12 -0400

From: pphaneuf at gmail.com
To: sdl at lists.libsdl.org
Subject: Re: [SDL] Simple newbie question

On Fri, Jul 3, 2009 at 3:45 AM, not disclosed<@not_disclosed> wrote:

I need no keyboard or mouse input, I am just using the beagleboard to drive
a
video projector chip. The input will come over the network via a home made
protocol
or from a USB webcam attached to the device. Its a bit complex but in simple
terms
I’ll read input from the webcam, process it and output the results to the
video
device.

Ah, well then, if that’s the case, you might want to take a look at
the SDL_ShowCursor function, should let you hide the cursor. :slight_smile:

I’d prefer it if I could strip X out of the system. It might be that I
don’t even need
SDL, although it is a nice interface that I like. If I need to stick with X
I need
to find a way to get rid of the pointer (which is present even though there
is no
mouse).

If you need no input at all, you can keep developing with X, and
whenever you feel like getting rid of it, take a look at compiling a
version of SDL with framebuffer support. Normally, your program should
work pretty much unmodified, you just won’t need X to be running
anymore! Note that the framebuffer support doesn’t include OpenGL
(that I know of), so you might be restricted to 2D only (on the other
hand, I suspect that if there’s hardware 3D at all on the beagleboard,
it’s probably not much to speak of anyway)…


http://www.google.com/profiles/pphaneuf


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Windows Live?: Keep your life in sync. Check it out!
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_012009

now that’s nice…
short, sweet, and completely unportable.

I just wish it were practical for games, etc…On Friday, 3 July 2009 05:07:47 not disclosed wrote:

Thanks again-

I have just discovered I can do this:

main(){
int fbdev;
unsigned int *fb;

fbdev=open("/dev/fb0", O_RDWR);
fb=(unsigned int )mmap(0, 640480*sizeof(unsigned int), PROT_WRITE,
MAP_SHARED, fbdev, 0);

Which is ideal for me and I think all I need to do is get rid of X now…

Thanks,

SA

It doesn’t matter that it isn’t portable for me - the hardware cannot run anywhere else - it is a one off…

The one problem I have remaining is that I can disable X fine and after I disable X I have a working
framebuffer. The problem is if my display is disconnected and reconnected (or not turned on before
X etc), the display no longer works. I can fix this by starting X and stopping it but I haven’t been able
to emulate this from my own code. I know this is not the place but does anyone know how to kick the
framebuffer back into life? (using omapfb).

Cheers,

SA> From: llubnek at gmail.com

To: sdl at lists.libsdl.org
Date: Fri, 3 Jul 2009 07:04:40 -0400
Subject: Re: [SDL] Simple newbie question

On Friday, 3 July 2009 05:07:47 not disclosed wrote:

Thanks again-

I have just discovered I can do this:

main(){
int fbdev;
unsigned int *fb;

fbdev=open("/dev/fb0", O_RDWR);
fb=(unsigned int )mmap(0, 640480*sizeof(unsigned int), PROT_WRITE,
MAP_SHARED, fbdev, 0);

Which is ideal for me and I think all I need to do is get rid of X now…

Thanks,

SA

now that’s nice…
short, sweet, and completely unportable.

I just wish it were practical for games, etc…


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Invite your mail contacts to join your friends list with Windows Live Spaces. It’s easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us