Switch Between Lcd And Tv-out Display


kouky

Member
Joined
Sep 3, 2006
Messages
185
Location
London
Website
www.caou.org
Is there an easy way to switch between the LCD and the TV-out display during the execution of a program ?
There's a short article about this on the gp2x wikipedia, but it's not very clear :/
 
I think thats all you need, code/comments by rlyeh
//now activate TV out by opening this device
tv=open("/dev/cx25874",O_RDWR);

//set TV video mode (mode 3 is 720x480Ix16_30Hz NTSC; mode 4 is 720x576Ix16_50Hz PAL)
//note: there are other video modes supported by the module driver (modes 0,1 and 5) but they do not work at all in our gp2xs/tvs. trust me.
ioctl(tv, _IOW('v', 0x02, unsigned char), 4);
 
Thank you very much! I will try that as soon as possible.
I was referring to this wiki page:
http://wiki.gp2x.org/wiki/TV-out_support
I was clear about the settings, but not about the code to "activate" the TV-Out.
How do you desactivate the tv-out and come back to LCDmode ?
That page is just about handling tv out once it's been activated. http://wiki.gp2x.org/wiki/Cx25784 is the page you need for enabling tv out. With that code you can still only activate the crappy dvd modes gph have provided for us (ie, unnecessary scaling of 320x240 screens with far too much overscan). Rlyeh has mentioned that he's looking into setting a true 320x240 game mode but I don't know how far he's got. I tried myself a couple of days ago and got a nice 320x240 display fitting perfectly on the screen, only problem is the output was completely white :(.
 
Last edited by a moderator:
Thank you.
And is there a way not to turn off the gp2x screen when tv out is enabled ?

More difficult:
Is it possible to have 2 differents screen displays ? like a DS game.
 
http://wiki.gp2x.org/wiki/Cx25784 is the page you need for enabling tv out. With that code you can still only activate the crappy dvd modes gph have provided for us (ie, unnecessary scaling of 320x240 screens with far too much overscan). Rlyeh has mentioned that he's looking into setting a true 320x240 game mode but I don't know how far he's got. I tried myself a couple of days ago and got a nice 320x240 display fitting perfectly on the screen, only problem is the output was completely white :(.

Hey there woogal,

I did not invest much time at that after writing it. However I managed to get a full working 720x576 mode by hw registers & cx25874 directly (instead of using kernel driver solution).

How do you know it was 320x240 if all pixels were white? :)
 
Last edited by a moderator:
Well only the 320x240 were white, the border was still black. I'm only assuming it was 320x240 because that was what I was trying to set. I suppose it could have been any resolution really :). Did you manage to set the overscan to reasonable values on your 720x576 mode?
 
Last edited by a moderator:
Thanks you!

But damn, I got compilation error with this line:
i2cw a = {.id = 0x8A, .addr = addr, .data = data};
66 C:\pikix\init.h expected primary-expression before '.' token

is it supposed to be C or C++?

I'm using C++
 
You can remove the i2c read and write functions, they're just left over from when I was testing something else and aren't needed to enable basic tv out.
 
Well only the 320x240 were white, the border was still black. I'm only assuming it was 320x240 because that was what I was trying to set. I suppose it could have been any resolution really :). Did you manage to set the overscan to reasonable values on your 720x576 mode?

I got the same output than specifying mode = 4, but i did it by using CX encoder directly & setting CLK & LCD @ gp2x, rather than using kernel module at all. So it was not kernel dependant anymore.

I've tried other video modes but I got green screens (YCbCr color for black?) instead of black or white screens.

How did you set your 320x240 mode? It might worth a look :)
 
Last edited by a moderator:
I did it by setting a PAL screen from the kernel module, but then changing the registers to try and get 320x240. I'm assuming it didn't work because the lcd and clk settings were completely wrong (I didn't have time to figure out how to set them myself), but I was hoping for at least a corrupted image :(.
 
However I managed to get a full working 720x576 mode by hw registers & cx25874 directly (instead of using kernel driver solution).
Got any tricks for programming the DPC correctly? It's easy enough to get the cx25874 to generate color bars at 640x480, but I'm not even sure where to set the pixel clock for the DPC.

The only stable output I've managed so far is the same autoconfig 0x34 (I'm using NTSC) that the standard TV mode is based on. When I try to set anything else, it looks like it's latching the same one or two random garbage pixels over the whole display.
 
Last edited by a moderator:
Back
Top