Skip to content
This repository was archived by the owner on Sep 8, 2024. It is now read-only.

Adds a GUI media service to handle audio and video playback for Common Play Service #2952

Closed
wants to merge 2 commits into from

Conversation

AIIX
Copy link
Collaborator

@AIIX AIIX commented Jul 16, 2021

Description

Adds a GUI media service under Audio Services that establishes full media serving capabilities via Mycroft-GUI's media service backend for Common Play Service

  • Supports Audio and Video playback based on Mime Type and Fallback String Checking
  • Supports HTTPS, HTTP, RTSP and Local FILE streams
  • Supports Ducking

Requires: MycroftAI/skill-playback-control#46
Requires: MycroftAI/mycroft-gui#97

How to test

Change the local backend to use "guiplayer" type instead of "simple" in mycroft.conf.

    "Audio": {
    "backends": {
      "local": {
        "type": "guiplayer",
        "active": true
      },
      "vlc": {
        "type": "vlc",
        "active": false,
        "duck": true
      }
    },
    "default-backend": "local"
  • play NPR News
  • play any video type from CPS based skill

Contributor license agreement signed?

CLA [x] (Whether you have signed a CLA - Contributor Licensing Agreement

@devops-mycroft devops-mycroft added the CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) label Jul 16, 2021
@devops-mycroft
Copy link

devops-mycroft commented Jul 16, 2021

Voight Kampff Integration Test Failed (Results).
Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

Comment on lines +99 to +100
LOG.debug("Falling Back To Audio Type")
self.bus.emit(Message("playback.display.audio.type"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what's happening, but using a slightly modified version of Ake's YT Skill, I'm seeing this log message that its falling back to Audio but it then uses the Video player.

I added logs to the handle_display_video and handle_display_audio methods in the control Skill and it somehow is triggering the Video handler.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What type of stream is Ake's YT Skill providing ? Video or Audio ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The debug message was wrong and has been fixed in newer commit

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Ake's YT stream URL consist of "videoplayback" in the URL it will fallback to Video type as that is the only sane and logical way to check if the mime type for those type of streaming links is actually an Video.

@forslund
Copy link
Collaborator

As I recall it would prefer audio streams and fall back to video streams if no pure audio stream existed

@AIIX
Copy link
Collaborator Author

AIIX commented Jul 22, 2021

Extracted streaming links don't exactly end with known type extensions which does not help with mime detection, I rather have CPS tell the audio service what type of stream it is (Audio/Video) than depending solely on mime detection in the Audio Service but I think that is an issue is for another PR not supposed to be blocking this PR

@forslund
Copy link
Collaborator

forslund commented Jul 22, 2021

The audioservice interface supports sending the mimetype already so the skill can inform the audioservice of the type already so should definitely not be a blocker.

Though the handling inside audioservice can definitely be improved

@krisgesling
Copy link
Contributor

Sorry if this is a duplicate comment, I thought I'd already posted this, but can't find it...

It's working well so far, looks like a really solid start. I'm thinking we should add it as a plugin rather than including it in mycroft-core itself. We want to do this with the other Audioservices when we get around to it too. So I've setup a new repo at:
https://github.com/MycroftAI/plugin-playback-gui-player

The docs for audioservice plugins are here:
https://mycroft-ai.gitbook.io/docs/mycroft-technologies/mycroft-core/plugins/audioservice
and definitely shout out if you run into any trouble.

As it is in this PR, it will need to be an "Audioservice" plugin for the moment, but as you can probably tell from the repo name, I think we should revisit that in the near future given we're now handling audio and video.

@JarbasAl
Copy link
Contributor

I'm thinking we should add it as a plugin rather than including it in mycroft-core itself. We want to do this with the other Audioservices when we get around to it too. So I've setup a new repo at:
MycroftAI/plugin-playback-gui-player

The docs for audioservice plugins are here:
mycroft-ai.gitbook.io/docs/mycroft-technologies/mycroft-core/plugins/audioservice
and definitely shout out if you run into any trouble.

audio plugins seem to be broken, see fix here HelloChatterbox/HolmesV@3698485 and example plugin to test with here https://github.com/OpenVoiceOS/ovos-vlc-plugin

JarbasAl added a commit to OpenVoiceOS/ovos-ocp-audio-plugin that referenced this pull request Jul 22, 2021
@krisgesling
Copy link
Contributor

Closing in favour of the new plugin that can be found at: https://github.com/MycroftAI/plugin-playback-gui-player

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants