reginaneon / AVmusic

Provides the video/audio playback of music requested by the user.
3 stars 3 forks source link

On my pycroft, I am getting this error... #4

Open neil969 opened 5 years ago

neil969 commented 5 years ago

It never plays anything.. Note that: 1) "AVPLAY blah" doesn't seem to work now, but "avmusic blah" does ( but gets this error after Mycroft asks "shall I play it now?" and I say "yes" 2) The URL in the error below always points to the previous play list I asked for, not teh one that generated the current error : ) - so I say "avmusic XYZ" , and it errors, then I say "avmusic ABC" and it errors, but the URL in the errors now is the one for the XYZ playlist, and so on..

Any ideas?

error form the voicelog below. 22:36:54.928 - mycroft.skills.core:wrapper:895 - ERROR - An error occurred while processing a request in A Vmusic Skill Traceback (most recent call last): File "/home/pi/mycroft-core/mycroft/skills/core.py", line 886, in wrapper handler(message) File "/opt/mycroft/skills/avmusic.reginaneon/init.py", line 76, in handle_playnow_intent self.process = check_call(["mpv", self.vid], stdout=DEVNULL, stderr=STDOUT) File "/usr/lib/python3.5/subprocess.py", line 271, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['mpv', 'http://www.youtube.com//watch?v=IVzyErnSnFI&list=PLni6pcFJkL35nzbh61MBpR0Y3Ex-5WKK-']' returned non-zero exit status 2 ^--- NEWEST ---^

rerunner commented 5 years ago

I had the same, and for issue #2 it seems the following check in init.py does not work as intended:

if d_hw == 'pi': self.process = check_call(["mpv", "--vid=no", self.vid], stdout=DEVNULL, stderr=STDOUT) else: self.process = check_call(["mpv", self.vid], stdout=DEVNULL, stderr=STDOUT)

I does not detect that it is running on a pi, and it tries to play with video (which fails because mpv will try to use SDL_Video and fail). A quick hack can be to remove the if .. else lines and to replace it with just:

self.process = check_call(["mpv", "--vid=no", self.vid], stdout=DEVNULL, stderr=STDOUT)

By the way, in my case I wrote:

self.process = check_call(["mpv", "--no-video", self.vid], stdout=DEVNULL, stderr=STDOUT)

That works for me.

neil969 commented 5 years ago

Interesting rerun :) Can I just change that code on the Pi? where would it be? Sorry if that is a stupid question... LOL

Edit - Found it in /opt/mycroft... now to see if I can make it explode with my lack of skill. Edit2 - Well that worked..but now it wont "STOP!" .. it keeps going and ignores the stop command even if I type it in the cli .. from one extreme to the other :)

rerunner commented 5 years ago

Indeed, there are still many issues. The "stop"can be made working by changing the "check_call" with "Popen", in the same line.

I ended up not using this skill as it is, but instead I used the code from @penrods, who forked this skill and made extensive changes. See:

https://github.com/penrods/AVmusic

His work to integrate the AVMusic player with the standard "play" command allows me to just call e.g. "play Bruno Mars", and it works well.

neil969 commented 5 years ago

thanks, I'll have a peek ;) You know I am going to have to look up "Bruno Mars" now :)