kivy examples (catalog script): set_volume error
Open
twoelz
opened this issue 11 years ago
•
7 comments
kivy examples, with current kivy 1.9.1-dev (Ubuntu daily repository) python 2.7 version (Ubuntu 14.10 64bit)
Running /kivy_examples/demo/kivycatalog/main.py I get:
AttributeError: 'NoneType' object has no attribute 'set_volume'
Full traceback:
[INFO ] [Logger ] Record log in /home/thomas/.kivy/logs/kivy_15-04-04_88.txt
[INFO ] [Kivy ] v1.9.1-dev
[INFO ] [Python ] v2.7.8 (default, Oct 20 2014, 15:05:19)
[GCC 4.9.1]
[INFO ] [Factory ] 173 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_gif, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO ] [Text ] Provider: sdl2
[INFO ] [OSC ] using for socket
[INFO ] [Window ] Provider: sdl2(['window_egl_rpi'] ignored)
[INFO ] [GL ] OpenGL version <4.4.0 NVIDIA 340.76>
[INFO ] [GL ] OpenGL vendor
[INFO ] [GL ] OpenGL renderer <GeForce GTX 760/PCIe/SSE2>
[INFO ] [GL ] OpenGL parsed version: 4, 4
[INFO ] [GL ] Shading version <4.40 NVIDIA via Cg compiler>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <32>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [VideoGstplayer] Using Gstreamer 1.4.3.0
[INFO ] [Video ] Provider: gstplayer
[ERROR ] [Image ] Error reading file ../../widgets/softboy.mpg
[INFO ] [GL ] NPOT texture support is available
[INFO ] [Base ] Start application main loop
[INFO ] [Base ] Leaving application in progress...
Traceback (most recent call last):
File "main.py", line 191, in
KivyCatalogApp().run()
File "/usr/lib/python2.7/dist-packages/kivy/app.py", line 824, in run
runTouchApp()
File "/usr/lib/python2.7/dist-packages/kivy/base.py", line 487, in runTouchApp
EventLoop.window.mainloop()
File "/usr/lib/python2.7/dist-packages/kivy/core/window/window_sdl2.py", line 525, in mainloop
self._mainloop()
File "/usr/lib/python2.7/dist-packages/kivy/core/window/window_sdl2.py", line 290, in _mainloop
EventLoop.idle()
File "/usr/lib/python2.7/dist-packages/kivy/base.py", line 327, in idle
Clock.tick()
File "/usr/lib/python2.7/dist-packages/kivy/clock.py", line 483, in tick
self._process_events()
File "/usr/lib/python2.7/dist-packages/kivy/clock.py", line 615, in _process_events
event.tick(self._last_tick, remove)
File "/usr/lib/python2.7/dist-packages/kivy/clock.py", line 374, in tick
ret = callback(self._dt)
File "/usr/lib/python2.7/dist-packages/kivy/uix/video.py", line 177, in _do_video_load
self._video.play()
File "/usr/lib/python2.7/dist-packages/kivy/core/video/video_gstplayer.py", line 88, in play
self.player.set_volume(self.volume)
AttributeError: 'NoneType' object has no attribute 'set_volume'
tried with stable repository (ppa:kivy-team/kivy) version 1.9.0, same error.
thomas@GryphonBuntu:/usr/share/kivy-examples/demo/kivycatalog$ python main.py
[INFO ] [Logger ] Record log in /home/thomas/.kivy/logs/kivy_15-04-04_102.txt
[INFO ] [Kivy ] v1.9.0
[INFO ] [Python ] v2.7.8 (default, Oct 20 2014, 15:05:19)
[GCC 4.9.1]
[INFO ] [Factory ] 173 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_gif, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO ] [Text ] Provider: sdl2
[INFO ] [OSC ] using for socket
[INFO ] [Window ] Provider: sdl2(['window_egl_rpi'] ignored)
[INFO ] [GL ] OpenGL version <4.4.0 NVIDIA 340.76>
[INFO ] [GL ] OpenGL vendor
[INFO ] [GL ] OpenGL renderer <GeForce GTX 760/PCIe/SSE2>
[INFO ] [GL ] OpenGL parsed version: 4, 4
[INFO ] [GL ] Shading version <4.40 NVIDIA via Cg compiler>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <32>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [VideoGstplayer] Using Gstreamer 1.4.3.0
[INFO ] [Video ] Provider: gstplayer
[ERROR ] [Image ] Error reading file ../../widgets/softboy.mpg
[INFO ] [GL ] NPOT texture support is available
[INFO ] [Base ] Start application main loop
[INFO ] [Base ] Leaving application in progress...
Traceback (most recent call last):
File "main.py", line 191, in
KivyCatalogApp().run()
File "/usr/lib/python2.7/dist-packages/kivy/app.py", line 824, in run
runTouchApp()
File "/usr/lib/python2.7/dist-packages/kivy/base.py", line 487, in runTouchApp
EventLoop.window.mainloop()
File "/usr/lib/python2.7/dist-packages/kivy/core/window/window_sdl2.py", line 525, in mainloop
self._mainloop()
File "/usr/lib/python2.7/dist-packages/kivy/core/window/window_sdl2.py", line 290, in _mainloop
EventLoop.idle()
File "/usr/lib/python2.7/dist-packages/kivy/base.py", line 327, in idle
Clock.tick()
File "/usr/lib/python2.7/dist-packages/kivy/clock.py", line 483, in tick
self._process_events()
File "/usr/lib/python2.7/dist-packages/kivy/clock.py", line 615, in _process_events
event.tick(self._last_tick, remove)
File "/usr/lib/python2.7/dist-packages/kivy/clock.py", line 374, in tick
ret = callback(self._dt)
File "/usr/lib/python2.7/dist-packages/kivy/uix/video.py", line 177, in _do_video_load
self._video.play()
File "/usr/lib/python2.7/dist-packages/kivy/core/video/video_gstplayer.py", line 88, in play
self.player.set_volume(self.volume)
AttributeError: 'NoneType' object has no attribute 'set_volume'
Ok, simple problem: the video file was removed.
../../widgets/softboy.mpg
Not in there anymore. If you add it back, script will work again (tested here).
Thanks,
Thomas
I have recently (sometime this week) installed kivy and have run into this problem trying to use kivycatalog.
I have since yesterdar been looking for a solve here.
Is there some way to solve this from my end? You say that it can be added back, but is the file available somewhere?
I found the file in the "stable" branch, downloaded and added to the widgets folder. The weird thing is that I added the stable kivy ppa (ubuntu), I guess it doesn't use the "stable" branch.
I suppose you can also put any mpg file there and rename it to match softboy.mpg. notice it should not go in the catalog folder, but in the widgets folder.
But I think it is a bug, since the file was removed even though the catalog script won't run if this file is not found. The fix is simple, just put the file back there.
Noobish of me.. didnt think of lookig for the file in githup. Anyway, worked like a charm. Thanks
Duplicate of https://github.com/kivy/kivy/issues/2762.
Workaround:
# Manually copy the file into place, since the package is missing it.
sudo bash
cd /usr/share/kivy-examples/widgets/
wget https://github.com/kivy/kivy/raw/master/examples/widgets/softboy.mpg
exit
# Now launch the demo
python /usr/share/kivy-examples/demo/kivycatalog/main.py
This puts an uncontrolled file softboy.mpg into /usr/share/kivy-examples/demo/ , which is bad sysadmin practice. It will eventually conflict with the package when they fix it. You can just delete the file when you're done playing, or else make a copy of the demo's main.py and edit it to use a copy of softboy.mpg under your $HOME directory.