tarina

git clone https://git.tarina.org/tarina
Log | Files | Refs | README | LICENSE

commit 71625a2f950ffa7612a7920694215828f03cd5ee
parent 7ec608034ce5d437843d7df07876c877095b8f63
Author: rbckman <rbckman@localhost.localdomain>
Date:   Thu, 18 Apr 2019 02:53:42 +0300

play usb soundcard omxplayer

Diffstat:
MVERSION | 2+-
Mtarina.py | 29+++++++++++++++++------------
2 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/VERSION b/VERSION @@ -1,2 +1,2 @@ -0.979 +0.98 Leone diff --git a/tarina.py b/tarina.py @@ -579,6 +579,7 @@ def timelapse(beeps,camera,foldername,filename,tarinafolder): return renderfilename time.sleep(0.0555) if menu[selected] == 'BACK': + writemessage('ok!') return '' time.sleep(0.02) @@ -780,13 +781,13 @@ def playthis(filename, camera): holdbutton = '' camera.stop_preview() writemessage('Starting omxplayer') - player = OMXPlayer(filename + '.mp4', args=['--fps', '25', '--layer', '3', '--win', '0,70,800,410', '--no-osd', '--no-keys']) + player = OMXPlayer(filename + '.mp4', args=['--fps', '25', '--layer', '3', '--win', '0,70,800,410', '--no-osd', '--no-keys', '-o', 'alsa:hw:0,0']) time.sleep(1) try: player.pause() player.set_position(0) player.play() - os.system('aplay -D plughw:0 ' + filename + '.wav &') + #os.system('aplay -D plughw:0 ' + filename + '.wav &') except: print 'something wrong with omxplayer' return @@ -808,20 +809,24 @@ def playthis(filename, camera): elif pressed == 'middle': time.sleep(0.2) if selected == 0 or player.playback_status() == "Stopped": - player.stop() - player.quit() - os.system('pkill aplay') + try: + player.stop() + player.quit() + except: + pass + #os.system('pkill aplay') #os.system('pkill dbus-daemon') #os.system('pkill omxplayer') return elif selected == 1: - player.pause() - player.set_position(0) - os.system('pkill aplay') - #os.system('pkill omxplayer') - time.sleep(1) - player.play() - os.system('aplay -D plughw:0 ' + filename + '.wav &') + try: + player.pause() + player.set_position(0) + time.sleep(1) + player.play() + except: + pass + #os.system('aplay -D plughw:0 ' + filename + '.wav &') starttime = time.time() time.sleep(0.02) t = time.time() - starttime