KenT2 / pipresents-kms

Stable version of Pi Presents running on Legacy RPi OS Bullseye
https://pipresents.wordpress.com
Other
14 stars 3 forks source link

Subshow not ending properly via show timeout #1

Open xad001x0w opened 1 year ago

xad001x0w commented 1 year ago

I think I've come across a bug in the method being used to return from a subshow, see code snippet here:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.9/tkinter/__init__.py", line 1892, in __call__
    return self.func(*args)
  File "/usr/lib/python3.9/tkinter/__init__.py", line 814, in callit
    func(*args)
  File "/home/pi/pipresents/pp_gapshow.py", line 318, in show_timeout_stop
    Show.base_show_timeout_stop(self)
  File "/home/pi/pipresents/pp_show.py", line 590, in base_show_timeout_stop
    self.end('normal','stopped by Show Timeout')
  File "/home/pi/pipresents/pp_gapshow.py", line 810, in end
    Show.base_end(self,reason,message)
  File "/home/pi/pipresents/pp_show.py", line 504, in base_end
    self.end_callback(self.show_id,reason,message)
  File "/home/pi/pipresents/pp_gapshow.py", line 421, in end_shower
    Show.base_end_shower(self)
  File "/home/pi/pipresents/pp_show.py", line 362, in base_end_shower
    self.previous_shower,self.current_player=self.shower.base_subshow_ended_callback()
AttributeError: 'NoneType' object has no attribute 'base_subshow_ended_callback'

For context I am trying to build a show where a user can press "button A" to hear a randomly chosen question and then after they've heard the question "button B" allows them to hear the answer.

I have this working with a master mediashow with tracks consisting of more media shows. The issue I have is that trying to use the Show Timeout on these subshows (to return to the master show after a while if "button B" is not pressed) is causing errors to be spat out to the console and on the canvas the two shows are visually overlapping (I'm not actually using a display but I have text there for my own testing purposes so I know where I am within the big stack of shows)

KenT2 commented 1 year ago

I have tried to create a profile that causes the error but have failed even though the offending line is executed. Could you provide an example profile either here, or by contacting me on pipresents.wordpress.com so I can give you an email address. If here zip up the profile and add .text e.g. myprofile.zip.txt

xad001x0w commented 1 year ago

ppsubshowprofile.zip.txt

Attached profile here for you. I must admit though that since opening the issue I've had to deliver this project along with the Pi running it and this is just my backup of the profile that was deployed. As such this profile does not use show timeout as I just skipped on that in order to deliver on time. I also use GPIO in this profile but the issue was occurring before I had had a chance to set up the gpio.cfg. I had been doing basic testing using pp-up & pp-down input commands as opposed to those GPIO inputs currently in the profile.

Also, since the Pi supply issues following the pandemic, I had to dedicate my testing pi to another project and therefore as it stands I don't actually have a machine immediately handy to fire up PP on and try and recreate the error again myself. However I was reliably getting the error in the console and overlapping notice text inside the PP window when returning from the "riddle" subshows to the primary mediashow show via show timeout.

Happy to give more information if needed.

KenT2 commented 1 year ago

Thanks, I have recreated the bug both the crash and the overwriting (non-deletion) of the text. Its going to take some head scratching to fix it :-(

KenT2 commented 1 year ago

Version 1.5.3d fixes (or works around) the crash. Fixing the non-deletion of the text is not fixed. It happens only when show timeout is used.