Re: [Jack-Devel] jack_connect with many channels
Hello Robin
a small test program one seems to work. Hm. I guess i have to look
further why practically the same code doesn't work in another client.
Thanks,
Tom
http://pastebin.com/B34ENL4y
On 2014-10-20 01:20, Robin Gareus wrote:
>> On Oct 19, 2014, at 8:17 PM, [hidden] wrote:
>>
>>
>> Hi
>>
>> i use the following code snippet to connect all available
>> hardware/system
>> capture ports to a client:
>>
>> --
>>
>> if(autoconnect==1)
>> {
>> int j=0;
>> int i=0;
>> for(i=0;i<input_port_count;i++)
>> {
>> if (ports[i]!=NULL)
>> {
>> if(!jack_connect (client,
>> ports[i],jack_port_name(ioPortArray[j])))
>
> // what is ioPortArray[], ports[] and how do you query
> input_port_count?
> // more context is needed
>
>> {
>> fprintf (stderr, "autoconnect: %s -> %s\n",
>> ports[i],jack_port_name(ioPortArray[j])
>> );
>> j++;
>> }
>> else
>> {
>
> // if you get here ports[i] == NULL
>
>> fprintf (stderr, "autoconnect: failed: %s -> %s\n",
>> ports[i],jack_port_name(ioPortArray[j])
>> );
>
> // ..and hence you pass a null pointer to printf. not nice.
> // (some printf implementation can handle it but don’t count on it).
> // This would certainly explain the segfault that you’ve pasted below.
>
>> }
>> }
>> }
>> fprintf (stderr, "\n");
>> }
>>
>> free (ports);
>> —
>>
>
> [..]
>
>> Maybe the client code is buggy. When the client in question is run in
>> gdb,
>> this is the output:
>>
>> [New Thread 0x7ffff7fa0700 (LWP 6321)]
>> autoconnect: system:capture_1 -> send:input_1
>> autoconnect: system:capture_2 -> send:input_2
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x00007ffff73278f3 in _IO_vfprintf_internal (s=s@entry=0x7fffffffc840,
>> format=<optimized out>, format@entry=0x7ffff7bccdbc "%s",
>> ap=ap@entry=0x7fffffffc9a8) at vfprintf.c:1661
>> 1661 vfprintf.c: No such file or directory.
>
> get a backtrace here.
>
> best,
> robin
>
> Jack-Devel mailing list
> [hidden]
> http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
1413773242.5231_0.ltw:2, <1a068676e319b249e9459e7134be8985 at trellis dot ch>