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

Ru Vuott vuott at ...325...
Tue Sep 27 18:04:33 CEST 2011


Excuse, Benoit,

I'ld like to remember: I must not read data from fd (because I'll read Midi data from special ALSA function).

 I need fd to *have* and to **raise** a gambas _Read event (...awake the program, so that I can read Midi data from special ALSA function).

...Ok

Excuse, Bye
Paolo





--- Mar 27/9/11, Benoît Minisini <gambas at ...1...> ha scritto:

> Da: Benoît Minisini <gambas at ...1...>
> Oggetto: Re: [Gambas-user] Gambas + Midi + ALSA + file descriptors
> A: "mailing list for gambas users" <gambas-user at lists.sourceforge.net>
> Data: Martedì 27 settembre 2011, 17:47
> > Hello Benoît,
> > 
> > I'ld like to recapitulate...
> > 
> > 
> > AIM:
> > 
> > *Receiving* Midi data FROM ALSA (rectius: FROM ALSA
> functions).
> > 
> > 
> > STRATEGY:
> > 
> > Putting the FD - *passed by ALSA* - under
> "observation" for Read by using a
> > mechanism like:  hfile = OPEN...For....WATCH.
> Normally the gambas-program
> > sleeps, but when data come to that FD, and so it
> begins "ready", we'll
> > have not to read data from FD (not from hfile !); the
> mechanism
> > OPEN...etc... must awake the program and ''raise'' a
> gambas-event, as
> > File_Read(). So, we'll read the right ad useful Midi
> data **FROM ALSA** by
> > the special function: snd_seq_event_input(......).
> > 
> > > Is there a way for me to emulate a midi input so
> that I can
> > > actually run your project?
> > 
> > Yes, you can use "aplaymidi" program.
> > After run "aplaymidi", remember to allow the
> connection of my source TO
> > aplaymidi, by writing the Id client number in special
> ALSA function:
> > 
> > err = snd_seq_connect_to(handle, outport,
> -->HERE<--, dport)
> > 
> > that you can find it in CAlsa.class of my source.
> > 
> > 
> > ....But if you run my program, on its form you can
> send a midi data by
> > pressing on the button "note".
> > 
> > 
> > I send you attached "aseqdump" Alsa program, purposely
> modified for
> > verifing the FD thata it uses. You can compare the FD,
> used by it, with FD
> > shown by lsof -p PID_of_program command, or strace -p
> PID command.
> > 
> > So, equally, you can compare the fd of my source. This
> fd is used by my
> > program and passed by ALSA function to OPEN... etc
> line.
> > 
> > Regards
> > Paolo
> > 
> 
> So we agree that you must watch the descriptor for reading
> (For Read Watch), 
> not for writing (For Write Watch)?
> 
> I will look at that as soon as I have time.
> 
> 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 at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list