On Mon, 15 Feb 2021 12:53:24 +0000, Terry Coles wrote:
> To me it seems that the software suddenly starts ignoring interrupts

This makes me think the code that handled the previous interrupt might 
still be running. Having the previous interrupt handler still running 
is likely to block further interrupts from being handled.

Taking a look at the code:

mp3_player_start() contains a while loop, and it looks like that is 
not supposed to terminate until playlist_index == 0.

If your interrupt handler calls restartmp3(), and restartmp3() calls 
mp3_player_start(), then the interrupt handler will not terminate 
until playlist_index == 0 and both functions return. So, I think that 
might be the problem.

I don't think you've posted enough code to know for sure, but if this 
is what's going on, then I think I would try having the interrupt 
handler run mp3_player_start() in a new thread. That way, the 
interrupt handler should terminate as soon as it has set the thread 
going, leaving mp3_player_start() to carry on on its own.

e.g.

threading.Thread(target=mp3_player_start).start()


Patrick

-- 
  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