Hello Benoît, I tried to put POLLOUT, but it doesn't change:
- 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 --- Lun 26/9/11, Benoît Minisini <gam...@users.sourceforge.net> ha scritto: > Da: Benoît Minisini <gam...@users.sourceforge.net> > Oggetto: Re: [Gambas-user] Gambas + Midi + ALSA + file descriptors > A: "mailing list for gambas users" <gambas-user@lists.sourceforge.net> > Data: Lunedì 26 settembre 2011, 13:19 > > Hello Benoît, > > > > I would just like to add that trying your trick ( > hFile = Open "." & > > CStr(iAlsaFileDescriptor) For xxx Watch) besides the > problem about CPU > > over-working (at 100%), wich I have already told, > there is also a strange > > thing: as you see in the source (wich I sent you in my > previous e-mail), > > despite the line uses "write": hFile = Open "." & > > CStr(iAlsaFileDescriptor) For WRITE Watch > > > > (So, for fd passed by Alsa that line > works.) > > > > the called routine "wants" "Read": Public Sub > File_Read(). > > If I use " sub File_Write() ", it doesn't work ! > > > > Thanks > > Paolo > > > > By using: > > snd_seq_poll_descriptors(handle, pfds, > npfds, POLLIN) > > You are asking for ALSA file descriptors used for reading > data, not for > writing. So all that behaviour is expected! > > Maybe if you put POLLOUT instead, things will behave > better. > > See the ALSA documentation: > > http://www.alsa-project.org/alsa-doc/alsa- > lib/group___sequencer.html#g5086fbf4e38449108a0807fb5cf5e9c6 > > Regards, > > -- > Benoît Minisini > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT > infrastructure contains a > definitive record of customers, application performance, > security > threats, fraudulent activity and more. Splunk takes this > data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2dcopy1 > _______________________________________________ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user