Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libCecTray improvements #5

Closed
peches opened this issue Feb 4, 2014 · 4 comments
Closed

libCecTray improvements #5

peches opened this issue Feb 4, 2014 · 4 comments

Comments

@peches
Copy link

peches commented Feb 4, 2014

One simple request. In XBMC tab there is an option for suspend PC when the TV is off. This option should works with MCE too.
And new option "Wake PC when TV is on" would be handy.
This functions is working perfect in 3rd party tool CECTray from chir21.

@opdenkamp
Copy link
Contributor

Waking the PC when the TV is powered on is not possible, also not with the CECTray application from chir21. The USB-CEC adapter can only wake the PC from standby (S3), and only when you activate the device in your TV's CEC menu or switch sources, with most TVs. This is a feature of the device's firmware.

@peches
Copy link
Author

peches commented Feb 26, 2014

OK, I understand, and what about first improvement - suspend PC when TV is off?

I add this code:

public override int ReceiveCommand(CecCommand command)
{
if (command.Opcode == CecOpcode.Standby && command.Initiator == CecLogicalAddress.Tv)
{

        foreach (var app in _applications)
        {
            CecKeypress key = new CecKeypress();
            key.Keycode = CecUserControlCode.Stop;
            bool keySent = app.SendKey(key, false);
        }

        Application.SetSuspendState(PowerState.Suspend, false, false);
        return 1;
    }
  return 0;
}

and it's working quite good, but I'm not c# developer, and I can't add option/checkbox to turn this function ON/OFF and second option for "only stop playing, when TV is suspended".

I have one more issue: when TV and PC is sleeping, and then, for some reason, PC wakes up (recording or something) there is displayed message "TV pool failed" (I can't remember exactly text of the message) - then I have to quit Cec-tray app and start it again, it's very uncomfortable.

@opdenkamp
Copy link
Contributor

libCECTray will send the PC to standby in the next version, similar to the code that you linked, and the "poll failed" error when resuming from standby will be gone

@mattiasost
Copy link

I thought this task was about supporting "pc standby" without having to run xbmc. How about such an option?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants