Forum: GNU Radio usrp_tv_rcv.py problem in OS X

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Sam Small (Guest)
on 2007-01-18 18:57
(Received via mailing list)
Hi,

I am new to gnuradio and I am trying to work through some of the
example scripts.  I have a working installation on an Intel Mac and
have had success running usrp_wfm_rcv.py with the Basic RX board.
However, when I try to run usrp_tv_rcv.py with the TVRX board, it
cannot run successfully.  I have pasted the output below.  Does
anyone have any ideas on how to go about solving this problem?

Thanks for your help,
Sam


$ pythonw usrp_tv_rcv.py
usb_control_msg failed: usb_control_msg(DeviceRequestTO): pipe is
stalled
Using RX d'board A: TV Rx Rev 3
2007-01-18 11:50:47.322 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x614ccb0 of class NSMutableParagraphStyle autoreleased with
no pool in place - just leaking
2007-01-18 11:50:47.322 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x614dd60 of class NSCFDictionary autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.324 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x6148940 of class NSCFNumber autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.324 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x6118060 of class NSCFNumber autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.324 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x6149200 of class NSCFNumber autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.324 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x6150150 of class NSCFDictionary autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.324 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x6150250 of class NSIdEnumerator autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.324 Python[17353] *** _NSAutoreleaseNoPool():
Object 0xa3264fa8 of class NSCFString autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.324 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x6150390 of class NSCFArray autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.326 Python[17353] *** _NSAutoreleaseNoPool():
Object 0xa3264e58 of class NSCFString autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.326 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x6148ca0 of class NSCFNumber autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.326 Python[17353] *** _NSAutoreleaseNoPool():
Object 0xa3264e68 of class NSCFString autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.326 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x6148310 of class NSCFNumber autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.326 Python[17353] *** _NSAutoreleaseNoPool():
Object 0xa3264e78 of class NSCFString autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.326 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x6148f10 of class NSCFNumber autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.326 Python[17353] *** _NSAutoreleaseNoPool():
Object 0xa3264e88 of class NSCFString autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.326 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x6148f10 of class NSCFNumber autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.326 Python[17353] *** _NSAutoreleaseNoPool():
Object 0xa3264e78 of class NSCFString autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.326 Python[17353] *** _NSAutoreleaseNoPool():
Object 0xa3264e88 of class NSCFString autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.326 Python[17353] *** _NSAutoreleaseNoPool():
Object 0xa3264e78 of class NSCFString autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.326 Python[17353] *** _NSAutoreleaseNoPool():
Object 0xa3264e88 of class NSCFString autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.326 Python[17353] *** _NSAutoreleaseNoPool():
Object 0xa3264e78 of class NSCFString autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.327 Python[17353] *** _NSAutoreleaseNoPool():
Object 0xa3264e78 of class NSCFString autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.327 Python[17353] *** _NSAutoreleaseNoPool():
Object 0xa3264e78 of class NSCFString autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.327 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x6117730 of class NSCFNumber autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.327 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x6148ec0 of class NSCFArray autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.338 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x614b570 of class __NSFontTypefaceInfo autoreleased with no
pool in place - just leaking
2007-01-18 11:50:47.338 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x616eb70 of class NSAffineTransform autoreleased with no pool
in place - just leaking
2007-01-18 11:50:47.339 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x616ecf0 of class NSFont autoreleased with no pool in place -
just leaking
2007-01-18 11:50:47.339 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x616ed70 of class NSFont autoreleased with no pool in place -
just leaking
2007-01-18 11:50:47.339 Python[17353] *** _NSAutoreleaseNoPool():
Object 0xa3260e58 of class NSCFString autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.339 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x616f760 of class _NSCachedBitmapImageRep autoreleased with
no pool in place - just leaking
2007-01-18 11:50:47.339 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x616f820 of class NSImage autoreleased with no pool in place
- just leaking
2007-01-18 11:50:47.339 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x616f990 of class _NSCachedBitmapImageRep autoreleased with
no pool in place - just leaking
2007-01-18 11:50:47.339 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x616fa20 of class NSImage autoreleased with no pool in place
- just leaking
2007-01-18 11:50:47.340 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x614ecf0 of class _NSThemeCloseWidget autoreleased with no
pool in place - just leaking
2007-01-18 11:50:47.340 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x616ed70 of class NSFont autoreleased with no pool in place -
just leaking
2007-01-18 11:50:47.340 Python[17353] *** _NSAutoreleaseNoPool():
Object 0xa3260e58 of class NSCFString autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.340 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x6170110 of class _NSCachedBitmapImageRep autoreleased with
no pool in place - just leaking
2007-01-18 11:50:47.340 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x616ff80 of class NSImage autoreleased with no pool in place
- just leaking
2007-01-18 11:50:47.340 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x6170280 of class _NSCachedBitmapImageRep autoreleased with
no pool in place - just leaking
2007-01-18 11:50:47.340 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x616ffe0 of class NSImage autoreleased with no pool in place
- just leaking
2007-01-18 11:50:47.341 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x616fca0 of class _NSThemeWidget autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.341 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x616ed70 of class NSFont autoreleased with no pool in place -
just leaking
2007-01-18 11:50:47.341 Python[17353] *** _NSAutoreleaseNoPool():
Object 0xa3260e58 of class NSCFString autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.341 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x616f500 of class _NSCachedBitmapImageRep autoreleased with
no pool in place - just leaking
2007-01-18 11:50:47.341 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x61470e0 of class NSImage autoreleased with no pool in place
- just leaking
2007-01-18 11:50:47.341 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x616ff10 of class _NSCachedBitmapImageRep autoreleased with
no pool in place - just leaking
2007-01-18 11:50:47.341 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x6170650 of class NSImage autoreleased with no pool in place
- just leaking
2007-01-18 11:50:47.341 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x6170590 of class _NSThemeWidget autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.342 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x616f960 of class NSCFString autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.342 Python[17353] *** _NSAutoreleaseNoPool():
Object 0x6148600 of class NSException autoreleased with no pool in
place - just leaking
2007-01-18 11:50:47.342 Python[17353] *** Uncaught exception:
<NSInternalInconsistencyException> Error (1002) creating CGSWindow
Trace/BPT trap

[At this point I get a popup dialogue stating, "The application
Python quit unexpectedly."]
Michael D. (Guest)
on 2007-01-18 19:32
(Received via mailing list)
Sam - Could you provide which Mac model, OS version, XCode version,
and how you installed the background libraries and apps and such
(e.g. DarwinPorts, Jon Jacky's scripts, my scripts, from source,
Fink, some combination)?  What version of Python are you using?  I've
never seen these issues, but then I've never tried that script.

According to the SVN repository, that script is 9 months old, so it
very well could be that the script needs updating to work properly
with all the various changes in GNU Radio since it was last
updated ... I don't have access to a TVRX board right now ... can
anyone else confirm that this script works for them (not necessarily
on OSX)? - MLD
Sam Small (Guest)
on 2007-01-18 20:27
(Received via mailing list)
Hi Michael,

Thanks for your response.  Here are the machine specs:

Macbook (Macbook 1,1) - 2 Ghz Intel Core Duo w/ 1GB of RAM
OS X v. 10.4.8
XCode v. 2.3

Installation consisted of the following: Darwin Ports and Jon Jacky's
guide with some deviations:
- used SVN instead of CVS
- followed installation instructions for SDCC from GNU Radio wiki
- installed SDL 1.2.11 from source

Thanks again,
Sam
Martin D. (Guest)
on 2007-01-18 20:40
(Received via mailing list)
Michael D. wrote:
> that this script works for them (not necessarily  on OSX)? - MLD
>
> On Jan 18, 2007, at 11:56 AM, Sam Small wrote:
>
>> I am new to gnuradio and I am trying to work through some of the
>> example scripts.  I have a working installation on an Intel Mac and
>> have had success running usrp_wfm_rcv.py with the Basic RX board.
>> However, when I try to run usrp_tv_rcv.py with the TVRX board, it
>> cannot run successfully.  I have pasted the output below.  Does
>> anyone have any ideas on how to go about solving this problem?

I wrote the usrp_tv_rcv.py receive script.
It still works on my box (debian sarge on x86)

It could very well that problem has to do with SDL.
usrp_tv_rcv.py uses video_sdl.sink_uc from the gnuradio module
gr-video-sdl.

I never tested this on OSX, only on x86
Since SDL is portable it should work though.

Could you try running the attached test-video-sdl.py script.

It just tests if video-sdl will load.

As a sidenote:
usrp_tv_receive.py is not a complete tv-receiver.
It doesn't do deinterlacing and there is no synchronisation or color
decoding yet.
So you get a black-and-white slowly rolling screen with the two fields
above each other.

Greetings,
Martin
Michael D. (Guest)
on 2007-01-19 17:29
(Received via mailing list)
Sam - Can you try installed SDL from DarwinPorts and see if that
works?  Should be a quick change, but (I think) you'll need to
recompile GNU Radio to use to new libraries. - MLD
Sam Small (Guest)
on 2007-01-19 17:30
(Received via mailing list)
Thanks Martin,

The script looks like it runs just fine.  Here is the output:

$ python SDLtest.py
.
----------------------------------------------------------------------
Ran 1 test in 0.000s

OK



Sam
Michael D. (Guest)
on 2007-01-22 23:19
(Received via mailing list)
Sam - After some ado, everything is running again on my various PPC
and Intel Macs, and I was in the lab today and tested out GNU Radio
running the script you were having an issue with.  On both the Intel-
Mac (iMac 20", Core 2 Dou @ 2.16 GHz, 2 GB DRAM) and PPC-Mac
(PowerMac, Dual G5 @ 2.0 GHz, 2 GB DRAM), I got exactly the same
response - lots of NSAutoreleaseNoPool errors that seem to come from
the use of SDL in gr-video-sdl.  Sorry this isn't more helpful
(yet) ... but at this point in time it looks like SDL video (or at
least the example script) doesn't work on a Mac (any other Mac users
care to try it out & respond?). - MLD
Martin D. (Guest)
on 2007-01-23 02:25
(Received via mailing list)
Michael D. wrote:
>
> On Jan 18, 2007, at 11:56 AM, Sam Small wrote:
>
>> 2007-01-18 11:50:47.342 Python[17353] *** Uncaught exception:
>> <NSInternalInconsistencyException> Error (1002) creating CGSWindow
>> Trace/BPT trap
>>
>> [At this point I get a popup dialogue stating, "The application
>> Python quit unexpectedly."]
I found that more people are having problems using SDL on OSX.

I found this in a mono discussion:
http://lists.ximian.com/pipermail/mono-devel-list/...
<<snip>>
I still got the error:

<Uncaught exception:
<NSInternalInconsistencyException> Error (1002)
creating CGSWindow
Trace/BPT trap

A bit of research showed that this error occurres if
cocoa hasn't been initialised,  which can be done with
the API call NSApplicationLoad.

So, I did an external declaration for that function:

[DllImport("/System/Library/Frameworks/Cocoa.framework/Cocoa")]
public static extern void NSApplicationLoad();

then just make a call to NSApplicationLoad prior to
calling SDL_Init.
<<\snip>>

This is a solution for using SDL with mono.
But there is probably also a C++ or python way of doing the
NSApplicationLoad() to instantiate cocoa.

Hope this helps,

Martin
Michael D. (Guest)
on 2007-01-23 03:13
(Received via mailing list)
Martin - Thanks!  I found the reference to that method on Apple's WWW
site, and will try it out on Wednesday.  Something like:

#ifdef __APPLE__
#include <AppKit/AppKit.h>
#endif

then

#ifdef __APPLE__
NSApplicationLoad(void)
#endif

before anything else in SDL gets called.  THen I need to include the
AppKit framework in the compile, but that's pretty simple. - MLD
Michael D. (Guest)
on 2007-09-26 00:52
(Received via mailing list)
Sam - Here is an initial cut, to get primary functionality working.
I still can't get it to play videos yet, but now it seems like an SDL
issue as opposed to a GNU Radio / Cocoa issue ... meaning that I get
the video window (and GUI, if using that), no video playing, then it
crashes after a few seconds [tracing with GDB reveals that this is
while blitting to the video window].  The appended patches are
applied from your top gnuradio directory. - MLD

% svn diff
Index: gr-video-sdl/src/video_sdl_sink_s.cc
===================================================================
--- gr-video-sdl/src/video_sdl_sink_s.cc  (revision 4291)
+++ gr-video-sdl/src/video_sdl_sink_s.cc  (working copy)
@@ -36,8 +36,11 @@
#include <iostream>
#include <stdexcept>
+#ifdef __APPLE__
+//void NSApplicationLoad (void);
+#include <WebKit/CarbonUtils.h>
+#endif
-
video_sdl_sink_s::video_sdl_sink_s (double framerate,int width, int
height,unsigned int format,int dst_width,int dst_height)
    : gr_sync_block ("video_sdl_sink_s",
       gr_make_io_signature (1, 3, sizeof (short)),
@@ -56,6 +59,12 @@
      d_avg_delay(0.0),
      d_wanted_ticks(0)
{
+#ifdef __APPLE__
+  /* this must be called before SDL can work under Darwin */
+  //  NSApplicationLoad ();
+  WebInitForCarbon ();
+#endif
+
    if(framerate<=0.0)
      d_wanted_frametime_ms=0;//Go as fast as possible
    else
Index: gr-video-sdl/src/video_sdl_sink_uc.cc
===================================================================
--- gr-video-sdl/src/video_sdl_sink_uc.cc  (revision 4291)
+++ gr-video-sdl/src/video_sdl_sink_uc.cc  (working copy)
@@ -36,8 +36,11 @@
#include <iostream>
#include <stdexcept>
+#ifdef __APPLE__
+//void NSApplicationLoad (void);
+#include <WebKit/CarbonUtils.h>
+#endif
-
video_sdl_sink_uc::video_sdl_sink_uc (double framerate,int width, int
height,unsigned int format,int dst_width,int dst_height)
    : gr_sync_block ("video_sdl_sink_uc",
       gr_make_io_signature (1, 3, sizeof (unsigned char)),
@@ -56,6 +59,12 @@
      d_avg_delay(0.0),
      d_wanted_ticks(0)
{
+#ifdef __APPLE__
+  /* this must be called before SDL can work under Darwin */
+  //  NSApplicationLoad ();
+  WebInitForCarbon ();
+#endif
+
    if(framerate<=0.0)
      d_wanted_frametime_ms=0;//Go as fast as possible
    else
Index: config/sdl.m4
===================================================================
--- config/sdl.m4  (revision 4291)
+++ config/sdl.m4  (working copy)
@@ -44,6 +44,12 @@
      SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
      SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
+    case "$host_os" in
+      darwin*)
+    SDL_LIBS="$SDL_LIBS -Wl,-framework,WebKit"
+  ;;
+    esac
+
      sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
      sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
This topic is locked and can not be replied to.