Lenard Lindstrom | 1 Sep 2009 20:25

Re: Re: Movie module being merged

Hi Tyler,

Debian lenny, Python 2.5,

I am getting a segfault in _movie_test.py, test_resize(), 
movie.resize(movie.width/2, movie.height/2).

The order of test method execution I get is test_height, test_init, 
test_play_pause, test_resize. I have modified _movie_test.py to execute 
as a stand-alone program so print statements work.

python test/_movie_test.py

Lenard

Tyler Laing wrote:
> Okay I've commited a revision, with a new MovieInfo object, which 
> allows the programmers to handle any kind of movie, if its loadable, 
> and do some introspection before actually loading the movie, like 
> screen-size etc.
>
> I was wondering if anyone that has had errors or crashes can send me 
> their logs please?
>
> -

B W | 2 Sep 2009 16:56
Picon

pymike!

What happened to the pymike tags on the pygame.org project pages? When
I click the pymike tag it only results in one entry. pymike is
proliferous!! He had at least 30--no, 50--bazillion entries. His code
is instructional and fun to read. Any way we can get the tags put
back? (Sorry, pymike, if this turns into drudge work for you.)

Gumm

Hugo Arts | 2 Sep 2009 18:14
Picon
Gravatar

Re: pymike!

IIRC he has a website as well where he keeps all his stuff. URL
escapes me at the moment, but I'm sure it'll come up if you google for
it.

Hugo

On Wed, Sep 2, 2009 at 4:56 PM, B W<stabbingfinger@...> wrote:
> What happened to the pymike tags on the pygame.org project pages? When
> I click the pymike tag it only results in one entry. pymike is
> proliferous!! He had at least 30--no, 50--bazillion entries. His code
> is instructional and fun to read. Any way we can get the tags put
> back? (Sorry, pymike, if this turns into drudge work for you.)
>
> Gumm
>

RB[0] | 2 Sep 2009 18:18
Picon

Re: pymike!

http://pymike.pynguins.com/

But it is down ATM

On Wed, Sep 2, 2009 at 11:14 AM, Hugo Arts <hugo.yoshi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
IIRC he has a website as well where he keeps all his stuff. URL
escapes me at the moment, but I'm sure it'll come up if you google for
it.

Hugo

On Wed, Sep 2, 2009 at 4:56 PM, B W<stabbingfinger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> What happened to the pymike tags on the pygame.org project pages? When
> I click the pymike tag it only results in one entry. pymike is
> proliferous!! He had at least 30--no, 50--bazillion entries. His code
> is instructional and fun to read. Any way we can get the tags put
> back? (Sorry, pymike, if this turns into drudge work for you.)
>
> Gumm
>

pymike | 2 Sep 2009 22:02
Picon

Re: pymike!

I removed "pymike" from the tags - I decided I didn't like using the tags as a way to broadcast my stuff. The pygame website really needs better project browsing.

