« Return to Thread: Debugging a strange issue with multi card on JACK2

Debugging a strange issue with multi card on JACK2

by Stéphane Letz :: Rate this Message:

Reply to Author | View in Thread

Hi all,

I'm currently trying to debug what seems to be a long standing bug in  
ALSA backend behaviour under JACK2 when used with multi cards (but  
that maybe happens in other situations as well...). Rick Wright (CC)  
is using 2 M-Audio 1010LT' card and is reporting problems under JACK2  
(and not in JACK1) . The command is the following :

jackd -v -S -R -P75 -dalsa -r48000 -p1024 -n2 -D -Cmulti_capture -
Pmulti_playback

and  ALSA backend fails in first "alsa_driver_wait" (that report a  
nframes = 0), then the following code is taken:

  if (nframes == 0) {
         /* we detected an xrun and restarted: notify
          * clients about the delay.
          */
         jack_log("ALSA XRun wait_status = %d", wait_status);
         NotifyXRun(fBeginDateUst, fDelayedUsecs);
         return -1;
     }

the cycle is "skipped" but ALSA backend never recovers, and continue  
to fails forever...

If we activate DEBUG_WAKEUP flags to see a bit more what happens, then  
things start to work.. and we have the following kind of trace:

Jack: JackThreadedDriver::Init IsRealTime
678676670960: checked 2 fds, 21266 usecs since poll entered
678676670960 playback stream ready
678676670960 capture stream ready
wakeup complete, avail = 1024, pavail = 1025 cavail = 1024
Jack: fPollTable i = 1 fd = 5
Jack: JackRequest::Notification
Jack: JackEngine::NotifyClients: no callback for event = 4
Jack: JackEngine::NotifyClients: no callback for event = 4
Jack: JackEngine::NotifyClients: no callback for event = 4
678676692285: checked 2 fds, 21117 usecs since poll entered
678676692285 playback stream ready
678676692285 capture stream ready
wakeup complete, avail = 1024, pavail = 1025 cavail = 1024
678676713617: checked 2 fds, 21234 usecs since poll entered
678676713617 playback stream ready
678676713617 capture stream ready
wakeup complete, avail = 1024, pavail = 1025 cavail = 1024
678676734946: checked 2 fds, 21245 usecs since poll entered
678676734946 playback stream ready
678676734946 capture stream ready
wakeup complete, avail = 1024, pavail = 1025 cavail = 1024
678676756281: checked 2 fds, 21249 usecs since poll entered
678676756281 playback stream ready

So basically it seems that a subtle timing difference, that cause the  
first cycle to fail (or not when DEBUG_WAKEUP is on), and recovery  
code does not work as expected.

Anybody has a brilliant idea of what could be the issue? Or any advice  
how to debug that?

Thanks

Stephane


_______________________________________________
Jack-Devel mailing list
Jack-Devel@...
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

 « Return to Thread: Debugging a strange issue with multi card on JACK2