Simaltaneous clocks

44 views
Skip to first unread message

Leon A

unread,
Oct 30, 2014, 5:44:06 PM10/30/14
to kivy-...@googlegroups.com
I think I am misunderstanding the clock.

I can run one function just fine which updates a Label.

I am calling the recorder from android with Pyjnius 
with another clock schedule at the same time. 

This does not work both functions seem to be out of sink.

So I tried using threading to call the recorder function and 
it works in perfect sink but crashes when finished. This is
because when accessing the java classes the thread does not 
detach. 

Can I successfully implement this with Kivy Clock? 

This is the code without the recorder function using Pyjnius: http://pastebin.com/gSPvqQ67


Any help would be great thank you. 

Bruce Cropley

unread,
Oct 31, 2014, 4:24:20 AM10/31/14
to kivy-...@googlegroups.com
         disabled: durationSwitch.active == False

This line is doing a comparison, not an assignment

Leon A

unread,
Oct 31, 2014, 4:41:30 PM10/31/14
to kivy-...@googlegroups.com
Thank you.

The code in this section works exactly as I want to.

Is there anybody who has a solution for my issue?

I am playing around with python signal alarm to see if i can get around it.

Thanks again.

Leon A

unread,
Oct 31, 2014, 6:38:26 PM10/31/14
to kivy-...@googlegroups.com
Surely I am just using the clock wrong.

I have a button:
            on_press: root.call_lbl_update(), root.start_recording_audio()

both functions schedule clock.
the label update is scheduled every second so Clock.schedule_interval(call_lbl_update, 1)
the recorder is called once Clock.schedule_once(start_recording_audio)

I have tried just using he recorder function without the clock and with time.sleep()
the app does not crash but the recorder is called first finishes and then  the label updates
so totally out of sink.

Any clues guys and girls?

Bruce Cropley

unread,
Nov 1, 2014, 3:08:39 AM11/1/14
to kivy-...@googlegroups.com

Sorry about my first reply, I wasn't thinking straight. I'm not sure what the problem is exactly, but it seems like you are having problems using multithreading with kivy?

Can the code you pasted originally be used to trigger the problem?

Anyway, this might help you, I don't know...

https://github.com/kivy/kivy/wiki/Working-with-Python-threads-inside-a-Kivy-application

Good luck :)

Reply all
Reply to author
Forward
0 new messages