Ticket #288 (new bug)

Opened 2 years ago

Last modified 2 years ago

FFADO fails from screensaver/screenblank

Reported by: shuberts Assigned to:
Priority: major Milestone:
Component: generic Version: FFADO 2.0.1
Keywords: IsoHandler, requestEnable, crash, Cc:
The device the bug applies to:

Description (Last modified by arnonym)

When my screensaver or screenblank kicks in, FFADO crashes with error message:

Error (IsoHandler.cpp)[ 733] requestEnable: Enable requested on stream with state: 2
Debug (IsoHandlerManager.cpp)[1019] startHandlerForStream:  could not request enable for handler 0x8294c28)

This is 100% repeatable. And, though I can work around it by disabling compiz, disabling any video acceleration, and disabling the screen savers and screen blanking, this seems a little extreme.

To make matters worse, this also happens when I try to use any advanced video features, e.g. compiz cube, etc.

Here is my config:

  • Intel Pentium 4 processor at ~1GHz.
  • 768 Mb RAM.
  • NVIDIA GeForce? 5 card (restricted binary drivers v173, but also happens when using generic SVGA drivers).
  • Firewire interface.
  • PreSonus? FP10.
  • Ubuntu Studio 10.04 (Linux xxxxx 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 22:02:19 UTC 2010 i686 GNU/Linux)

GDB backtrace:

(gdb) list -20,+20
692	    m_State = eHS_Stopped;
693	    m_NextState = eHS_Stopped;
694	    return true;
695	}
696	
697	// functions to request enable or disable at the next opportunity
698	bool
699	IsoHandler::requestEnable(int cycle)
700	{
701	    if (m_State == eHS_Running) {
702	        debugError("Enable requested on enabled stream\n");
703	        return false;
704	    }
705	    if (m_State != eHS_Stopped) {
706	        debugError("Enable requested on stream with state: %d\n", m_State);
707	        return false;
708	    }
709	    m_NextState = eHS_Running;
710	    return true;
711	}
712	
(gdb) backtrace
#0  IsoHandler::requestEnable (this=0x816f6a0, cycle=3683)
    at src/libieee1394/IsoHandler.cpp:706
#1  0x004415b7 in IsoHandlerManager::startHandlerForStream (this=0x80846c8, 
    stream=0x816f710, cycle=3683) at src/libieee1394/IsoHandlerManager.cpp:1015
#2  0x0045267e in Streaming::StreamProcessor::scheduleStartDryRunning (
    this=0x816f710, t=-1) at src/libstreaming/generic/StreamProcessor.cpp:1173
#3  0x00446911 in Streaming::StreamProcessorManager::startDryRunning (
    this=0x8077890) at src/libstreaming/StreamProcessorManager.cpp:423
#4  0x0044a23e in Streaming::StreamProcessorManager::handleXrun (
    this=0x8077890) at src/libstreaming/StreamProcessorManager.cpp:1055
#5  0x003d64fe in DeviceManager::waitForPeriod (this=0x8077710)
    at src/devicemanager.cpp:983
#6  0x003deb77 in ffado_streaming_wait (dev=0x8056ed8) at src/ffado.cpp:253
#7  0x003020d6 in ffado_driver_wait (driver=0x80534c0, extra_fd=-1, 
    status=0xb03c1328, delayed_usecs=0xb03c1324) at ffado_driver.c:531
#8  0x0030228c in ffado_driver_run_cycle (driver=0x80534c0)
    at ffado_driver.c:583
#9  0x001443dc in jack_driver_nt_thread (arg=0x80534c0)
    at ../libjack/driver.c:122
#10 0x00148262 in jack_thread_proxy (varg=0x809d810) at ../libjack/thread.c:118
#11 0x0018d96e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#12 0x00272a4e in clone () from /lib/tls/i686/cmov/libc.so.6

Attachments

ffado info (23.9 kB) - added by shuberts on 06/20/10 19:05:21.
lspci and ffado-diag output

Change History

06/19/10 20:11:56 changed by shuberts

Oh - and I forgot to say - thanks for looking in to this!

06/20/10 06:59:19 changed by arnonym

  • milestone deleted.

Please take a look at the output of "lspci" or "cat /proc/interrupts" to see whether your firewire controller shares its interrupt with the graphics card. If yes, try to make them not share an interrupt.

And please attach the output of "ffado-diag".

But it really sounds like an interrupt problem. I do have ffado run together with nvidia cards without problems. And without shared interrupts.

06/20/10 15:20:01 changed by arnonym

  • keywords changed from 2.0.1, IsoHandler, requestEnable, crash, to IsoHandler, requestEnable, crash,.
  • version changed from FFADO 2.0.0 to FFADO 2.0.1.
  • description changed.

06/20/10 19:05:21 changed by shuberts

  • attachment ffado info added.

lspci and ffado-diag output

06/20/10 19:06:03 changed by shuberts

Thanks for looking in on this, arnonym. This may have provided a step forward (though it doesn't seem to be a complete fix).

It turned out that I had two firewire cards in the machine, one of which shared and IRQ with the video card. I removed one card and moved the other to another slot so that the IRQ conflict was removed. However, the screensaver and screenblank still bring FFADO down.

I;ve attached my before-and after lspci and ffado-diag output. Do you see anything?

06/21/10 19:30:07 changed by shuberts

I've been poking around with this a bit, and have found the following:

1) The error message in question can only happen when IsoHandler?.m_state == eHS_Error (integer value 2).

2) IsoHandler?.m_state is only set to eHS_Error in IsoHandler::notifyOfDeath()

3) IsoHandler::notifyOfDeath() is only called in IsoTask::Execute() [IsoHandlerManager.cpp: 337] when measured_diff_ticks > max_diff_ticks. This seems to be a timeout condition when IsoHandler::getLastPacketTime() exceeds IsoTask:m_manager.get1394Service().getCycleTimer() by two seconds or more.

The debug output from this condition says:

:~$ /usr/bin/jackd -P89 -dfirewire -v1 -dhw:0 -r96000 -p512 -n3 
jackd 0.118.0
Copyright 2001-2009 Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details


Memory locking is unlimited - this is dangerous. You should probably alter the line:
     @audio   -  memlock    unlimited
in your /etc/limits.conf to read:
     @audio   -  memlock    575715
no message buffer overruns
JACK compiled with System V SHM support.
loading driver ..
00960221744:  (ffado.cpp)[  92] ffado_streaming_init: libffado 2.0.1 built Jun 19 2010 17:04:03
firewire ERR: wait status < 0! (= -1)
DRIVER NT: could not run driver cycle
00998222555: Fatal (IsoHandlerManager.cpp)[ 336] Execute: (0x92c9000, Receive) Handler died: now: E953B66E, last: E5525292, diff: 49220572 (max: 49152000)
00998223267: Fatal (StreamProcessorManager.cpp)[1070] handleXrun: Could not syncStartAll...
jack main caught signal 12
no message buffer overruns

Does this help at all?