Spook112
Posts: 1
Joined: Fri Jan 05, 2018 9:00 pm

Switching Onkyo AV Receiver Input via CEC command

Fri Jan 05, 2018 10:58 pm

Hi all,
I want to use a RaspberryPI Zero (OS debian stretch) with cec-client to switch the input "channel" from my Onkyo TX-NR616 from HDMI1 to HDMIx (will say any other HDMI port) .
Using cec-client -l the following output appears:

Code: Select all

[email protected]:~ $ cec-client -l
libCEC version: 4.0.2, git revision: libcec-4.0.2+30-8adc786~dirty, compiled on Mon Aug 21 09:41:41 UTC 2017 by [email protected]: Name or service not known on Linux 4.4.0-92-generic (armv7l), features: P8_USB, DRM, P8_detect, randr, RPi
Found devices: 1

device:              1
com port:            RPI
vendor id:           2708
product id:          1001
firmware version:    1
type:                Raspberry Pi

[email protected]:~ $
and using "echo scan | cec-client -s -d 1" the output is:

Code: Select all

[email protected]:~ $ echo scan | cec-client -s -d 1
opening a connection to the CEC adapter...
requesting CEC bus information ...
ERROR:   [           20230]     failed to request the physical address
ERROR:   [           27511]     failed to request the physical address
ERROR:   [           42022]     failed to request the physical address
CEC bus information
===================
device #0: TV
address:       0.0.0.0
active source: no
vendor:        Unknown
osd string:    TV
CEC version:   1.3a
power status:  on
language:      ???


device #1: Recorder 1
address:       1.5.0.0
active source: no
vendor:        Pulse Eight
osd string:    CECTester
CEC version:   1.4
power status:  on
language:      eng


device #4: Playback 1
address:       f.f.f.f
active source: no
vendor:        Unknown
osd string:    Chromecast
CEC version:   1.4
power status:  on
language:      ???


device #5: Audio
address:       f.f.f.f
active source: no
vendor:        Unknown
osd string:    TX-NR616
CEC version:   unknown
power status:  unknown
language:      ???


device #8: Playback 2
address:       f.f.f.f
active source: no
vendor:        Unknown
osd string:    Playback 2
CEC version:   unknown
power status:  unknown
language:      ???


currently active source: unknown (-1)
[email protected]:~ $
So my conclusion is, that the PI can connect to all other HDMI CEC capable devices in the LAN.
Switching on and off (standby) the TX-NR616 works via

Code: Select all

 $ echo 'standby 5' | cec-client -s RPI

Code: Select all

 $ echo 'on 5' | cec-client -s RPI
even muting works.

Code: Select all

$ echo 'mute 5' | cec-client -s RPI
(strange is, that for "unmute" I have to post the mute command two times then - no idea why that)

But now to the point:
Has anyone an idea how I can switch the HDMI input channel/source of the TX-NR616 via a cec-client command ?

Thanks in advance
Michael

P.S.: I know about the web page http://www.cec-o-matic.com/index.php but didn't get it so far how to switch input channels.

theather
Posts: 1
Joined: Sun Oct 23, 2016 5:43 pm

Re: Switching Onkyo AV Receiver Input via CEC command

Tue Feb 20, 2018 2:42 am

You need something like...

Code: Select all

cho "tx 5f:82:11:00" | cec-client -s
5 -> destination device (Audio)
f-> source device (can be most anything, like 'Recorder 1' or simply Unassigned)
82->select active input command
11:00 -> logical device.

You get logical devices from

Code: Select all

echo scan | cec-client -s -d 1
which returns blocks like:

Code: Select all

device #4: Playback 1
address:       1.1.0.0
active source: no
vendor:        Google
osd string:    Chromecast
CEC version:   1.4
power status:  on
language:      ???
The address for the input is the key... 1.1.0.0. However, you can read this as the first digit is Logical Device 0, that will be probably be your TV. Logical Device 1 is your Amplifier (at least, that's how my system works). For the second digit, its a device input or "input selection" where ports 1 - 4 are the possibly HDMI inputs, and radio tuners are a couple more, and so on. So, you can think about like:

TV
0.0.0.0 = HDMI 1
0.1.0.0 = HDMI 2
0.2.0.0 = HDMI 3
0.3.0.0 = HDMI 4

Audio
1.0.0.0 = Receiver Input 1
1.1.0.0 = Receiver Input 2
1.2.0.0 = Receiver Input 3
1.3.0.0 = Receiver Input 4
1.4.0.0 = Receiver FM Band
1.5.0.0 = Receiver AM Band
... etc.

So, if you have an input that isn't CEC compliant, you can still set the active port on the receiver just by trying various input paths (logical devices). Remember you are using hex, so any value from 0-F is valid, pairs of digits are colon separated.

Return to “Media centres”

Who is online

Users browsing this forum: Google [Bot] and 5 guests