xuancong84 / pikaraoke

The World's best open-source Home Karaoke system (support searching/downloading from Youtube and DNN-AI-based vocal/nonvocal sound separation), multilingual and cross-platform
GNU General Public License v3.0
50 stars 6 forks source link

Pygame Error in karaoke.py when trying to start "video system not initialized" #14

Open Romeo1984 opened 1 year ago

Romeo1984 commented 1 year ago

Setup: Pi4 Bullseye 64 non-desktop OS (updated) Miniconda 4.9.2 ARCH 64 (not updated - I did update it in an earlier install, but it broke the HTTP packet retrieval, so I re-stalled it) Running from SSH:

 (base) pi@pikaraoke:~/pikaraoke $ sudo env PATH=~/miniconda3/bin:$PATH python3 app.py
pygame 2.3.0 (SDL 2.24.2, Python 3.9.1)
Hello from the pygame community. https://www.pygame.org/contribute.html
Creating download path: /root/pikaraoke-songs/
[2023-04-15 20:08:47] INFO: Fetching available songs in: /root/pikaraoke-songs/
[2023-04-15 20:08:48] INFO: VLC command base: /usr/bin/cvlc --fullscreen --play-and-exit --extraintf http --http-port 5002 --http-password 0SnYjziR6aK5EWxYsT39SNaftkQQ4DBq --no-embedded-video --no-keyboard-events --no-mouse-events --video-on-top --volume-save --no-video-title --no-loop --no-repeat --mouse-hide-timeout 0 --intf dummy
Traceback (most recent call last):
  File "/home/pi/pikaraoke/app.py", line 967, in <module>
    K = karaoke.Karaoke(args)
  File "/home/pi/pikaraoke/karaoke.py", line 189, in __init__
    self.initialize_screen(not args.windowed)
  File "/home/pi/pikaraoke/karaoke.py", line 278, in initialize_screen
    pygame.mouse.set_visible(0)
pygame.error: video system not initialized

I did a search and didn't find any obvious fixes.

Romeo1984 commented 1 year ago

Update - I just rebuilt the system based on Ubuntu 22.04.2 64-bit LTS and got the same error.

Romeo1984 commented 1 year ago

Making progress. I actually got app.py to start successfully by installing and starting with xvfb-run to give pygame a virtual frame buffer. The QR Code screen has no real video to output to, BUT I was successful in playing an MP4 file with VLC to the standard video out. I now need to figure out how to properly initialize the real video out for pygame.

