Re: [LAD] pipes or network?

2007-06-08 Thread Jacob
On Thu, May 17, 2007 at 08:50:28PM +0200, Arnold Krille wrote:
> Am Donnerstag, 17. Mai 2007 schrieb Malte Steiner:
> > I wonder what is the best way to connect applications on the same
> > computer. Usually I use network and localhost plus custom protocols or
> > OSC to let them communicate but wonder if pipes are more efficient. The
> > data to be exchanged is usually control rate, not audio nor video streams.
> > So what are the pros and cons of pipes versus network?
> 
> While pipes are faster (which is not interesting for control data only) 
> osc+network makes it extendable. Maybe in the future one part of your app 
> will run on a different host. If you started with pipes you have to program a 
> whole new communication. With osc and network you just allow other addresses 
> than localhost...

If efficiency or latency matters, have a look at unix domain sockets. 
The API is the same like of the (inet) network stuff, but their efficiency is
close (if not identical) to pipes. So it's 'pipes AND network' ;-)

Just use the same protocol on top of both, the differences mainly
concern the socket() parameters and the initialisation of the sockaddr
for bind() and connect(). As long as you don't rely on things like
SEQPACKET, credentials, passing of file descriptors (all n/a with ip) 
and out-of-band/urgent data (not available with unix domain sockets),
the socket type is transparent to the higher layers.

BTW, that's what the X11 protocol is using: if you set DISPLAY=:0 it
uses the named unix socket /tmp/.X11-unix/X0, if you set
DISPLAY=localhost:0 it does TCP/IP through the 'lo' network device
(requires that the server is not started with '-nolisten tcp', just in
case you want to test this)

see unix(7) or your copy of Steven's 'UNIX network programming'

HTH,

Jacob
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo.cgi/linux-audio-dev


Re: [LAD] C - Change in memory causing seg.fault (but why?)

2012-11-08 Thread Jacob

On 11/08/2012 10:18 PM, Muffinman wrote:

On 08-11-12 22:02, Brett McCoy wrote:


You never allocate memory for the pointer long *outvl after you create
it, but then try to point to a value. You need to use malloc() to
initialize the memory for that pointer before you can use it.




Thanks!! I believe I have some more reading to do.


And, BTW, pay attention to the "format ‘%i’ expects type ‘int’" type of
warnings. Using the wrong or omitting required length modifiers can lead
to segfaults, too. Even if '%d' and '%ld' refer to integers of the same
size on an i386 platform, on a 64 bit platform they won't and weird 
things can happen if the argument doesn't match the format spec.


Jacob

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


[LAD] Parallella @ LAC

2014-05-02 Thread Jacob
Hi,

I do have a Parallella (www.parallella.org) board with me and can show
it and tell about my experiences with it. So if anybody is interested
please respond or tell me.

Cheers

Jacob
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev