Re: QT GUI Label error in v 3.10.1.1

2022-11-28 Thread Jose Ruvalcaba
HI Cinaed and Jeff,

Sorry for the late reply. I checked if I had the qt-6 wayland and xwayland
installed. Turns out I didn't have the qt6-wayland installed so I installed
it. The issue still remained so I disabled wayland and it seemed to work.
Just like what you guys saw, I stopped seeing the issue on my flowgraph.

However, I attempted another flowgraph that used QT GUI Label and the issue
came back. I have added the new flowgraph I created along with its
generated code.

I am working from a WIndows machine that has  a Virtual Machine with Ubuntu
22.04. One quick question though: Where would I set the export
QT_QPA_PLATFORM

Thanks,
Jose Ruvalcaba

On Thu, Nov 24, 2022 at 5:25 PM Cinaed Simson 
wrote:

> Hi Jose - I can run your script for hours without any issues on both GR
> 3.8 and 3.10.
>
> Have you tried setting
>
>   export QT_QPA_PLATFORM=wayland
>
> as indicated in the first error message - to see if the script runs longer
> then 10 minutes?
>
> My guess is if you eliminate the first exception the other exceptions will
> disappear.
>
> Are you working from the console of a linux machine - or are you working
> from the console of a Windows machine - and then connecting to the a Linux
> machine by some method?
>
> -- Cinaed
>
>
> On Tue, Nov 22, 2022 at 10:23 PM Jose Ruvalcaba 
> wrote:
>
> Hello,
>>
>> I've been noticing an issue popping out everytime I stop running my
>> flowgraph and I was wondering if someone had some insight on it. I have a
>> flowgraph where a signal source is connected to a probe signal block. This
>> block is constantly updating values and are being displayed using the QT
>> GUI Label block. However, after running my flowgraph for about 10 minutes I
>> get the following error:
>>
>> *Executing: /usr/bin/python3 -u
>> /home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py*
>>
>> *Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use
>> QT_QPA_PLATFORM=wayland to run on Wayland anyway.*
>>
>> *Exception in thread Thread-1 (_amp_probe):*
>>
>> *Traceback (most recent call last):*
>>
>> *  File
>> "/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py",
>> line 150, in _amp_probe*
>>
>> *self.doc.add_next_tick_callback(functools.partial(self.set_amp,val))*
>>
>> *  File "/usr/lib/python3/dist-packages/gnuradio/gr/hier_block2.py", line
>> 88, in __getattr__*
>>
>> *return getattr(self._impl, name)*
>>
>> *AttributeError: 'gnuradio.gr.gr_python.top_block_pb' object has no
>> attribute 'doc'*
>>
>> *During handling of the above exception, another exception occurred:*
>>
>> *Traceback (most recent call last):*
>>
>> *  File "/usr/lib/python3.10/threading.py", line 1016, in
>> _bootstrap_inner*
>>
>> *self.run()*
>>
>> *  File "/usr/lib/python3.10/threading.py", line 953, in run*
>>
>> *self._target(*self._args, **self._kwargs)*
>>
>> *  File
>> "/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py",
>> line 152, in _amp_probe*
>>
>> *self.set_amp(val)*
>>
>> *  File
>> "/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py",
>> line 182, in set_amp*
>>
>> *self.set_variable_qtgui_label_0(self.amp)*
>>
>> *  File
>> "/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py",
>> line 189, in set_variable_qtgui_label_0*
>>
>> *Qt.QMetaObject.invokeMethod(self._variable_qtgui_label_0_label,
>> "setText", Qt.Q_ARG("QString",
>> str(self._variable_qtgui_label_0_formatter(self.variable_qtgui_label_0*
>>
>> *RuntimeError: wrapped C/C++ object of type QLabel has been deleted*
>>
>>
>> It seems that my issue is related to the QT GUI Label block because when
>> I remove it and add say QT GUI Number sink, this issue doesn't appear.
>>
>> Has anyone experienced this issue? If so, would anyone be able to steer
>> me in the direction to fix it? I am currently running on Ubuntu 22.04 and
>> am running GNU RADIO 3.10.1.1 which I installed using sudo apt-get install.
>> I've also attached the flowgraph I am talking about.
>>
>> Thanks,
>>
>> Jose Ruvalcaba
>>
>
>


pyephem_fspl_test.grc
Description: Binary data
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

#
# SPDX-License-Identifier: GPL-3.0
#
# GNU Radio Python Flow Graph
# Title: Pyephem FSPL v1.0
# Author: spacerfvm
# GNU Radio version: 3.10.1.1

from packaging.version import Version as StrictVersion

if __name__ == '__main__':
import ctypes
import sys
if sys.platform.startswith('linux'):
try:
x11 = ctypes.cdll.LoadLibrary('libX11.so')
x11.XInitThreads()
except:
print("Warning: failed to XInitThreads()")

from PyQt5 import Qt
from gnuradio import eng_notation
from gnuradio import qtgui
from gnuradio.filter import firdes
import sip
from gnuradio import analog
from gnuradio import blocks
from gnuradio import gr
from gnuradio.fft import window
import sys
import signal
from argparse import ArgumentParser
from gnuradio.eng_arg import eng_float, intx
import pyephemfspltest_ep

Re: QT GUI Label error in v 3.10.1.1

2022-11-28 Thread Cinaed Simson

I'd recommend adding

  export QT_QPA_PLATFORM=wayland

to your

  $HOME/.bash_profile

file or your

  $HOME/.bashrc

file - if you feel comfortable editing files on Linux.

I prefer the .bashrc since this were I place all my exports and group 
them all together.


However, the .bashrc isn't as tolerant to errors as the .bash_profile file.

In either case make a backup of the file before you edit the file.

You can check the results after you login again by typing

   echo $QT_QPA_PLATFORM

-- Cinaed


On 11/28/22 13:05, Jose Ruvalcaba wrote:

HI Cinaed and Jeff,

Sorry for the late reply. I checked if I had the qt-6 wayland and 
xwayland installed. Turns out I didn't have the qt6-wayland installed 
so I installed it. The issue still remained so I disabled wayland and 
it seemed to work. Just like what you guys saw, I stopped seeing the 
issue on my flowgraph.


However, I attempted another flowgraph that used QT GUI Label and the 
issue came back. I have added the new flowgraph I created along with 
its generated code.


I am working from a WIndows machine that has  a Virtual Machine with 
Ubuntu 22.04. One quick question though: Where would I set the export 
QT_QPA_PLATFORM


Thanks,
Jose Ruvalcaba

On Thu, Nov 24, 2022 at 5:25 PM Cinaed Simson 
 wrote:


Hi Jose - I can run your script for hours without any issues on
both GR 3.8 and 3.10.

Have you tried setting

  export QT_QPA_PLATFORM=wayland

as indicated in the first error message - to see if the script
runs longer then 10 minutes?

My guess is if you eliminate the first exception the other
exceptions will disappear.

Are you working from the console of a linux machine - or are you
working from the console of a Windows machine - and then
connecting to the a Linux machine by some method?

-- Cinaed


On Tue, Nov 22, 2022 at 10:23 PM Jose Ruvalcaba
 wrote:


Hello,

I've been noticing an issue popping out everytime I stop
running my flowgraph and I was wondering if someone had some
insight on it. I have a flowgraph where a signal source is
connected to a probe signal block. This block is constantly
updating values and are being displayed using the QT GUI
Label block. However, after running my flowgraph for about 10
minutes I get the following error:

*/Executing: /usr/bin/python3 -u
/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py/*

*/
/*

*/Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use
QT_QPA_PLATFORM=wayland to run on Wayland anyway./*

*/Exception in thread Thread-1 (_amp_probe):/*

*/Traceback (most recent call last):/*

*/  File
"/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py",
line 150, in _amp_probe/*

*/self.doc.add_next_tick_callback(functools.partial(self.set_amp,val))/*

*/  File
"/usr/lib/python3/dist-packages/gnuradio/gr/hier_block2.py",
line 88, in __getattr__/*

*/return getattr(self._impl, name)/*

*/AttributeError: 'gnuradio.gr.gr_python.top_block_pb' object
has no attribute 'doc'/*

*/
/*

*/During handling of the above exception, another exception
occurred:/*

*/
/*

*/Traceback (most recent call last):/*

*/  File "/usr/lib/python3.10/threading.py", line 1016, in
_bootstrap_inner/*

*/self.run()/*

*/  File "/usr/lib/python3.10/threading.py", line 953, in run/*

*/self._target(*self._args, **self._kwargs)/*

*/  File
"/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py",
line 152, in _amp_probe/*

*/self.set_amp(val)/*

*/  File
"/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py",
line 182, in set_amp/*

*/self.set_variable_qtgui_label_0(self.amp)/*

*/  File
"/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py",
line 189, in set_variable_qtgui_label_0/*

*/Qt.QMetaObject.invokeMethod(self._variable_qtgui_label_0_label,
"setText", Qt.Q_ARG("QString",

str(self._variable_qtgui_label_0_formatter(self.variable_qtgui_label_0/*

*/RuntimeError: wrapped C/C++ object of type QLabel has been
deleted/*

*//*


It seems that my issue is related to the QT GUI Label block
because when I remove it and add say QT GUI Number sink, this
issue doesn't appear.


Has anyone experienced this issue? If so, would anyone be
able to steer me in the direction to fix it? I am currently
running on Ubuntu 22.04 and am running GNU RADIO 3.10.1.1
which I installed using sudo apt-get install. I've also
attached the flowgraph I am talking about.


Thanks,

Jose Ruvalcaba