But yeah, most of my stuff is on my website (which, like RB[0] said, is down at the moment - I'll try to get it back up some time this week).

Cheers,

--
- pymike

Richie Ward | 3 Sep 2009 21:33
Picon

Re: pymike!

He fixed the site, sorry it was my fault. I forgot to back up the sql
database when I formatted the server :P

2009/9/2 pymike <pymike93@...>:
> I removed "pymike" from the tags - I decided I didn't like using the tags as
> a way to broadcast my stuff. The pygame website really needs better project
> browsing.
>
> But yeah, most of my stuff is on my website (which, like RB[0] said, is down
> at the moment - I'll try to get it back up some time this week).
>
> Cheers,
>
> --
> - pymike
>

--

-- 
Thanks, Richie Ward

Picon
Favicon

Re: Numeric wireless keyboard

Jake b wrote:
> Hi
> 
>     I'm compiling the code (my first prg with gcc), and doesn't find SDL.h.
>      I have done a find on SDL (find -name "SDL.h"), without success. Where
>     and how can I find this file ?  Do I have to install SDL ? (I'm assuming
>     Python is using it and its there...)
> 
> 
> To search you can try: [ search starting on root, using insensitive case ]
>     $ find / -iname "SDL.h"
> 
> Did you try lsusb?
>     $ lsusb
> 
> To install sdl dev, run synaptic, and do a search for "sdl", it might be
> named "libsdl1.2-dev"
> 
> Ubuntu 9.04 is out.
> 
> To include SDL.h the best way is to: follow this link:
> http://www.libsdl.org/faq.php?action=listentries&category=3#21
> <http://www.libsdl.org/faq.php?action=listentries&category=3#21>
> 
> example:
>     $ gcc -o hiworld hiworld.c `sdl-config --cflags --libs`
> 
> -- 
> Jake

Hi
I have succedded to fix synaptic (and apt-get) and install SDL.
I compile and run the file, but it produce nothing when I move mouse or
type key (it types letter, but not the message printf should output)
But I don't know exactly how I should call the functions...!!!

Anything I should try ?

My target is to debug a keyboard not working with pygames on a ARM
platform.  I was suggested to make this little programe to debug this issue.

bellow is my code

Thanks

#include <stdio.h>
#include <stdlib.h>
#include "/usr/include/SDL/SDL.h"

int MySDL_WaitEvent()
{
    printf("About to call SDL_WaitEvent(&event)\n");
    SDL_Event event;
    SDL_WaitEvent(&event);

    switch (event.type)
    {
        printf("In switch/case of SDL_WaitEvent(&event)\n");
        case SDL_KEYDOWN:
            printf("The %s key was pressed!\n",
                SDL_GetKeyName(event.key.keysym.sym));
            break;
        case SDL_QUIT:
            exit(0);
    }
}

int MySDL_PollEvent()
{
    printf("About to call SDL_PollEvent(&event)\n");
    SDL_Event event;
    while ( SDL_PollEvent(&event) )
    {
        switch (event.type)
        {
            printf("In switch/case of SDL_PollEvent(&event)\n");
            case SDL_MOUSEMOTION:
                printf("Mouse moved by %d,%d to (%d,%d)\n",
                    event.motion.xrel, event.motion.yrel,
                    event.motion.x, event.motion.y);
                break;
            case SDL_MOUSEBUTTONDOWN:
                printf("Mouse button %d pressed at (%d,%d)\n",
                    event.button.button, event.button.x, event.button.y);
                break;
            case SDL_QUIT:
                exit(0);
        }
    }
}

int main(int argc, char *argv[])
{
    printf("About to call SDL_Init()\n");
    if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0 )
    {
        //fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError());
        printf("Unable to init SDL: %s\n", SDL_GetError());
        exit(1);
    }
    while(1)
    {
        printf("About to call MySDL_PollEvent()\n");
        MySDL_PollEvent();
        printf("About to call MySDL_WaitEvent()\n");
        MySDL_WaitEvent();
    }   //  while

    printf("About to call atexit()\n");
    atexit(SDL_Quit);
}

--

-- 
Pierre Lafrance
--

Brian Fisher | 4 Sep 2009 00:51
Favicon

Re: Numeric wireless keyboard

I think you probably can't get those messages without creating a window, so try creating a window before getting events.

 Also, you don't want to have a separate poll and wait func, which are both called and both check for different messages. Both those functions remove messages from the queue, so if a your poll function gets a SDL_KEYDOWN message, it would end up throwing out the message and then your wait function would never receive it. Just do the Poll thing, and make it's switch statement do the prints for SDL_KEYDOWN as well.

Anyways, once your test program works for your normal keyboard, then you can try it out with the wireless in order to learn how SDL is or is not reading that things key data, which will help you understand where the problem lies and how to solve it.

On Thu, Sep 3, 2009 at 2:05 PM, PierreLafrance1-rieW9WUcm8FFJ04o6PK0Fg@public.gmane.org <PierreLafrance1-rieW9WUcm8FFJ04o6PK0Fg@public.gmane.org> wrote:
#include <stdio.h>
#include <stdlib.h>
#include "/usr/include/SDL/SDL.h"

int MySDL_WaitEvent()
{
   printf("About to call SDL_WaitEvent(&event)\n");
   SDL_Event event;
   SDL_WaitEvent(&event);

   switch (event.type)
   {
       printf("In switch/case of SDL_WaitEvent(&event)\n");
       case SDL_KEYDOWN:
           printf("The %s key was pressed!\n",
               SDL_GetKeyName(event.key.keysym.sym));
           break;
       case SDL_QUIT:
           exit(0);
   }
}


int MySDL_PollEvent()
{
   printf("About to call SDL_PollEvent(&event)\n");
   SDL_Event event;
   while ( SDL_PollEvent(&event) )
   {
       switch (event.type)
       {
           printf("In switch/case of SDL_PollEvent(&event)\n");
           case SDL_MOUSEMOTION:
               printf("Mouse moved by %d,%d to (%d,%d)\n",
                   event.motion.xrel, event.motion.yrel,
                   event.motion.x, event.motion.y);
               break;
           case SDL_MOUSEBUTTONDOWN:
               printf("Mouse button %d pressed at (%d,%d)\n",
                   event.button.button, event.button.x, event.button.y);
               break;
           case SDL_QUIT:
               exit(0);
       }
   }
}

int main(int argc, char *argv[])
{
   printf("About to call SDL_Init()\n");
   if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0 )
   {
       //fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError());
       printf("Unable to init SDL: %s\n", SDL_GetError());
       exit(1);
   }
   while(1)
   {
       printf("About to call MySDL_PollEvent()\n");
       MySDL_PollEvent();
       printf("About to call MySDL_WaitEvent()\n");
       MySDL_WaitEvent();
   }   //  while

   printf("About to call atexit()\n");
   atexit(SDL_Quit);
}

--
Pierre Lafrance
--


Picon
Favicon

Re: Numeric wireless keyboard

Hi
> I think you probably can't get those messages without creating a
> window, so try creating a window before getting events.

You were right all the way, it works now.
Thanks, I'm ready to verify my ARM platform

-- 
Pierre Lafrance
--

