I am transmitting using 4 DACs at 1MS/s and receiving using 4 ADCs at 1MS/s.
When the problem occurs:
- The USRP Tx thread seems to be running without any problems.
- The thread that is processing the USRP Rx graph seems to be stuck in PyThread_acquire_lock () (see line #2 below)
Possible cause:
I think I was monopolizing the lock needed in PyEval_RestoreThread in the Rx thread by doing a select inside of one of my block's C++ methods in my data monitor thread.
Possible solution:
When I call select using python in my data monitor thread, but outside of my block, everything seems to behave properly.
(gdb) thread 3
[Switching to thread 3 (Thread 1139637168 (LWP 28677))]#0 0x40031d0b in [EMAIL PROTECTED] () from /lib/tls/libpthread.so.0
(gdb) bt
#0 0x40031d0b in [EMAIL PROTECTED] () from /lib/tls/libpthread.so.0
#1 0x00000004 in ?? ()
#2 0x080dd0bc in PyThread_acquire_lock ()
#3 0x080ace61 in PyEval_RestoreThread ()
#4 0x080d7908 in PyGILState_Ensure ()
#5 0x080e0b20 in initthread ()
#6 0x4002db63 in start_thread () from /lib/tls/libpthread.so.0
#7 0x40138c4a in clone () from /lib/tls/libc.so.6
Krzysztof Kamieniecki wrote:
Eric,
Have you made any progress with this?
I'm having a problem that may be related. The blocks are layed out like this.
USRP Rx -> ... -> pipe
gr_sig_source -> ... -> USRP Tx
When running in gdb: 1. I wait for it to lockup 2. hit Ctrl-Z (to get into gdb) 3. type continue 4. more data is processed with a bunch of uU printed 5. software lockups again 6. goto 2
When I hit Ctrl-Z the Tx thread always seems to be in ioctl in _reap. Is this normal?
Attached is a file with bt's for each of the threads Thread 1 is Python/Wx, which seems to lockup Thread 2 seems to be the USRP Tx graph Thread 3 seems to be the USRP Rx graph Thread 4 is my pipe monitoring thread, which does not lockup
Quoting Eric Blossom:
On Fri, Apr 08, 2005 at 04:10:20PM -0400, cswiger wrote:
This is a curious behavior: if
1) Use a vector source at the head and the USRP at the tail all is OK
2) Use the pipe fd source at the head and a file sink at the tail all is OK
but if
3) Use a pipe fd source at the head and the USRP (with a parallel file sink to monitor) at the tail data very slowly trickles into the file, much slower than the 1.6Msps that it should - UNTIL I close the process feeding the pipe, THEN it goes full blast and processes the backed up pipe A-OK.
very interesting ;)
Chuck, if you send me the code to test example (3), I'll take a look at it.
Eric
------------------------------------------------------------------------
(gdb) info threads 4 Thread 1148025776 (LWP 28678) 0x401324e7 in select () from /lib/tls/libc.so.6 3 Thread 1139637168 (LWP 28677) 0x40031d0b in [EMAIL PROTECTED] () from /lib/tls/libpthread.so.0 * 2 Thread 1131248560 (LWP 28676) 0x40131bd4 in ioctl () from /lib/tls/libc.so.6 1 Thread 1075400832 (LWP 28671) 0x4012ffe3 in poll () from /lib/tls/libc.so.6 (gdb) thread 1 [Switching to thread 1 (Thread 1075400832 (LWP 28671))]#0 0x4012ffe3 in poll () from /lib/tls/libc.so.6 (gdb) bt #0 0x4012ffe3 in poll () from /lib/tls/libc.so.6 #1 0x407c8896 in wxApp::WakeUpIdle () from /usr/lib/libwx_gtk2u_core-2.5.so.3 #2 0x410ab226 in g_main_loop_get_context () from /usr/lib/libglib-2.0.so.0 #3 0x410aa820 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 #4 0x410aae43 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0 #5 0x40d9a8f3 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0 #6 0x407e3208 in wxEventLoop::Run () from /usr/lib/libwx_gtk2u_core-2.5.so.3 #7 0x40874233 in wxAppBase::MainLoop () from /usr/lib/libwx_gtk2u_core-2.5.so.3 #8 0x4046c2d2 in wxPyApp::MainLoop () from /usr/lib/python2.3/site-packages/wx-2.5.3-gtk2-unicode/wx/_core_.so #9 0x404a67dd in wxGridBagSizer_Add () from /usr/lib/python2.3/site-packages/wx-2.5.3-gtk2-unicode/wx/_core_.so #10 0x080fdede in PyCFunction_Call () #11 0x0805b989 in PyObject_Call () #12 0x080abcd4 in PyEval_CallObjectWithKeywords () #13 0x080aa028 in Py_MakePendingCalls () #14 0x080aa77c in PyEval_EvalCodeEx () #15 0x080fd9b7 in PyStaticMethod_New () #16 0x0805b989 in PyObject_Call () #17 0x080623d8 in PyMethod_Fini () #18 0x0805b989 in PyObject_Call () #19 0x080aba52 in PyEval_CallObjectWithKeywords () #20 0x080ab6b9 in PyEval_CallObjectWithKeywords () #21 0x080a9bee in Py_MakePendingCalls () #22 0x080ab96d in PyEval_CallObjectWithKeywords () #23 0x080ab72c in PyEval_CallObjectWithKeywords () #24 0x080a9bee in Py_MakePendingCalls () #25 0x080ab96d in PyEval_CallObjectWithKeywords () #26 0x080ab72c in PyEval_CallObjectWithKeywords () #27 0x080a9bee in Py_MakePendingCalls () #28 0x080aa77c in PyEval_EvalCodeEx () #29 0x080acf79 in PyEval_EvalCode () #30 0x080d90db in PyRun_FileExFlags () #31 0x080d85de in PyRun_InteractiveOneFlags () #32 0x080d83d3 in PyRun_InteractiveLoopFlags () #33 0x080d9a02 in PyRun_AnyFileExFlags () #34 0x08054e95 in Py_Main () #35 0x080549eb in main () (gdb) thread 2 [Switching to thread 2 (Thread 1131248560 (LWP 28676))]#0 0x40131bd4 in ioctl () from /lib/tls/libc.so.6 (gdb) bt #0 0x40131bd4 in ioctl () from /lib/tls/libc.so.6 #1 0x4211ce38 in fusb_devhandle_linux::_reap (this=0x85bb958, ok_to_block_p=true) at fusb_linux.cc:274 #2 0x4211dd1c in fusb_ephandle_linux::get_write_work_in_progress (this=0x85bcb30) at fusb_linux.cc:470 #3 0x4211dc3b in fusb_ephandle_linux::write (this=0x85bcb30, buffer=0x436d2cf0, nbytes=16384) at fusb_linux.cc:429 #4 0x421176ff in usrp_basic_tx::write (this=0x85bcad0, buf=0xfffffffc, len=1074025740, underrun=0x436d2ce7) at usrp_basic.cc:780 #5 0x4218c8b1 in usrp1_sink_base::work (this=0x85bb8c8, noutput_items=8192, [EMAIL PROTECTED], [EMAIL PROTECTED]) at usrp1_sink_base.cc:94 #6 0x41eb7f9a in gr_sync_block::general_work (this=0x85bb8c8, noutput_items=-4, [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]) at gr_sync_block.cc:52 #7 0x41ed8631 in gr_single_threaded_scheduler::main_loop (this=0x85b4178) at gr_single_threaded_scheduler.cc:258 #8 0x41ed7b53 in gr_single_threaded_scheduler::run (this=0xfffffffc) at gr_single_threaded_scheduler.cc:62 #9 0x41c01d7f in sts_pyrun (s=Cannot access memory at address 0xfffffffc ) at shared_ptr.hpp:253 #10 0x41c21a50 in _wrap_sts_pyrun (args=0xfffffffc) at shared_count.hpp:390 #11 0x080fde6a in PyCFunction_Call () #12 0x0805b989 in PyObject_Call () #13 0x080abcd4 in PyEval_CallObjectWithKeywords () #14 0x080aa028 in Py_MakePendingCalls () #15 0x080aa77c in PyEval_EvalCodeEx () #16 0x080ab8e9 in PyEval_CallObjectWithKeywords () #17 0x080ab72c in PyEval_CallObjectWithKeywords () #18 0x080a9bee in Py_MakePendingCalls () #19 0x080ab96d in PyEval_CallObjectWithKeywords () #20 0x080ab72c in PyEval_CallObjectWithKeywords () #21 0x080a9bee in Py_MakePendingCalls () #22 0x080aa77c in PyEval_EvalCodeEx () #23 0x080fd9b7 in PyStaticMethod_New () #24 0x0805b989 in PyObject_Call () #25 0x080623d8 in PyMethod_Fini () #26 0x0805b989 in PyObject_Call () #27 0x080ab5c7 in PyEval_CallObjectWithKeywords () #28 0x080e0b3b in initthread () #29 0x4002db63 in start_thread () from /lib/tls/libpthread.so.0 #30 0x40138c4a in clone () from /lib/tls/libc.so.6 (gdb) thread 3 [Switching to thread 3 (Thread 1139637168 (LWP 28677))]#0 0x40031d0b in [EMAIL PROTECTED] () from /lib/tls/libpthread.so.0 (gdb) bt #0 0x40031d0b in [EMAIL PROTECTED] () from /lib/tls/libpthread.so.0 #1 0x00000004 in ?? () #2 0x080dd0bc in PyThread_acquire_lock () #3 0x080ace61 in PyEval_RestoreThread () #4 0x080d7908 in PyGILState_Ensure () #5 0x080e0b20 in initthread () #6 0x4002db63 in start_thread () from /lib/tls/libpthread.so.0 #7 0x40138c4a in clone () from /lib/tls/libc.so.6 (gdb) thread 4 [Switching to thread 4 (Thread 1148025776 (LWP 28678))]#0 0x401324e7 in select () from /lib/tls/libc.so.6 (gdb) bt #0 0x401324e7 in select () from /lib/tls/libc.so.6 #1 0x421bf712 in kksdr_sampler_sink_c::wait_for_data_ready (this=0x8dd2568, wait_sec=-514) at kksdr_sampler_sink_c.cc:208 #2 0x421b02e2 in _wrap_kksdr_sampler_sink_c_sptr_wait_for_data_ready (args=0xfffffdfe) at shared_ptr.hpp:253 #3 0x080fde6a in PyCFunction_Call () #4 0x0805b989 in PyObject_Call () #5 0x080abcd4 in PyEval_CallObjectWithKeywords () #6 0x080aa028 in Py_MakePendingCalls () #7 0x080aa77c in PyEval_EvalCodeEx () #8 0x080ab8e9 in PyEval_CallObjectWithKeywords () #9 0x080ab72c in PyEval_CallObjectWithKeywords () #10 0x080a9bee in Py_MakePendingCalls () #11 0x080aa77c in PyEval_EvalCodeEx () #12 0x080fd9b7 in PyStaticMethod_New () #13 0x0805b989 in PyObject_Call () #14 0x080abcd4 in PyEval_CallObjectWithKeywords () #15 0x080aa028 in Py_MakePendingCalls () #16 0x080ab96d in PyEval_CallObjectWithKeywords () #17 0x080ab72c in PyEval_CallObjectWithKeywords () #18 0x080a9bee in Py_MakePendingCalls () #19 0x080aa77c in PyEval_EvalCodeEx () #20 0x080fd9b7 in PyStaticMethod_New () #21 0x0805b989 in PyObject_Call () #22 0x080623d8 in PyMethod_Fini () #23 0x0805b989 in PyObject_Call () #24 0x080ab5c7 in PyEval_CallObjectWithKeywords () #25 0x080e0b3b in initthread () #26 0x4002db63 in start_thread () from /lib/tls/libpthread.so.0 #27 0x40138c4a in clone () from /lib/tls/libc.so.6 (gdb)
------------------------------------------------------------------------
_______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
-- Krzysztof Kamieniecki callsign:KB1KLB mailto:[EMAIL PROTECTED]
_______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio