Page 1 of 1

Strange composite video behaviour

Posted: Tue Jun 11, 2013 1:39 am
by scottinthebooth

I've been using my Pi now for a couple months without any issues but this latest problem has me baffled. I'm trying to connect my Pi / Python / Pygame to an existing display using the composite out. When I start my program the display goes black (like its supposed to) but no graphics ever appear. I waited a good minute or so to see if it just needed to catch up. When I finally gave up on it I pressed CTRL + C and my graphics appeared! Anyone have thoughts as to why I have to "jump start" my program? I'm using the code from Adafruit to select the frame buffer ... ramebuffer

Code: Select all

        drivers = ['fbcon', 'directfb', 'svgalib']
        found = False
        for driver in drivers:
            # Make sure that SDL_VIDEODRIVER is set
            if not os.getenv('SDL_VIDEODRIVER'):
                os.putenv('SDL_VIDEODRIVER', driver)
            except pygame.error:
                print 'Driver: {0} failed.'.format(driver)
            found = True

Re: Strange composite video behaviour

Posted: Thu Jul 04, 2013 10:19 pm
by selectnone
I'm looking for a solution to this too

Re: Strange composite video behaviour

Posted: Thu Jul 04, 2013 11:03 pm
by selectnone
Ahah! I think I have a solution!

It looks like this script only works if the display is set to 640x480?
My framebuffer-draw scripts started working when I set these settings in my /boot/config.txt:

Code: Select all

I was previously using 320x240 to match the screen I'm using, and none of the pygame-framebuffer scripts I tried were working for me.

The comment for those lines in boot.txt says:
# uncomment to force a console size. By default it will be display's size minus
# overscan.
The framebuffer sizes are commented-out by default, so pygame would be dealing with some invalid resolution.

I bet some clever bod will be able to fix that script to work with other resolutions, now I've tracked it down.

I'd really like to get it working at 320x240 as it'll render faster, but this'll do for now.