[Gambas-user] Gambas + Midi + ALSA + file descriptors

Benoît Minisini gambas at ...1...
Mon Sep 26 20:40:09 CEST 2011


> Hello Benoît,
> 
> I tried to put POLLOUT, but it doesn't change:

OK, but it couldn't work at all with POLLIN.

> 
>  - a CPU always at 100%;
>  - line OPEN "." & CStr(numfd) wants For WRITE, and the called sub-routine
> wants File_Read(). - I can put File_Write() also, but so I have to put the
> "no-blocking" Alsa function:  snd_seq_nonblock(handle, 1) in the calling
> routine.
> 
> ...in short, no newness...
> 
> I'ld like remember the problem is the CPU working at 100%.
> 
> Regards
> Paolo
> 

You must understand that the 'Open ".xx"' feature I added relies on the same 
code than any other file. I may have made a mistake, but it's unlucky.

Moreover, by reading your code, I don't understand what you are doing. You 
want to watch a file descriptor for *writing*, and in the event handler, you 
are *reading* on it. This not coherent at all, and I can't guess what you 
really want to achieve.

The 100% CPU is a consequence of that mismatch : if you don't read during a 
File_Read event handler, or if you don't write during a File_Write event 
handler, the event will be raised again and again, eating all the CPU.

So, please explain better what you want to do, and we will find where the 
confusion is.

Is there a way for me to emulate a midi input so that I can actually run your 
project?

And can you send me your project each time you modify it so that I am sure to 
use the code you are talking about?

Regards,

-- 
Benoît Minisini




More information about the User mailing list