"max recursion depth exceeded" error

Hello,

I got this error when connecting a file_descriptor source to an audio
sink in a top_block. Any ideas what might have gone wrong?

Thanks.

David

On Thu, Mar 6, 2008 at 6:03 PM, W. David Li [email protected]
wrote:

Hello,

I got this error when connecting a file_descriptor source to an audio
sink in a top_block. Any ideas what might have gone wrong?

I am going to take a guess, but I believe you have exceeded your max
recursion depth.

Maybe a little more information, such as OS, GNURadio version
(tarball, svn revision, etc), the script you’re running, the command
line you’re using might help deduce what might be causing you to, in
fact, exceed your max recursion depth.

Brian

On 3/6/08, W. David Li [email protected] wrote:

I got this error when connecting a file_descriptor source to an audio
sink in a top_block. Any ideas what might have gone wrong?

That error can happen if you try to access a method name of a
hierarhical block that doesn’t exist. Look for a typo.


Johnathan C.
Corgan Enterprises LLC
http://corganenterprises.com/

It turned out I forgot to init the top block. So this problem is gone.
The new problem is I can’t make the receiving machine to play a sound.

The client is sending a sine waveform like this:

class Client2(gr.top_block):

def __init__(self, addr, port):

gr.top_block.init(self, ‘client2’)
self._locatie = (addr, port)
self._clientsock = socket (AF_INET, SOCK_STREAM)
self._clientsock.connect(self._locatie)

    self._src = gr.sig_source_f(44100, gr.GR_SIN_WAVE, 500, 0.8)
    self._file_sink = gr.file_descriptor_sink(gr.sizeof_float,

self._clientsock.fileno())

def connect(self):
    try:
        self.connect(self._src, self._file_sink)
    except Exception, e:
        print 'client2 connect failure:',e

def run_client(self):
    self.run()
    print ' client is running '

def stop_client(self):
    self.stop()
    self.clientsock.close()
    print ' client is stopped '

if name == ‘main’:

address = sys.argv[1]
port    = int(sys.argv[2])
print ' Trying to connect to:', address, port
c = Client2(address, port)
c.run_client()

while True: pass

#c.stop_client()
print ' Done sending waveform to server!'

And the server on the receiving machine is receiving like this:

class Server2(gr.top_block):

def __init__(self):

gr.top_block.init(self, ‘server2’)
self._serversock = socket(AF_INET, SOCK_STREAM)
#serversock.bind has to use “” for other clients not on
#the same host
self._serversock.bind(("", 12345))
self._serversock.listen(1)

    print 'Ready to receive sin-wave file'
    sys.stdout.flush()


def start_listen(self):


    self._clientsock, self._clientaddr = self._serversock.accept()
    print 'Got client connection', self._clientsock,

self._clientaddr
sys.stdout.flush()

    try:

        self._filesrc = gr.file_descriptor_source(gr.sizeof_float,

self._clientsock.fileno())
self._audio_sink = audio.sink(44100)
self.connect(self._filesrc, self._audio_sink)

    except Exception, e:
        print ' Error in start_listen: ', e

def run_server(self):
    self.run()

if name == ‘main’:

s = Server2()
s.start_listen()
s.run_server()