Wavefile Source does not stream its audio to the end of the file.
I am attempting to send the output of a Wavefile Source to an Audio Sink as a test for inclusion in a larger project. The flowgraph consists only of the Source block ( 12000 samples/sec), a Rational Re-sampler with interpolation of 4 and the Sink (48000 samples/sec). The wavefile is 15 seconds long and plays properly using SMPlayer. When I run the flowgraph there is only a short burst of audio (measured in ms) and the flowgraph terminates. What is wrong here? I expected the flowgraph to run for 15 secs. Jim -- This email has been checked for viruses by AVG antivirus software. www.avg.com
Index Error: output_index < noutputs
I have submitted this issue previously and received a response which resulted in my trying several things which didn’t work. I then submitted the issue to Stackoverflow and received no answers. I get this error when I try to use a Selector to select one of 2 outputs with my selection obviously being smaller than the number of outputs. I can successfully use a Selector if I use a number for the output index or a variable whose value is selected by a Toggle Button but not if I try to set the variable programmatically in Python. In general, why do you get such an error? I am asking the question in this manner because my specific questions relating to my code and flowgraph have not resulted in any concrete answers (or any answers at all). Thanks again for any help. I have been struggling with this for several weeks. Jim -- This email has been checked for viruses by AVG antivirus software. www.avg.com
Re: Selector error - "IndexError: output_index must be < noutputs"
Jim, I have attached a greatly simplified version of what I am trying to accomplish. I still get the same error. What am I doing wrong? Jim From: Jim Melton Sent: Monday, August 28, 2023 12:01 PM To: discuss-gnuradio@gnu.org Subject: RE: Selector error - "IndexError: output_index must be < noutputs" Don’t you need to instantiate “Receive”? --- Jim Melton Non-Sensitive From: discuss-gnuradio-bounces+jim.melton=sncorp@gnu.org On Behalf Of Elmore's Sent: Monday, August 28, 2023 09:15 To: discuss-gnuradio@gnu.org Subject: [EXTERNAL] Selector error - "IndexError: output_index must be < noutputs" I am attempting to use a Selector block with 2 outputs. I want to select the output programmatically. When I run the flowgraph, I get the subject error. The following is my abbreviated code which is pertinent to the question interspersed with explanatory comments: import Receive Receive is a Hier Block which I import in to my Python file blocks_selector_0 = Receive.blocks.selector(gr.sizeof_float*1,0,0) Instantiation of blocks_selector_0. The Selector block is in the Receive Hier Block. blocks_selector_0.set_output_index(0) I am trying to select the 0 output. This is where the error occurs. 0 is certainly less than 2 so what is happening? Jim Virus-free.www.avg.com CONFIDENTIALITY NOTICE - SNC EMAIL: This email and any attachments are confidential, may contain proprietary, protected, or export controlled information, and are intended for the use of the intended recipients only. Any review, reliance, distribution, disclosure, or forwarding of this email and/or attachments outside of Sierra Nevada Corporation (SNC) without express written approval of the sender, except to the extent required to further properly approved SNC business purposes, is strictly prohibited. If you are not the intended recipient of this email, please notify the sender immediately, and delete all copies without reading, printing, or saving in any manner. --- Thank You. -- This email has been checked for viruses by AVG antivirus software. www.avg.com Selector_epy_block_0.py Description: Binary data Selector_Test.grc Description: Binary data
Selector error - "IndexError: output_index must be < noutputs"
I am attempting to use a Selector block with 2 outputs. I want to select the output programmatically. When I run the flowgraph, I get the subject error. The following is my abbreviated code which is pertinent to the question interspersed with explanatory comments: import Receive Receive is a Hier Block which I import in to my Python file blocks_selector_0 = Receive.blocks.selector(gr.sizeof_float*1,0,0) Instantiation of blocks_selector_0. The Selector block is in the Receive Hier Block. blocks_selector_0.set_output_index(0) I am trying to select the 0 output. This is where the error occurs. 0 is certainly less than 2 so what is happening? Jim -- This email has been checked for viruses by AVG antivirus software. www.avg.com
Python Block Callback Usage
In an attempt to understand the mechanism of resetting a Head block I developed the attached flowgraph as a test. I want to be able to reset the Head block using the Check Box. The comments in the Python Block state: # if an attribute with the same name as a parameter is found, # a callback is registeredI don’t understand what the callback method is called. I have tried using Reset and _Reset_callback but the callback is never called.Also, you might comment on my attempt to call reset() in the Head block – is this correct? Jim -- This email has been checked for viruses by AVG antivirus software. www.avg.com Head_Reset.py Description: Binary data Head_Test.grc Description: Binary data
Does the reset() method in the Head block work?
I am trying to reset a Head block so that I can resume streaming after receiving 180,000 samples. I had previously posted “Incompatible Function Arguments” related to this question but I seem to have resolved that issue. The following code – a callback – shows what I am attempting to do but it is not re-setting. The streaming never resumes. Is there more I need to do other than the reset? The Head block is in a Hier Block. Is this a complicating factor? from gnuradio import blocks def rx(stop_rx): while not stop_rx.isSet(): print("\nStarting RX") check_time(rx_cycle) parse_rx() time.sleep(8) blocks_head_0 = blocks.head(gr.sizeof_float*1, 12000*15) blocks_head_0.reset() print("\nExiting RX") -- This email has been checked for viruses by AVG antivirus software. www.avg.com
Re: Incompatible function arguments
Marcus, Attached is the hier block file and the snippet of code for the callback from which I want to call the reset. Jim -- This email has been checked for viruses by AVG antivirus software. www.avg.com code snippet.py Description: Binary data Receive.py Description: Binary data
Incompatible function arguments
I have created a flowgraph which has a hierarchical block called Receive. In the Receive block is a Head block. The primary block has an OOT containing a callback in which I wish to call the reset() function in the Head block as follows: Receive.blocks.head.reset() This call results in the following error: TypeError: reset(): incompatible function arguments. The following argument types are supported: 1. (self: gnuradio.blocks_python.head) –> None I’m confused since reset takes no arguments and I don’t understand the meaning of the argument types shown. Jim -- This email has been checked for viruses by AVG antivirus software. www.avg.com
Display text output within GNU Radio from an application
Is there a way to produce a text display window in GNU Radio? I do not see anything in the listing of blocks. I have an application that produces a stream of text for display. I would rather display it within GNU Radio rather than as console output. The only reference I can find is to the following: https://github.com/dl1ksv/gr-display Is this what I will need to use? I assume it produces an OOT module. Jim -- This email has been checked for viruses by AVG antivirus software. www.avg.com
Digital Number Control mouse action
Although I didn’t find any reference to the use of a mouse with the Control in the documentation, I discovered that the mouse can be used. However. it seems to be inconsistent. At one point the buttons would increase the selected digit and then suddenly change to decrease the selected digit. I thought at one point I saw one button increase while the other decreased the digit. However, I could not repeat this behavior. This would certainly be the desired behavior. Any comments on this? Am I doing something wrong? Jim -- This email has been checked for viruses by AVG antivirus software. www.avg.com
Re: Import error using an OOT
I tried omitting the ./ and still get the same error. I thought ./ indicated the current directory. The .conf file is in the same directory as the .py file. I tried using read_file and got a MissingSectionHeaderError. Jim -- This email has been checked for viruses by AVG antivirus software. www.avg.com
Import error using an OOT
I have created an OOT which when I incorporate it in my flowgraph shows the following error: Failed to evaluate import expression ‘import ft8’ The yaml file is: id: ft8_run_response label: ft8 category: '[ft8]' templates: imports: import ft8 make: ft8.run_response(${ft8_button}) callbacks: - set_ft8(${ft8_button}) # Make one 'parameters' list entry for every parameter you want settable from the GUI. # Keys include: # * id (makes the value accessible as keyname, e.g. in the make entry) # * label (label shown in the GUI) # * dtype (e.g. int, float, complex, byte, short, xxx_vector, ...) # * default parameters: - id: ft8_button label: ft8_button dtype: raw default: 0 # 'file_format' specifies the version of the GRC yml format used in the file # and should usually not be changed. file_format: 1 I have developed and used an OOT before without an issue. I looked at the previous OOT and reviewed the GNU Radio docs on OOTs without seeing anything different. I am using Python 3.92 with GNU radio 3.9.4.0 on a Raspberry Pi. I hope someone can show me the error of my ways. Jim -- This email has been checked for viruses by AVG antivirus software. www.avg.com
QT GUI Entry
I am using a QT GUI Entry for entry and display of a frequency. It appears that I can only enter a maximum of 6 digits (Float is selected). For example, I can enter 7.x MHz giving me a resolution of 10 Hz. However, if I wish to enter 14.x MHz to achieve the same 10 Hz resolution, I can’t and am limited to 100 Hz resolution. Am I missing something obvious here? (I have been known to do that). Thanks for any help. Jim -- This email has been checked for viruses by AVG antivirus software. www.avg.com
Re: Time Partitioned FFT
Daniel, Thanks for the explanation of how to implement JM’s solution in GNU Radio. And thanks to JM for the discussion. This should get me over my initial stumbling block to get started. Jim -- This email has been checked for viruses by AVG. https://www.avg.com
Re: Time Partitioned FFT
Chris, I am attempting to see if I can implement a particular communications application called FT8 in GNU radio. FT8 uses FFTs in the manner I described to decode the data which appears as 160 ms symbols encoded as 8 tones. If I understand the protocol correctly, 4 FFTs run concurrently. When 160 ms has completed, the 5th FFT is starting. My questions at this point boil down to how do you start and stop an FFT? How do you implement a delay in starting the FFT? Is what I am trying even feasible with GNU Radio? Jim -- This email has been checked for viruses by AVG. https://www.avg.com
Time Partitioned FFT
Is it possible to use GNU radio to perform time partitioning of FFTs? I would like to be able to start an FFT and run it for 160 ms. A second one would start 40 ms after the start of the first and run for 160 ms. A third would start 40 ms after the start of the second. This process would continue for any number of FFTs. I hope I have correctly asked the question. I’m not even sure how you would limit the running time of the FFT. -- This email has been checked for viruses by AVG. https://www.avg.com
AGC3 block - only Complex?
I added an AGC3 block to my flowgraph. When I attempted to change it to a Float in the drop-down box there was no drop-down, It stayed at Complex. Any comments? Jim -- This email has been checked for viruses by AVG. https://www.avg.com
Stop and start flowgraph in real time
I have a flowgraph for a transceiver in which I wish to stop and start the Receive and Transmit flowgraphs as required. The Receive and Transmit functions are implemented as Hierarchical Blocks. A PTT selection is used to switch the functionality of the top_block flowgraph using a Selector Block and the hardware. I have not been able to find anything that would implement this. Jim -- This email has been checked for viruses by AVG. https://www.avg.com
Reload Blocks apparently prevented due to warning
When I attempt to perform a Reload Blocks I get the following: Warning: vocoder_codec2_decode_ps – option_attributes are for enums only, ignoring Warning: vocoder_codec2_decode_sp – option_attributes are for enums only, ignoring It appears that the reload is not being performed since some new parameters that I put in a Hierarchical Block are not appearing in the top_block. I have performed the reload many times in the course of the project without issues. It is possible that this is the first time I have tried a reload since I upgraded to 3.9.4.0. What is the problem? Jim -- This email has been checked for viruses by AVG. https://www.avg.com
Re: failed to fetch http://mirrordirector.org/rasbian ...
Marcus, My problem is solved. I didn’t need to upgrade to Bookworm. Using the command ‘apt install gnuradio –dev’ instead of ‘apt install gnuradio’ did the trick. I don’t understand the need for the –dev but it worked. Jim -- This email has been checked for viruses by AVG. https://www.avg.com
Re: failed to fetch http://mirrordirector.org/rasbian ...
Marcus, I have upgraded my Raspberry Pi to Bullseye. When I attempted to upgrade to Bookworm I got a message that the repository does not have a Release file. Thus, I cannot upgrade. Bullseye gives me gnuradio 3.8.2. I went on the Raspberry Pi forum for suggestions about what to do in order to be able to upgrade to gnuradio 3.9 without Bookworm and received 2 suggestions to build 3.9 from source. In your reply to my original post you said “If upgrading from Debian 11 to Bookworm (which will be 12) is not an option (FOR A REASON, honestly, upgrading debian is rather smooth), do not go the manual route of building GNU Radio from source using cmake/make/ a lot of time figuring things out, but simply use our or the official debian packaging tools to automate that building for you.” What tools do I use to automate the building? Jim -- This email has been checked for viruses by AVG. https://www.avg.com
Re: failed to fetch http://mirrordirector.org/rasbian ...
Marcus, At your suggestion: I upgraded to Debian 11 (Bullseye) following instructions I found on Tom’s Hardware site. It seemed to be successful except that GNU radio no longer executes. Figuring that perhaps I need to install Debian 12 and upgrade to GNU radio 3.9 before it will run again I went to the following:https://wiki.debian.org/DebianEdu/Documentation/Bookworm/Upgrades The following happens during the installation process: Execute ‘apt full-upgrade’: unmet dependencies:libc –dev –binlibc6 –dbglibc6 –dev libnih1 Execute ‘apt –f install’ at the suggestion of the instructions: dpkg: error processing archive /var/cache/apt/archives/init-system –helpers_1.60_all.deb (—unpack) Errors encountered while processing: /var/cache/apt/archives/init-system –helpers_1.60_all.deb Sub-process /usr/bin/dpkg returned an error code Execute ‘apt –y full-upgrade’ at the suggestion of the instructions:unmet dependencies error same as above Execute ‘apt-get –f install’ at the suggestion of the execution result: unmet dependencies error same as above What’s next? Jim -- This email has been checked for viruses by AVG. https://www.avg.com
failed to fetch http://mirrordirector.org/rasbian ...
Device: Raspberry Pi 3 OS: Rasbian Jessie My goal is to install GNU Radio 3.9. I am following the instructions in Installing GR on the gnuradio site. In the installation for Volk I attempt to execute cmake –DCMAKE_BUILD_TYPE=Release –DPYTHON_EXECUTABLE=/usr/bin/python ../ I get a message that distutils is not found. I need to install python3_distutils. When I attempt the installation, I get a series of messages “Failed to fetch mirrordirector.rasbian.org/rasbian/ ..” with different paths. I have viewed many forums regarding this issue and they provide many different ”solutions” but nothing conclusive. Please help. Jim -- This email has been checked for viruses by AVG. https://www.avg.com
Variable Config Read and Write Questions
Variable Config ID: I_image_config Section: image_sections[image_chooser] Option: I_image_correct Write Back: I_Gain GUI Range ID: I_Gain Default: I_image_config I found a question similar to this one on the forum but no one answered it so I hope I can get a response to this one. I have shown above my configuration for two blocks in my flowgraph. I wish to write to and read from an INI file with 5 sections. I can successfully write the value of I_Gain to I_image_correct in a single section when I make an adjustment to the I_Gain Range control. I want to use a Chooser with the ID: image_chooser to select another section to write a value of I_Gain to that section. However, the Chooser callback writes the current value of I_Gain immediately to the file without my making a change to I_Gain. This is a major problem if I wish to select a Section that I had already stored a value in. Whatever the current value of I_Gain happens to be is written to the Section. For example: I change I_Gain to 1.1 for Section 40. I then select Section 80 which immediately upon selection has 1.1 written to it. I then select I_Gain = 1.5 which stores that value in Section 80. I then select Section 40 in hopes of using I_Gain = 1.1 but find that in the process of selection the value of I_Gain has changed to 1.5. This makes no sense since it defeats the purpose of saving a configuration in a file. How do I save parameters to different sections without the sections being overwritten? The other main issue is how do I read from the file so that I can set I_Gain when the Section is selected? I don’t see how to do this. The only time I have seen the file read is on initialization. I presume this is due to the fact that I set the default value of I_Gain to I_image_config. I need to to be able to read a value on demand. By the way, I have 3 parameters to save and recall in each of 5 Sections. Any help will be greatly appreciated. I have been wrestling with this issue for quite some time. -- This email has been checked for viruses by AVG. https://www.avg.com
Variable Config Section parameter - can it be a variable?
I would like to use a variable as the Section parameter in a Variable Config so that I can select a Section in the INI file from another block. However, the Variable Config sees anything typed in as a string – not the value of the variable. I thought perhaps I could specify str(variable) but that didn’t work. Can this be done? I have seen a post which suggested that it could but there was no confirmation. Thanks for your help, Jim -- This email has been checked for viruses by AVG. https://www.avg.com
How do you write to a widget from a Python file in an OOT?
I had asked this question earlier in a different form but did not receive a response so I am trying a different approach using a greatly simplified flowgraph to illustrate my point. I have attached the three pertinent files. Test is an OOT module. I want to be able to trigger a callback set_IGain (which works) and write a value to the I_Gain GUI Entry (which doesn’t work). I have tried various imports, setting of variables and any other scheme that I could think of. I have not included any specific piece of code in the callback. This seems like such a simple thing to do but nothing works. I get various errors or nothing is written when I eliminate the errors. I must be missing a basic point. Please help me get over this hump. Jim -- This email has been checked for viruses by AVG. https://www.avg.com test.py Description: Binary data test test_sr_test test_sr import test_sr test_sr.test($I_Gain, $Change_I_Gain) set_IGain($Change_I_Gain) I_Gain I_Gain 0 raw Change_I_Gain Change_I_Gain 0 raw
How can I write a value to a Range widget programmatically
I have a flowgraph containing a GUI Range widget and an Out of Tree module. In the OOT Python program I want to read a value from a file and write it to the GUI Range. It seems to me that this should be simple but I have tried multiple scenarios with imports, method calls and assignments with no success. I can read the value from the file but I cannot write it to the widget. I get various types of errors depending on the nature of my attempt. I hope someone can straighten me out. Jim -- This email has been checked for viruses by AVG. https://www.avg.com
OOT Module with shape error
I am attempting to add an OOT module to my flowgraph. I have generated a General block which I want to place between an Audio Source and a Multiply Constant. The Audio Source is set at a 48K sample rate. Input and Output are float. As a test (I have never tried using an OOT module before) I said: out[:] = input_items[0] in an attempt to simply feed the input to the output unmodified. I get a run time error: ValueError: Could not broadcast input array from shape(4800) into shape(256) Obviously I don’t know how to perform the simplest possible operation. What is wrong here? I have tried looking on forums and reading some of the GNU docs but no joy. Thanks for any help. Jim -- This email has been checked for viruses by AVG. https://www.avg.com
Frequency Selective IQ Correction
Does anyone have any information on the use of the subject block? There is no documentation on the GNU Radio site and a Google search revealed nothing. Thanks, Jim -- This email has been checked for viruses by AVG. https://www.avg.com
Hierarchical blocks in a flowgraph
I have created a flowgraph which includes 2 hierarchical blocks which I created myself. The entire flowgraph is a transceiver. The hierarchical blocks are a receiver and transmitter. When I tested the hierarchical blocks separately, they function correctly. However, when I enable both in the top flowgraph, the flowgraph executes extremely slowly. It does not respond to clicks until perhaps as much as 30 seconds later. I tried taking one of the hierarchical blocks to the most basic level possible by simply using a Null Source and Sink. I still get the hang-up. Is there something I am not doing in the flowgraph to enable it to run with 2 blocks? Is there some sort of configuration I need to perform to get it to run? I have looked all over forums and in the docs but can’t find anything to solve my problem. Thanks for any help. Jim -- This email has been checked for viruses by AVG. https://www.avg.com
Import Block "bad import syntax"
I have a problem as indicated in the subject line that has me totally baffled. I have created a noblock module with gr_modtool called softrock. This module has been successfully created and lives in /usr/local/lib/python2.7/dist-packages/softrock. It contains a file softrock_usb.py. I have an existing flowgraph in which I select an Import block. In the Import line in Properties I type “import softrock” (without quotes). I get the error “bad import syntax”. I used the document TutorialPythonFunctions from the gnuradio wiki as guidance for this task. I have performed extensive searching for this issue but everything points back to simply adding the word “import” in front of the module name. I have tried completely clearing the text box thinking that there might be extraneous characters present. This seems so simple that I am baffled why it isn’t working. My platform is a Raspberry Pi 3 with Raspbian Jessie. Thanks for any help you might give me. Jim -- This email has been checked for viruses by AVG. https://www.avg.com
USB communication
Simple question: How do I use USB communication in gnuradio? I can’t find any blocks that implement USB. I can’t find any reference to USB. I can’t find any discussion about USB on forums. There must be a way to implement one of the most common means of communication in the computer world. What am I missing? Thanks. -- This email has been checked for viruses by AVG. https://www.avg.com
_multiline_python_external
I am attempting to use a Python Module. In epy_module.xml the type is _multiline_python_external. When I attempt to use this module in a flowgraph, I get an error that the type “is not a possible type”. However, I have seen this type used successfully in Version 3.7.9 for Windows. I am using version 3.7.5 on a Raspberry Pi. What do I need to do to use this type in a module? -- This email has been checked for viruses by AVG. https://www.avg.com
Creating and installing a new Python module
I am trying to create a new Python module. I am looking at various pieces of documentation including guided Tutorial GNU Radio in Python and OutOfTreeModules. When I get to the step of installing the block, the following is shown as the tasks to perform while in the build directory; cmake ../ make When I type cmake ../ it appears that the compilation process is occurring. I get an error and when I look at the log file, I see references to C++ as if it is performing a C++ compilation even though this is a Python block. Also the error occurs due to Boost(?) missing. What is going on here? Any help will be greatly appreciated. Jim -- This email has been checked for viruses by AVG. https://www.avg.com
GNU Radio SDR Project
I am currently working on a GNU radio project using my Softrock/MOBO SDR. I have a functioning receiver and transmitter. I now want to incorporate an interface to the Softrock in the GNU Radio flowgraph. I have not been able to find any info on how to do this. I am using a command line application called usbsoftrock to control PTT and frequency. This is written in C. Ideally I would like to call usbsoftrock from the flowgraph but I don’t see any way to do that. I have looked at creating a new block and using a Function Probe block but this doesn’t seem possible. The blocks need to be written in C++ or Python and Function Probe can’t make a single function call. My platform is a Raspberry Pi. GNU Radio has presented a stiff learning curve for me and I’m sure I still have a lack of understanding of many aspects of it. Note that I have used quisk on the RPi and PowerSDR on a Windows machine with the Softrock. Any suggestions? Thanks for any help you can provide. -- This email has been checked for viruses by AVG. https://www.avg.com