kpreid / shinysdr

Software-defined radio receiver application built on GNU Radio with a web-based UI and plugins. In development, usable but incomplete. Compatible with RTL-SDR.
https://shinysdr.switchb.org/
GNU General Public License v3.0
1.08k stars 115 forks source link

In hierarchical block source_impl, output 1 is not connected internally #6

Closed mr-suw closed 10 years ago

mr-suw commented 10 years ago

Hi,

I am using a rtlsdr stick and run shinysdr with the following source configuration:

'osmo': shinysdr.plugins.osmosdr.OsmoSDRSource('')

My browser is google chrome 33.0.1750.91 beta.

After I check the run checkbox in the web interface the following unhandled error is thrown:

ERROR:shinysdr:Unhandled Error
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/twisted/web/http.py", line 1394, in dataReceived
    finishCallback(data[contentLength:])
  File "/usr/lib64/python2.7/site-packages/twisted/web/http.py", line 1623, in _finishRequestBody
    self.allContentReceived()
  File "/usr/lib64/python2.7/site-packages/twisted/web/http.py", line 1686, in allContentReceived
    req.requestReceived(command, path, version)
  File "/usr/lib64/python2.7/site-packages/twisted/web/http.py", line 790, in requestReceived
    self.process()
--- <exception caught here> ---
  File "/usr/lib64/python2.7/site-packages/twisted/web/server.py", line 192, in process
    self.render(resrc)
  File "/usr/lib64/python2.7/site-packages/twisted/web/server.py", line 241, in render
    body = resrc.render(self)
  File "/usr/lib64/python2.7/site-packages/twisted/web/resource.py", line 250, in render
    return m(request)
  File "shinysdr/web.py", line 76, in render_PUT
    self._cell.set(self.grparse(data))
  File "shinysdr/values.py", line 112, in set
    return self._setter(self._ctor(value))
  File "shinysdr/top.py", line 296, in set_unpaused
    self.__start_or_stop()
  File "shinysdr/top.py", line 303, in __start_or_stop
    self.start()
  File "shinysdr/top.py", line 282, in start
    super(Top, self).start()
  File "/usr/lib64/python2.7/site-packages/gnuradio/gr/top_block.py", line 103, in start
    top_block_start_unlocked(self._tb, max_noutput_items)
  File "/usr/lib64/python2.7/site-packages/gnuradio/gr/runtime_swig.py", line 4587, in top_block_start_unlocked
    return _runtime_swig.top_block_start_unlocked(*args, **kwargs)
exceptions.RuntimeError: In hierarchical block source_impl, output 1 is not connected internally
kpreid commented 10 years ago

I seem to recall seeing a problem like this when giving osmosdr.source a bad device string (source_impl is part of osmosdr), but since the string is empty that can't be the problem here.

Could you look at the output that occurs before you connect with a web browser and see if there's anything that might be a complaint from OsmoSDR about not being able to set up the device?

mr-suw commented 10 years ago

I did start from the beginning. I am working with gnuradio 3.7.2.1. The full startup log is:

INFO:shinysdr:Log opened.
gr-osmosdr 0.1.0 (0.1.0) gnuradio 3.7.2.1
built-in source types: rtl rtl_tcp 
Using device #0 Generic RTL2832U SN: xxxxxxxxxxxxxxxxxxxxxxx
Found Rafael Micro R820T tuner
Using Volk machine: sse3_64_orc
INFO:shinysdr:Constructing flow graph...
INFO:shinysdr:Flow graph: Switching RF source
INFO:shinysdr:Flow graph: Changing sample rates
INFO:shinysdr:Flow graph: Rebuilding connections
INFO:shinysdr:Flow graph: ...done reconnecting.
INFO:shinysdr:Restoring state...
INFO:shinysdr:Flow graph: Switching RF source
INFO:shinysdr:Flow graph: Changing sample rates
INFO:shinysdr:Flow graph: Rebuilding connections
INFO:shinysdr:Flow graph: ...done reconnecting.
INFO:shinysdr:Starting web server...
INFO:shinysdr:OurStreamFactory (WebSocketFactory) starting on 8101
INFO:shinysdr:Starting factory <shinysdr.web.OurStreamFactory instance at 0x3190998>
INFO:shinysdr:Starting factory <txws.WebSocketFactory instance at 0x31909e0>
INFO:shinysdr:Site starting on 8100
INFO:shinysdr:Starting factory <twisted.web.server.Site instance at 0x31981b8>
INFO:shinysdr:ShinySDR is ready. Visit http://localhost:8100/xydINrqc-nCfG0HhiOSDDg/
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOINFO:shinysdr:127.0.0.1 - - [16/Feb/2014:08:45:39 +0000] "GET /xydINrqc-nCfG0HhiOSDDg/ HTTP/1.1" 304 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.91 Safari/537.36"
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOINFO:shinysdr:127.0.0.1 - - [16/Feb/2014:08:45:40 +0000] "GET /xydINrqc-nCfG0HhiOSDDg/dbs/ HTTP/1.1" 200 39 "http://localhost:8100/xydINrqc-nCfG0HhiOSDDg/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.91 Safari/537.36"
INFO:shinysdr:127.0.0.1 - - [16/Feb/2014:08:45:40 +0000] "GET /xydINrqc-nCfG0HhiOSDDg/wdb/ HTTP/1.1" 200 2 "http://localhost:8100/xydINrqc-nCfG0HhiOSDDg/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.91 Safari/537.36"
OINFO:shinysdr:127.0.0.1 - - [16/Feb/2014:08:45:40 +0000] "GET /client/plugin-index.json HTTP/1.1" 200 47 "http://localhost:8100/xydINrqc-nCfG0HhiOSDDg/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.91 Safari/537.36"
OINFO:shinysdr:Starting RFC 6455 conversation
INFO:shinysdr:Stream connection to  /xydINrqc-nCfG0HhiOSDDg/state
OINFO:shinysdr:Starting RFC 6455 conversation
OINFO:shinysdr:Stream connection to  /xydINrqc-nCfG0HhiOSDDg/audio?rate=44100
INFO:shinysdr:Flow graph: Rebuilding connections
INFO:shinysdr:Flow graph: ...done reconnecting.
OERROR:shinysdr:Unhandled Error
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/twisted/python/log.py", line 88, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/lib64/python2.7/site-packages/twisted/python/log.py", line 73, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/lib64/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib64/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/usr/lib64/python2.7/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
    why = selectable.doRead()
  File "/usr/lib64/python2.7/site-packages/twisted/internet/tcp.py", line 215, in doRead
    return self._dataReceived(data)
  File "/usr/lib64/python2.7/site-packages/twisted/internet/tcp.py", line 221, in _dataReceived
    rval = self.protocol.dataReceived(data)
  File "build/bdist.linux-x86_64/egg/txws.py", line 577, in dataReceived

  File "build/bdist.linux-x86_64/egg/txws.py", line 435, in parseFrames

  File "/usr/lib64/python2.7/site-packages/twisted/protocols/policies.py", line 120, in dataReceived
    self.wrappedProtocol.dataReceived(data)
  File "shinysdr/web.py", line 350, in dataReceived
    self.inner = AudioStreamInner(self.__send, self._block, rate)
  File "shinysdr/web.py", line 309, in __init__
    self._block.add_audio_queue(self._queue, audio_rate)
  File "shinysdr/top.py", line 152, in add_audio_queue
    self.__start_or_stop()
  File "shinysdr/top.py", line 303, in __start_or_stop
    self.start()
  File "shinysdr/top.py", line 282, in start
    super(Top, self).start()
  File "/usr/lib64/python2.7/site-packages/gnuradio/gr/top_block.py", line 103, in start
    top_block_start_unlocked(self._tb, max_noutput_items)
  File "/usr/lib64/python2.7/site-packages/gnuradio/gr/runtime_swig.py", line 4587, in top_block_start_unlocked
    return _runtime_swig.top_block_start_unlocked(*args, **kwargs)
exceptions.RuntimeError: In hierarchical block source_impl, output 1 is not connected internally

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOINFO:shinysdr:Starting RFC 6455 conversation
OINFO:shinysdr:Stream connection to  /xydINrqc-nCfG0HhiOSDDg/audio?rate=44100
INFO:shinysdr:Flow graph: Rebuilding connections
INFO:shinysdr:Flow graph: ...done reconnecting.
ERROR:shinysdr:Unhandled Error
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/twisted/python/log.py", line 88, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/lib64/python2.7/site-packages/twisted/python/log.py", line 73, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/lib64/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib64/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/usr/lib64/python2.7/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
    why = selectable.doRead()
  File "/usr/lib64/python2.7/site-packages/twisted/internet/tcp.py", line 215, in doRead
    return self._dataReceived(data)
  File "/usr/lib64/python2.7/site-packages/twisted/internet/tcp.py", line 221, in _dataReceived
    rval = self.protocol.dataReceived(data)
  File "build/bdist.linux-x86_64/egg/txws.py", line 577, in dataReceived

  File "build/bdist.linux-x86_64/egg/txws.py", line 435, in parseFrames

  File "/usr/lib64/python2.7/site-packages/twisted/protocols/policies.py", line 120, in dataReceived
    self.wrappedProtocol.dataReceived(data)
  File "shinysdr/web.py", line 350, in dataReceived
    self.inner = AudioStreamInner(self.__send, self._block, rate)
  File "shinysdr/web.py", line 309, in __init__
    self._block.add_audio_queue(self._queue, audio_rate)
  File "shinysdr/top.py", line 152, in add_audio_queue
    self.__start_or_stop()
  File "shinysdr/top.py", line 303, in __start_or_stop
    self.start()
  File "shinysdr/top.py", line 282, in start
    super(Top, self).start()
  File "/usr/lib64/python2.7/site-packages/gnuradio/gr/top_block.py", line 103, in start
    top_block_start_unlocked(self._tb, max_noutput_items)
  File "/usr/lib64/python2.7/site-packages/gnuradio/gr/runtime_swig.py", line 4587, in top_block_start_unlocked
    return _runtime_swig.top_block_start_unlocked(*args, **kwargs)
exceptions.RuntimeError: In hierarchical block source_impl, output 1 is not connected internally

OOOOOOOOOOOOOOOOOOINFO:shinysdr:Starting RFC 6455 conversation
INFO:shinysdr:Stream connection to  /xydINrqc-nCfG0HhiOSDDg/audio?rate=44100
INFO:shinysdr:Flow graph: Rebuilding connections
INFO:shinysdr:Flow graph: ...done reconnecting.
ERROR:shinysdr:Unhandled Error
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/twisted/python/log.py", line 88, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/lib64/python2.7/site-packages/twisted/python/log.py", line 73, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/lib64/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib64/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/usr/lib64/python2.7/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
    why = selectable.doRead()
  File "/usr/lib64/python2.7/site-packages/twisted/internet/tcp.py", line 215, in doRead
    return self._dataReceived(data)
  File "/usr/lib64/python2.7/site-packages/twisted/internet/tcp.py", line 221, in _dataReceived
    rval = self.protocol.dataReceived(data)
  File "build/bdist.linux-x86_64/egg/txws.py", line 577, in dataReceived

  File "build/bdist.linux-x86_64/egg/txws.py", line 435, in parseFrames

  File "/usr/lib64/python2.7/site-packages/twisted/protocols/policies.py", line 120, in dataReceived
    self.wrappedProtocol.dataReceived(data)
  File "shinysdr/web.py", line 350, in dataReceived
    self.inner = AudioStreamInner(self.__send, self._block, rate)
  File "shinysdr/web.py", line 309, in __init__
    self._block.add_audio_queue(self._queue, audio_rate)
  File "shinysdr/top.py", line 152, in add_audio_queue
    self.__start_or_stop()
  File "shinysdr/top.py", line 303, in __start_or_stop
    self.start()
  File "shinysdr/top.py", line 282, in start
    super(Top, self).start()
  File "/usr/lib64/python2.7/site-packages/gnuradio/gr/top_block.py", line 103, in start
    top_block_start_unlocked(self._tb, max_noutput_items)
  File "/usr/lib64/python2.7/site-packages/gnuradio/gr/runtime_swig.py", line 4587, in top_block_start_unlocked
    return _runtime_swig.top_block_start_unlocked(*args, **kwargs)
exceptions.RuntimeError: In hierarchical block source_impl, output 1 is not connected internally

OOOOOOOOOOOOOO^CINFO:shinysdr:Received SIGINT, shutting down.
INFO:shinysdr:(TCP Port 8100 Closed)
INFO:shinysdr:Stopping factory <twisted.web.server.Site instance at 0x31981b8>
INFO:shinysdr:(TCP Port 8101 Closed)
INFO:shinysdr:Stopping factory <shinysdr.web.OurStreamFactory instance at 0x3190998>
INFO:shinysdr:Stopping factory <txws.WebSocketFactory instance at 0x31909e0>
INFO:shinysdr:Main loop terminated.

My startup config is as follows:

import shinysdr.plugins.osmosdr
import shinysdr.plugins.simulate

sources = {
    # OsmoSDR generic device source; handles USRP, RTL-SDR, FunCube
    # Dongle, HackRF, etc.
    # If desired, add sample_rate=<n> parameter.
    # Use shinysdr.plugins.osmosdr.OsmoSDRProfile to set more parameters
    # to make the best use of your specific hardware's capabilities.
    'osmo': shinysdr.plugins.osmosdr.OsmoSDRSource(''),

    # For hardware which uses a sound-card as its ADC or appears as an
    # audio device.
    'audio': shinysdr.source.AudioSource(''),

    # Locally generated RF signals for test purposes.
    'sim': shinysdr.plugins.simulate.SimulatedSource(),
}

stateFile = 'state.json'

databasesDir = 'dbs/'

httpPort = 'tcp:8100'
wsPort = 'tcp:8101'

Please let me know when you need further info

kpreid commented 10 years ago

Since the hierarchical block reporting the problem is a source_impl, absent other information I'm going to have to assume that this is a bug in OsmoSDR. Sorry. I'll leave this open in case other people are having the same problem and can diagnose it better.

kpreid commented 10 years ago

P.S. When pasting in text please make sure to indent it by four spaces; this will format it monospaced and ensure the content is not interpreted as markup. I've edited your existing posts. Also, you might want to change your rootCap since you revealed it in posting the config file.

mr-suw commented 10 years ago

I solved it by updating gr-osmosdr to latest trunk version. Thanks for your time and great web interface.

kpreid commented 10 years ago

OK, that would seem to settle it. Thanks for the update!