On Friday, 12 February 2021 10:45:46 GMT Keith Edmunds wrote:
> Let us know how you get on.

Well pdb was certainly a help, in that I could single step to the point where 
the MP3 object (mp3_player) was terminated.  At that point pdb was abandoned 
by the software and the Music Player simply started again.

This baffled me for an hour or two, but then I realised that my problem was 
that 
nearly everything I do in this software is interrupt driven.  So when I press 
the 'Stop Music' Button, this sends a message from the Flask App to the Music 
Player software.  This message is retrieved on a regular basis by an interrupt 
raised by apscheduler and the MP3 object is terminated in the function 
mp3_player_stop().  This means of course that once the interrupt is serviced, 
execution is returned to the mp3_player_start() program which is in a while() 
loop and testing to see if the player has terminated, using:

        mp3_wait = mp3_player.wait()
        if not mp3_wait:
            print ('MP3 Player: mpg123 failed:%#x\n' % mp3_wait)

at the end of the loop.  At this point execution goes back to the start of the 
while().

I put a break after the last line above and the program stopped. :-)

However, this only works once at the moment, so I've obviously got a variable 
somewhere that needs cleaning out, but at least I have some tools to help me 
do it.

Thanks Keith for the suggestion.

-- 



                Terry Coles



-- 
  Next meeting: Online, Jitsi, Tuesday, 2021-03-02 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk

Reply via email to