Brian Fisher wrote:
> I think you probably can't get those messages without creating a window,
> so try creating a window before getting events.
> 
>  Also, you don't want to have a separate poll and wait func, which are
> both called and both check for different messages. Both those functions
> remove messages from the queue, so if a your poll function gets a
> SDL_KEYDOWN message, it would end up throwing out the message and then
> your wait function would never receive it. Just do the Poll thing, and
> make it's switch statement do the prints for SDL_KEYDOWN as well.
> 
> Anyways, once your test program works for your normal keyboard, then you
> can try it out with the wireless in order to learn how SDL is or is not
> reading that things key data, which will help you understand where the
> problem lies and how to solve it.
> 
> On Thu, Sep 3, 2009 at 2:05 PM, PierreLafrance1@...
> <mailto:PierreLafrance1@...> <PierreLafrance1@...
> <mailto:PierreLafrance1@...>> wrote:
> 
>     #include <stdio.h>
>     #include <stdlib.h>
>     #include "/usr/include/SDL/SDL.h"
> 
>     int MySDL_WaitEvent()
>     {
>        printf("About to call SDL_WaitEvent(&event)\n");
>        SDL_Event event;
>        SDL_WaitEvent(&event);
> 
>        switch (event.type)
>        {
>            printf("In switch/case of SDL_WaitEvent(&event)\n");
>            case SDL_KEYDOWN:
>                printf("The %s key was pressed!\n",
>                    SDL_GetKeyName(event.key.keysym.sym));
>                break;
>            case SDL_QUIT:
>                exit(0);
>        }
>     }
> 
> 
>     int MySDL_PollEvent()
>     {
>        printf("About to call SDL_PollEvent(&event)\n");
>        SDL_Event event;
>        while ( SDL_PollEvent(&event) )
>        {
>            switch (event.type)
>            {
>                printf("In switch/case of SDL_PollEvent(&event)\n");
>                case SDL_MOUSEMOTION:
>                    printf("Mouse moved by %d,%d to (%d,%d)\n",
>                        event.motion.xrel, event.motion.yrel,
>                        event.motion.x, event.motion.y);
>                    break;
>                case SDL_MOUSEBUTTONDOWN:
>                    printf("Mouse button %d pressed at (%d,%d)\n",
>                        event.button.button, event.button.x, event.button.y);
>                    break;
>                case SDL_QUIT:
>                    exit(0);
>            }
>        }
>     }
> 
>     int main(int argc, char *argv[])
>     {
>        printf("About to call SDL_Init()\n");
>        if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0 )
>        {
>            //fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError());
>            printf("Unable to init SDL: %s\n", SDL_GetError());
>            exit(1);
>        }
>        while(1)
>        {
>            printf("About to call MySDL_PollEvent()\n");
>            MySDL_PollEvent();
>            printf("About to call MySDL_WaitEvent()\n");
>            MySDL_WaitEvent();
>        }   //  while
> 
>        printf("About to call atexit()\n");
>        atexit(SDL_Quit);
>     }
> 
>     --
>     Pierre Lafrance
>     --
> 
> 

Picon
Favicon

Re: Numeric wireless keyboard

James Paige wrote:
> On Thu, Aug 20, 2009 at 08:58:27AM -0400, PierreLafrance1@... wrote:
>> René Dudfield wrote:
>>> yeah, looks like somewhere the keyboard mappings aren't working.
>>> Likely in linux, C or SDL land.
>>>
>>> This is not a pygame level issue.
>>>
>>> Check on the SDL mailing list, or the arm platform mailing list perhaps?
>>>
>>>
>>> cheers,
>>>
>>>
>> Hi Rene.
>> What I don't understand is :
>> + The alphanumeric keyboards works fine with ARM plateform and Pygame
>> + The numeric keyboard works fine with ARM plateform in a text editor
>> + The numeric keyboard does't works fine with ARM plateform and Pygame
>>
>> So I'm not sure what to look at yet since hardware and software is ok.
>> Anyway, I'll keep you post on progress
>>
>> Thanks
>>
>> Pierre
> 
> I would suggest writing a very small test program in C using SDL. You 
> can find some suitable example code at 
> http://www.libsdl.org/intro.en/usingevents.html
> 
> Compile it with gcc, and use it to test and see if this problem affects 
> the underlying SDL library when python and pygame are not involved.
> 
> That will narrow down where the problem is.
> 
> ---
> James Paige
> 
> 
Hi
I have succeffully (with a certain amount of pain to update Ubuntu and
ARM systems ;-) compiled a SDL program.

On ARM system, SDL doesn't receive good event ID (if I may call it like
this).  When pressing any digit from wired keyboard, it works fine.
When pressing any digit from wireless keyboard, it receive : "numlock
key was pressed".

So Pygames is out of the loop, like you all suspected (I have to learn).
 Now what do I do to progress in my investigation ?
Can I recompile SDL with different options ?
Is SDL relies on an other librairy ?
Both system have libsdl version 1.2

Thanks

--

-- 
Pierre Lafrance


Gmane