pygame 2.3.0 (SDL 2.24.2, Python 3.9.1)
Hello from the pygame community. https://www.pygame.org/contribute.html
[2023-04-24 16:00:51] INFO: Fetching available songs in: /root/pikaraoke-songs/
[2023-04-24 16:00:52] INFO: VLC command base: /usr/bin/cvlc --fullscreen --play-and-exit --extraintf http --http-port 5002 --http-password wyUhPezRqUdpxsHA7yrJ7IAbufdWxyRE --no-embedded-video --no-keyboard-events --no-mouse-events --video-on-top --volume-save --no-video-title --no-loop --no-repeat --mouse-hide-timeout 0 --intf dummy
[24/Apr/2023:16:00:54] ENGINE Bus STARTING
[2023-04-24 16:00:54] INFO: [24/Apr/2023:16:00:54] ENGINE Bus STARTING
[24/Apr/2023:16:00:54] ENGINE Started monitor thread '_TimeoutMonitor'.
[2023-04-24 16:00:54] INFO: [24/Apr/2023:16:00:54] ENGINE Started monitor thread '_TimeoutMonitor'.
[24/Apr/2023:16:00:54] ENGINE Serving on http://0.0.0.0:5000
[2023-04-24 16:00:54] INFO: [24/Apr/2023:16:00:54] ENGINE Serving on http://0.0.0.0:5000
[24/Apr/2023:16:00:54] ENGINE Bus STARTED
[2023-04-24 16:00:54] INFO: [24/Apr/2023:16:00:54] ENGINE Bus STARTED
[2023-04-24 16:00:54] INFO: Starting PiKaraoke!
[2023-04-24 16:04:13] INFO: Searching YouTube for: bon jovi karaoke
[2023-04-24 16:04:19] INFO: Downloading video: https://www.youtube.com/watch?v=Ep6G3P2v5ZA
[youtube] Extracting URL: https://www.youtube.com/watch?v=Ep6G3P2v5ZA
[youtube] Ep6G3P2v5ZA: Downloading webpage
[youtube] Ep6G3P2v5ZA: Downloading android player API JSON
[info] Ep6G3P2v5ZA: Downloading 1 format(s): 22
[download] Destination: /root/pikaraoke-songs/tmp/Bon Jovi - Livin' On A Prayer (Karaoke Version)---Ep6G3P2v5ZA.mp4
[download] 100% of    6.25MiB in 00:00:03 at 1.79MiB/s
[VideoRemuxer] Not remuxing media file "/root/pikaraoke-songs/tmp/Bon Jovi - Livin' On A Prayer (Karaoke Version)---Ep6G3P2v5ZA.mp4"; already is in target format mp4
[2023-04-24 16:04:25] INFO: Fetching available songs in: /root/pikaraoke-songs/
[2023-04-24 16:04:25] INFO: 'Mark' is adding song to queue: /root/pikaraoke-songs/Bon Jovi - Livin' On A Prayer (Karaoke Version)---Ep6G3P2v5ZA.mp4
[2023-04-24 16:04:29] INFO: Playing video in VLC: /root/pikaraoke-songs/Bon Jovi - Livin' On A Prayer (Karaoke Version)---Ep6G3P2v5ZA.mp4
[2023-04-24 16:04:29] INFO: VLC Command: ['/usr/bin/cvlc', '--fullscreen', '--play-and-exit', '--extraintf', 'http', '--http-port', '5002', '--http-password', 'wyUhPezRqUdpxsHA7yrJ7IAbufdWxyRE', '--no-embedded-video', '--no-keyboard-events', '--no-mouse-events', '--video-on-top', '--volume-save', '--no-video-title', '--no-loop', '--no-repeat', '--mouse-hide-timeout', '0', '--intf', 'dummy', '--drawable-xid', '0x20000b', '--sub-track=0', "/root/pikaraoke-songs/Bon Jovi - Livin' On A Prayer (Karaoke Version)---Ep6G3P2v5ZA.mp4"]
VLC media player 3.0.18 Vetinari (revision 3.0.13-8-g41878ff4f2)
[0000005572642000] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[00000055726a9820] dbus interface error: Failed to connect to the D-Bus session daemon: /usr/bin/dbus-launch terminated abnormally without any error message
[00000055726a9820] main interface error: no suitable interface module
[00000055725b05c0] main libvlc error: interface "dbus,none" initialization failed
[2023-04-24 16:04:29] ERROR: No active VLC process. Could not run command:
[00000055726a9820] [http] lua interface: Lua HTTP interface
[000000557266c0b0] dummy interface: using the dummy interface module...
[0000007f94c99620] dbus_screensaver inhibit error: cannot connect to session bus: /usr/bin/dbus-launch terminated abnormally without any error message
[0000007f80001b70] mmal_xsplitter vout display error: Failed to open Xsplitter:opengles2 module
[0000007f80001b70] mmal_xsplitter vout display error: Failed to open Xsplitter:mmal_vout module
[0000007f80001b70] mmal_xsplitter vout display: Try drm
[0000007f8007b850] drm_vout generic: <<< OpenDrmVout: Fmt=DPV0
[0000007f8007b850] drm_vout generic error: create_lease failed: Xerror 8
[0000007f8007b850] drm_vout generic error: Failed to get xlease
[0000007f94c39230] avcodec decoder: Using DRM Video Accel for hardware decoding
[2023-04-24 16:06:20] INFO: Skipping: Bon Jovi - Livin' On A Prayer (Karaoke Version)
[000000557263fa50] main playlist: end of playlist, exiting
[2023-04-24 16:06:22] ERROR: No active VLC process. Could not run command: