Screen Control Fullscreen ON/OFF

Y

yeet

Hi all,

I would like to make fullscreen white and fullscreen black using
Python on Linux. With in the specs of the LCD, I want to be able to
display fullscreen white and black approximately at 30Hz. Frequency
(on/off per second) will be input manually which is between 1-40Hz.
Any idea where to start ? Can Python perform such fast thing ?
 
Y

yeet

Hi all,

I would like to make fullscreen white and fullscreen black using
Python on Linux. With in the specs of the LCD, I want to be able to
display fullscreen white and black approximately at 30Hz. Frequency
(on/off per second) will be input manually which is between 1-40Hz.
Any idea where to start ? Can Python perform such fast thing ?

Forgot to mention and sorry for the pollution ;

My LCD has 2ms respond time thus it can handle a maximum of 50Hz ON/
OFF (white/black) thus seems to fit my 1-40Hz range. I am not asking
or looking for a fully working code, I just need some directions.
 
N

Nizamov Shawkat

Forgot to mention and sorry for the pollution ;

My LCD has 2ms respond time thus it can handle a maximum of 50Hz ON/
OFF (white/black) thus seems to fit my 1-40Hz range. I am not asking
or looking for a fully working code, I just need some directions.


It depends on whether you want sync to vblank or not. If not, that is
pretty easy - use sleep() or something similar. If you have to use
sync (screen is always either black or white, never partly black and
white) then it is much much more difficult. Actually I do not know of
any way to sync to it.

Once upon a time I had a P-3/500 linux box with homemade python
program that would wait for RTC interrupts (which was set to 8192 Hz
frequency) and performed different combinations of ADC/DAC/Digital-IO
at required timesteps . It worked really very well and with
submillisecond resolution.

Hope it helps,
S.Nizamov
 
N

Nizamov Shawkat

It depends on whether you want sync to vblank or not. If not, that is
pretty easy - use sleep() or something similar. If you have to use
sync (screen is always either black or white, never partly black and
white) then it is much much more difficult. Actually I do not know of
any way to sync to it.

But you do not have to sync to vblank anyway. So you can turn on
vblank sync for the videocard and then you will have either completely
black or completely white screen at each single time point, but this
will be delayed in regard to what you set in python.

Hope this helps,
S.Nizamov
 
U

Ulrich Eckhardt

Am 15.12.2011 12:12, schrieb yeet:
My LCD has 2ms respond time thus it can handle a maximum of 50Hz ON/
OFF (white/black) thus seems to fit my 1-40Hz range.

You might want to ask Santa for a new calculator, as in my book a
response time of 2ms would be enough for 250Hz (period = 2 * 2ms).

Reminds me of a hack that used a special pattern on a CRT to emit DCF77
signals, reprogramming any suitable radio-controlled clock in range.
What are you trying to do, just out of curiosity?

(c:

Uli
 
8

88888 Dihedral

Hi all,

I would like to make fullscreen white and fullscreen black using
Python on Linux. With in the specs of the LCD, I want to be able to
display fullscreen white and black approximately at 30Hz. Frequency
(on/off per second) will be input manually which is between 1-40Hz.
Any idea where to start ? Can Python perform such fast thing ?

Check pygame, pyimg and sdllib and wxpython.

Python is a high level language that was not bound to hardware.

One of the major strengths of Python is very easy to be supported
by programs in other languages, especially in C, Pascal and Fortran.

Also programs in Python are easy to debug and maintain.
 
Y

Yigit Turgut

Am 15.12.2011 12:12, schrieb yeet:


You might want to ask Santa for a new calculator, as in my book a
response time of 2ms would be enough for 250Hz (period = 2 * 2ms).

Reminds me of a hack that used a special pattern on a CRT to emit DCF77
signals, reprogramming any suitable radio-controlled clock in range.
What are you trying to do, just out of curiosity?

(c:

Uli

Yes that's correct, 50Hz limit is the limit of NVIDIA CUDA Linux
drivers limit. Screen can go higher rates on sucky windows.
I am trying to generate a visual stimulus that will be used for fNIR
and EEG captures.

But you do not have to sync to vblank anyway. So you can turn on
vblank sync for the videocard and then you will have either completely
black or completely white screen at each single time point, but this
will be delayed in regard to what you set in python.

Hope this helps,
S.Nizamov

It's not easy to do this basing on time, I think doing per frames is a
much better option. It's sounded like a very simple task at first but
I realize it's not that easy.Maybe I should write the screen blinker
in C or Assembly then call it from Python.
 
G

Grant Edwards

It depends on whether you want sync to vblank or not. If not, that is
pretty easy - use sleep() or something similar. If you have to use
sync (screen is always either black or white, never partly black and
white) then it is much much more difficult. Actually I do not know of
any way to sync to it.

I'm _guessing_ the results won't be acceptible unless you switch
during the veritical blanking period. (_is_ there a vertical blanking
period with a DVI or HDMI output?).

I have vague recollections that I think opengl has methods to do that.

If there is an easy way to do it, it'll probably be using pygame:

http://pygame.org/news.html

If pygame can't do it, try pyopengl:

http://pyopengl.sourceforge.net/

Here's a thread on how to do it on OSX:

http://www.idevgames.com/forums/thread-2974.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top