Categories
Raspberry-pi

(Cyp AU-1HARC) Arc audio exctractor, can Power On other devices in presence of hdmi signal

This is a way to power On other devices if our hdmi audio extractor feel presence of hdmi signal from SmarTv.
Cyp Au-1harc is great to be connected out directly at power amplifier, because it have builted-in a volume control drived from remote of SmarTV.

The quality of the audio of this Hdmi arc extractor is very excellent and the noise level at out is very low.
It have on board a “8051” series microcontroller and others IC’s  as Dac and audio equalizer… in conclusion it is very complete, but not too cheap.

The focus of this project is to parse the onboard serial uart to snatch messages about signal presence of hdmi arc input, but for first pinout of the Serial connector on the board:

The serial connector is near to RCA output and pinout how in photo is :

1) Not connected
2) Gnd
3) TX
4) RX

To connect at it you can use Putty or others and comunication settings  are 19200, 8N1.

If you listen with putty you can see bootup and shutdown operation of arc extractor:

CECRX: System audio mode request
CEC: [ST] 05 [OP] 70 [PA] 00 [PA] 00
sInitCEC()
Format Detect=0x84
Interrupt Status=0x52
ecc . . .
and finally:
CECTX: Set System Audio Mode is On

This sequence is for startup.
while for shutdown im locked on this message:

CECRX: Syatem Standby

Syatem is not my error but an error of Cyp company 🙂 🙂

Ok, at now im used a raspberry pi-zero for capture above message and turn On or Off a GpIo (20) and a led for system status (21).

For Parsing i’ve used Nodered, in the follow javascript code to copy and paste:

[{"id":"f868a3ba.405e1","type":"exec","z":"a42f1d0d.91f71","command":"python /home/pi/on.py","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":760,"y":220,"wires":[[],[],[]]},{"id":"800ef97a.7de288","type":"serial in","z":"a42f1d0d.91f71","name":"Arc","serial":"3b34f3d7.4f3bdc","x":110,"y":260,"wires":[["44db5fb9.a15ef","ca8602a0.26407","9f234fd.b6135b"]]},{"id":"44db5fb9.a15ef","type":"string","z":"a42f1d0d.91f71","name":"Parse Power ON","methods":[{"name":"contains","params":[{"type":"str","value":"CECTX: Set System Audio Mode is On"}]}],"prop":"payload","propout":"payload","object":"msg","objectout":"msg","x":330,"y":240,"wires":[["b6160a27.5ffcb8"]]},{"id":"ca8602a0.26407","type":"string","z":"a42f1d0d.91f71","name":"Parse Power OFF","methods":[{"name":"contains","params":[{"type":"str","value":"CECRX: Syatem Standby"}]}],"prop":"payload","propout":"payload","object":"msg","objectout":"msg","x":330,"y":280,"wires":[["fc40998f.1b3478"]]},{"id":"d3c81e26.df6a3","type":"exec","z":"a42f1d0d.91f71","command":"python /home/pi/off.py","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":760,"y":300,"wires":[[],[],[]]},{"id":"b6160a27.5ffcb8","type":"switch","z":"a42f1d0d.91f71","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":530,"y":240,"wires":[["f868a3ba.405e1"]]},{"id":"fc40998f.1b3478","type":"switch","z":"a42f1d0d.91f71","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":530,"y":280,"wires":[["d3c81e26.df6a3"]]},{"id":"9f234fd.b6135b","type":"debug","z":"a42f1d0d.91f71","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":340,"y":120,"wires":[]},{"id":"3b34f3d7.4f3bdc","type":"serial-port","z":"","serialport":"/dev/ttyS0","serialbaud":"19200","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":false,"responsetimeout":"10000"}]
While in the follow on.py and off.py code:
on.py:

import os
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
pw = 20
led = 21
#GPIO.setup(porta, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(pw, GPIO.OUT)
GPIO.setup(led, GPIO.OUT)
GPIO.output(led, True)
time.sleep(.1)
GPIO.output(led, False)
time.sleep(.1)
GPIO.output(led, True)
time.sleep(.1)
GPIO.output(led, False)
time.sleep(.1)
GPIO.output(led, True)
time.sleep(.1)
GPIO.output(led, False)
time.sleep(.1)
GPIO.output(led, True)
time.sleep(.1)
GPIO.output(led, False)
time.sleep(.1)
GPIO.output(led, True)
time.sleep(.1)
GPIO.output(led, False)
time.sleep(.1)
GPIO.output(led, True)
time.sleep(.1)
GPIO.output(led, False)
time.sleep(.1)
GPIO.output(led, True)
time.sleep(.1)
GPIO.output(led, False)
time.sleep(.1)
GPIO.output(led, True)
time.sleep(.1)
GPIO.output(led, False)
time.sleep(.1)
GPIO.output(led, True)
time.sleep(.1)
GPIO.output(pw, True)
time.sleep(.5)
and off.py:

import os
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
pw = 20
led = 21
GPIO.setup(pw, GPIO.OUT)
GPIO.setup(led, GPIO.OUT)
GPIO.output(led, False)
time.sleep(.5)
GPIO.output(pw, False)
time.sleep(.5)

This is the result, enjoy:

Leave a Reply

Your email address will not be published. Required fields are marked *