From: <ad...@dr...> - 2008-12-12 00:21:48
|
On Thu, Dec 11, 2008 at 02:21:07PM +0100, Stefan Richter wrote: > > adi@chopin:~$ grep "^open" juju-strace | grep 24 > > open("/dev", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 24 > > open("/dev", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 24 > This is either scan_devices()'s and fw_set_port()'s dir or > fw_new_handle's inotify_fd. First: I was wrong, the lines above do not correspond to what's going on. It's more like this: [jackd start] adi@libraw1394: epoll_fd is 8 adi@libraw1394: inotify_fd is 11 adi@libraw1394: epoll_fd is 8 adi@libraw1394: inotify_fd is 11 adi@libraw1394: epoll_fd is 8 adi@libraw1394: inotify_fd is 11 adi@libraw1394: opened /dev/fw1 as fd 13 adi@libraw1394: opened /dev/fw0 as fd 14 adi@libraw1394: local_fd is 14 adi: m_handle is at fd 8 The last line is from libffado (Ieee1394Service::initialize). Next: adi@libraw1394: epoll_fd is 12 adi@libraw1394: inotify_fd is 17 adi@libraw1394: opened /dev/fw1 as fd 19 adi@libraw1394: opened /dev/fw0 as fd 20 adi@libraw1394: local_fd is 20 adi@libraw1394: epoll_fd is 18 adi@libraw1394: inotify_fd is 23 adi@libraw1394: opened /dev/fw1 as fd 25 adi@libraw1394: opened /dev/fw0 as fd 26 adi@libraw1394: local_fd is 26 adi@libraw1394: epoll_fd is 24 adi@libraw1394: inotify_fd is 29 adi@libraw1394: waiting for epoll_fd 8 adi@libraw1394: waiting for epoll_fd 8 adi@libraw1394: waiting for epoll_fd 8 adi: calling loop-iterate for fd 12 adi@libraw1394: waiting for epoll_fd 12 adi@libraw1394: waiting for epoll_fd 8 Nothing special, except the "waiting for epoll_fd 8". It's inside fw_loop_iterate, just before epoll_wait. ffado then calls raw1394_loop_iterate for fd 12, which results in fw_loop_iterate epoll_waiting for fd 12. (this is Ieee1394Service::rHThread() in ffado's libieee1394service.cpp) Then, approx. 60 times "waiting for epoll_fd 8" from libraw1394. I've neglected them. adi@libraw1394: epoll_fd is 24 adi@libraw1394: inotify_fd is 29 adi@libraw1394: opened /dev/fw1 as fd 31 adi@libraw1394: opened /dev/fw0 as fd 32 adi@libraw1394: local_fd is 32 adi: our main iso fd is 24 got write request, offset=0xffffe0000000, length=4 adi: calling loop-iterate for fd 12 adi@libraw1394: waiting for epoll_fd 12 adi@libraw1394: waiting for epoll_fd 8 adi@libraw1394: waiting for epoll_fd 8 adi@libraw1394: waiting for epoll_fd 8 adi@libraw1394: epoll_fd is 30 adi@libraw1394: inotify_fd is 35 adi@libraw1394: opened /dev/fw1 as fd 37 adi@libraw1394: opened /dev/fw0 as fd 38 adi@libraw1394: local_fd is 38 adi: our main iso fd is 30 adi@libraw1394: waiting for epoll_fd 8 adi@libraw1394: waiting for epoll_fd 8 adi@libraw1394: waiting for epoll_fd 8 adi@libraw1394: epoll_fd is 36 adi@libraw1394: inotify_fd is 41 adi@libraw1394: opened /dev/fw1 as fd 43 adi@libraw1394: opened /dev/fw0 as fd 44 adi@libraw1394: local_fd is 44 adi: our main iso fd is 36 adi@libraw1394: waiting for epoll_fd 8 The "our main iso fd" is from IsoHandler::init(), right after m_handle. It's simply raw1394_new_handle_on_port and raw1394_get_fd afterwards. Note that we've seen fd 24, 30 and 36 as the main iso fds. [some lines waiting for epoll_fd 8] adi: assigned ISO channel 0 adi@libraw1394: waiting for epoll_fd 8 (multiple times) adi: assigned ISO channel 1 adi@libraw1394: waiting for epoll_fd 8 (multiple times) adi: assigned ISO channel 2 adi@libraw1394: waiting for epoll_fd 8 (multiple times) (we just saw iso channel allocation, nothing special here) adi@libraw1394: opened /dev/fw0 as iso fd 45 adi@libraw1394: added fd 45 to epoll_fd 36 adi: added fd 36 to shadowMap adi@libraw1394: opened /dev/fw0 as iso fd 46 adi@libraw1394: added fd 46 to epoll_fd 24 adi: added fd 24 to shadowMap adi@libraw1394: opened /dev/fw0 as iso fd 47 adi@libraw1394: added fd 47 to epoll_fd 30 adi: added fd 24 to shadowMap adi: added fd 30 to shadowMap Looks good to me: adding the ISO fds to the epoll_fd and then adding the epoll_fds to ffado's shadowMap for poll(). adi@libraw1394: waiting for epoll_fd 8 (many more) firewire ERR: Could not start streaming threads: -1 DRIVER NT: could not start driver cannot start driver adi@libraw1394: waiting for epoll_fd 8 adi@libraw1394: waiting for epoll_fd 8 adi@libraw1394: waiting for epoll_fd 8 adi@libraw1394: waiting for epoll_fd 8 adi@libraw1394: waiting for epoll_fd 8 adi@libraw1394: waiting for epoll_fd 8 adi@libraw1394: waiting for epoll_fd 8 adi@libraw1394: waiting for epoll_fd 8 adi@libraw1394: waiting for epoll_fd 8 adi@libraw1394: waiting for epoll_fd 8 firewire ERR: Could not stop streaming threads DRIVER NT: error stopping driver adi@libraw1394: waiting for epoll_fd 8 adi@libraw1394: waiting for epoll_fd 8 adi@libraw1394: waiting for epoll_fd 8 adi: added fd 36 to shadowMap adi: added fd 30 to shadowMap adi: added fd 36 to shadowMap no message buffer overruns [END] During the last hours, I've never seen an event in ffado. poll returns, but the revents are always 0, so no iteration starts. Cheerio -- mail: ad...@th... http://adi.thur.de PGP/GPG: key via keyserver |