-
Notifications
You must be signed in to change notification settings - Fork 41
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
Change HDMI Source on TV (Device 0) #10
Comments
libcec doesn't provide any bindings for changing the input on a specific device. I suspect this is because the CEC standard doesn't specify commands for changing inputs. For my receiver, there are vendor-specific remote keypresses that I can send to change inputs ( |
Thanks for your feednback. Unfortunately on my samsung, pressing the remote control (av input)SOURCE and then NUM3 brings an on-screen error message and only allows the arrows to select the source. There seems to be a CEC command sequence which tells the TV to select an input. I do not know if the TV reacts directly to this command or if one of its sources reacts to the CEC command and selects itself to be the source on the TV. This does actually work when I type in the sequence as a tx command using cec-client. The CEC command for "TV please select HDMI2 as av input" on the bus looks like; This is output by the following libcec code: return Transmit(command, false, bIsReply); Making a binding to this function is probably difficult as the network structure of the C++ classes is quite deep and maybe the initiator may become wrong. If you could implement a binding for a function that gives direct access to Transmit then this could be used to send CEC packets on the bus and bypassing the network structure. Something like a python call cec.transmit("1f822000") Possible implementation in your bindings code cec.cpp: static unsigned char from_hex(char c) static unsigned char from_hex2(char hi, char lo) static PyObject * transmit(PyObject * args) { Thanks again |
If you have suggested code changes, please submit them as a pull request. That said, I recommend a few changes to this before submitting it:
If libcec is already implementing this as part of their |
Hi all, I have the same problem as pimok. My Panasonic TV can be turned on but it chooses the wrong input. It will be set to the correct input, if I send the following command via shell: echo "tx 4f 82 23 00" | cec-client -s I´d like to be able to set the active source via python. It would be great to have a python wrapper for setting the active source! |
The cec-client utility has an "as" command which sets the Pi (or whatever device has the CEC adapter) as the active source. I'd at least like a wrapper for this. |
Hi Voltagex, I tried the "as" command. But It always activate the HDMI1 source. But My the HDMI CEC adapter is connected to HDMI2. Can anyone tell me how to activate the HDMI port of which my device is connected? |
|
As this is based on libcec if Pulse-Eight/libcec#656 is correct, will set_active_source really work? or only for hdmi1?
just work, but
always redirect to hdmi1 |
Thank you for your great work!
Is there an API function, using the current bindings, that lets me select the source to be displayed on the TV?
ActiveSource chooses "self", but I want to be able to tell the TV choose HDMI1, HDMI2 or HDMI3 using the API.
Thanks again.
pimok
The text was updated successfully, but these errors were encountered: