Dang Keith, you&#39;re Good..<br><br>--<br><br><div class="gmail_quote">On Wed, Jan 7, 2009 at 3:30 PM,  <span dir="ltr">&lt;<a href="mailto:krwatson@cc.gatech.edu">krwatson@cc.gatech.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I did some hardware hacking last night on my Tivax STB-T8 ATSC to NTSC converter box serial interface. So what has this to do with Linux you might ask. The goal is to control my new found miracle of modern electronics with a Linux workstation.<br>

<br>
I have to use the converter to receive digital TV so I can&#39;t program my NTSC VCR to change channels anymore. The solution is to control the converter with a computer. I could use an IR blaster but where&#39;s the fun in that.<br>

<br>
Here is what I&#39;ve uncovered so far:<br>
<br>
NOTE: The manufacturer warns that using the serial interface voids your warranty.<br>
<br>
<br>
What is the serial connector for?<br>
<br>
The serial connector is for uploading software by the factory. No, at this time there are no plans to make new software available to consumers.<br>
<br>
The connector can also be used for controlling the unit with a PC. Baudrate is 115kb. &nbsp;Use the command &quot;zir&quot; to issue cmds. &nbsp;This interface is not supported. &nbsp;Do not ask questions what does this or that do. Use of this port voids any warranty.<br>

<br>
<a href="https://shop.tivax.com/faq/index.php?action=artikel&amp;cat=1&amp;id=42&amp;artlang=en" target="_blank">https://shop.tivax.com/faq/index.php?action=artikel&amp;cat=1&amp;id=42&amp;artlang=en</a><br>
<br>
<br>
Of course my response is one or both of the following:<br>
<br>
Your Motto: If it ain&#39;t broke, take it apart and fix it.<br>
<a href="http://www.thinkgeek.com/interests/techies/8f52/" target="_blank">http://www.thinkgeek.com/interests/techies/8f52/</a><br>
<br>
<br>
Joss Whedon Serenity Browncoat/I Aim To Misbehave T-Shirt<br>
<a href="http://www.amazon.com/Whedon-Serenity-Browncoat-Misbehave-T-Shirt/dp/B000TYFDU4" target="_blank">http://www.amazon.com/Whedon-Serenity-Browncoat-Misbehave-T-Shirt/dp/B000TYFDU4</a><br>
<br>
<a href="http://tinyurl.com/2llnny" target="_blank">http://tinyurl.com/2llnny</a><br>
<br>
<br>
Enough frivolity and on with the hardware hacking.<br>
<br>
The manufacturer web page above is the only hint given on how to use the serial port but it&#39;s all I need (Thank you Tivax).<br>
<br>
I used two standard PC 9 pin female to 25 ping male serial cables connected with a break out box so I could swap pins around. I ended up having to cross connect pins 2 &amp; 3.<br>
<br>
I configured my PC serial port for:<br>
<br>
115200 baud<br>
8 data bits<br>
No parity<br>
1 stop bit<br>
XON/XOFF flow control<br>
<br>
I suspect this is not the correct pin out. At this baud rate I would expect it to use hardware flow control. But it was good enough to talk to the converter.<br>
<br>
Once I was connected I typed in zir&lt;return&gt; which resulted in the following:<br>
<br>
Usage: zir [key]<br>
<br>
key:<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;menu (menu)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit (exit from menu)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;v- (volume down)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;v+ (volume up)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p+ (program up)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p- (program down)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sel (select/enter)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mute (mute)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;up (up)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dn (down)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; l (left)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; r (right)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;last (last channel)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pow (power)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;info (information)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Guide (Guide)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Last (Last Channel)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Aspect (aspect ratio)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Text (-)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cc (subtitle)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Audio (Audio)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Signal (signal strength)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AudioLR (Audio LR)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Fav+ (Fav Up)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Fav- (Fav Down)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Freeze (Freeze)<br>
ZMon&gt;<br>
<br>
<br>
I&#39;ll get to what the options mean in a minute but I must note that the ZMon prompt is significant. Apparently the unit is now in monitor mode. This means that the converter is constantly spewing all manner of information about the state of the currently viewed station. The worse the reception (it was very windy last night so it was more than my bowtie antenna could handle) the more information gets spewed. Here&#39;s a sampling:<br>

<br>
handleZtvClosedCaptionRegister :ccType=3,serviceType=64<br>
doPSIChange : Warning - unable to match audio language 0x0<br>
 &nbsp;Defaulting to first audio stream<br>
doPSIChange : ignored<br>
Warning: Video channel (VBV) buffer underflow<br>
Last message repeated 3 times<br>
Warning: ClearTLVideoBuffer nrdnt2 not configured<br>
has708=0, has608=1, t708=17202510, t608=17202535<br>
cbTimeoutUnmuteTimer : Unmute<br>
Warning: ClearTLVideoBuffer nrdnt2 not configured<br>
Last message repeated 4 times<br>
Warning: Video channel (VBV) buffer underflow<br>
TLCtrlArraySave: Saving backup 550 in slot 3 succ<br>
Invalid FSCOD<br>
AC3 sync word not found<br>
AC3 sync word not found<br>
AC3 sync word not found<br>
has708=1, has608=1, t708=17204174, t608=17204172<br>
AC3 sync word not found<br>
has708=0, has608=1, t708=17204174, t608=17204764<br>
AC3 sync word not found<br>
new key 0x70<br>
new key 0x70<br>
has708=1, has608=1, t708=17206526, t608=17206526<br>
has708=0, has608=1, t708=17206526, t608=17207129<br>
AC3 sync word not found<br>
AC3 sync word not found<br>
Invalid FRMSIZECOD<br>
AC3 sync word not found<br>
AC3 sync word not found<br>
AC3 sync word not found<br>
AC3 sync word not found<br>
symInvalid FRMSIZECOD<br>
<br>
So far I have not figured out how to tell it to stop monitoring.<br>
<br>
Here is what the zir options mean.<br>
<br>
menu (menu) (the same as pressing the menu button on the remote)<br>
exit (exit from menu) (the same as pressing the exit button on the remote)<br>
v- (volume down) (the same as pressing the volume up button on the remote)<br>
v+ (volume up) (the same as pressing the volume down button on the remote)<br>
p+ (program up) (the same as pressing the channel up button on the remote)<br>
p- (program down) (the same as pressing the channel down button on the remote)<br>
sel (select/enter) (the same as pressing the OK button on the remote)<br>
mute (mute) (the same as pressing the mute button on the remote)<br>
up (up) (the same as pressing the up arrow button on the remote)<br>
dn (down) (the same as pressing the down arrow button on the remote)<br>
l (left) (the same as pressing the left arrow button on the remote)<br>
r (right) (the same as pressing the right arrow button on the remote)<br>
last (last channel) (haven&#39;t tested this yet)<br>
pow (power) (the same as pressing the standby button on the remote)<br>
info (information) (the same as pressing the info button on the remote)<br>
Guide (Guide) (the same as pressing the guide button on the remote)<br>
Last (Last Channel) (haven&#39;t tested this yet)<br>
Aspect (aspect ratio) (the same as pressing the aspect button on the remote)<br>
Text (-)(this brings up the channel identifier)<br>
cc (subtitle) (the same as pressing the caption button on the remote)<br>
Audio (Audio) (the same as pressing the audio button on the remote)<br>
Signal (signal strength) (the same as pressing the signal button on the remote)<br>
AudioLR (Audio LR) (haven&#39;t tested this yet)<br>
Fav+ (Fav Up) (haven&#39;t tested this yet)<br>
Fav- (Fav Down) (haven&#39;t tested this yet)<br>
Freeze (Freeze) (haven&#39;t tested this yet)<br>
<br>
<br>
I also figured out why they think using the serial port voids the warranty. You are talking directly to the hardware so it is possible to trash the configuration of the box. Be very, very carful what you type. What may look like gibberish to you could be a command to the box. To see all the commands type help&lt;enter&gt;. (see attachment help.txt)<br>

<br>
<br>
Of course I noticed the &quot;help all&quot; so the output is in the attachment help_all.txt.<br>
<br>
<br>
I did a bit more poking around but I was unable to find out how to tune to a specific channel. However I did find some useful tid bits.<br>
<br>
In the help it mentioned:<br>
<br>
 &nbsp; padnum - the padnumber of the pin to configure (see beetle_pad_xxxx.xls)<br>
 &nbsp; SDCard &nbsp; &nbsp; - Test SD card initialization process<br>
<br>
<br>
The vidinfo command produced the following:<br>
<br>
ContextSettings - Digital Beetle_420<br>
Display : 720 x 484 I 60Hz- All Formats 4:3 (narrow)<br>
Context : 352 x 480 I @ 29.970030hz (narrow)<br>
ROI &nbsp; &nbsp; : [0 16 352 448] max[0 0 1920 1088]<br>
position: [0 0 720 480] max[0 0 1920 1088]<br>
hScale=2.045455 vRawScale=1.071429 vScale=1.071429<br>
contextFieldTimes=2 extraDelay=2997 invertFieldDecode=0<br>
tcfactor=22.603842 writeback=0 deinterlace=0<br>
bufferModel=Inline mceSize=2 low_delay=0<br>
<br>
<br>
<br>
I then did something (not sure what, maybe the config command) that resulted in the attachment possible_config_data.txt. Here are just a few of the interesting morsels:<br>
<br>
#line 1 &quot;../generated/../config/chip/740REVB<br>
<br>
;; configuration switches<br>
<br>
;; $DateTime: 2007/01/23 17:12:10 $<br>
<br>
;; $Author: pryush.sharma $<br>
<br>
#line 1 &quot;../generated/../config/chip/CONFIGBASE&quot;<br>
<br>
;; Copyright (C) 1997-2004 Zoran Corporation.<br>
<br>
;; $Id: //suprahd/customers/PROJECT17/config/chip/740REVB#1 $<br>
<br>
option COMMON_TARGET_ENDIAN_BIG 2<br>
option COMMON_TARGET_ENDIAN_LITTLE 1<br>
<br>
option BEETLE_CHIP_640 0<br>
option BEETLE_CHIP_660 1<br>
option BEETLE_CHIP_680 2<br>
<br>
option BEETLE_REV_A 10<br>
option BEETLE_REV_B 11<br>
option BEETLE_REV_FPGA 0<br>
<br>
option CLK_166MHZ 2<br>
option CLK_200MHZ 3<br>
option CLK_55MHZ 1<br>
<br>
#line 1 &quot;../generated/../config/platform/../../config/platform/740LEOPARD_CONVBOX&quot;<br>
<br>
<br>
I need to do some Googling. I&#39;m going to see if I can find a programming manual for the chips that are being used. I&#39;ll start with strings in the dumps and if I have to I&#39;ll pop the case and get a parts list.<br>

<br>
<br>
Here&#39;s the results of the ident command:<br>
<br>
$TLVersion: customers/PROJECT17/70186 7.40-24_20080728_Michley REVB_MTC_THOMSON_OGENERIC$<br>
/*<br>
&nbsp;* ident - version identification<br>
&nbsp;*<br>
&nbsp;* Copyright (C) 1997-2004 Zoran Corporation.<br>
&nbsp;* All Rights Reserved<br>
&nbsp;*<br>
&nbsp;* $Id: //suprahd/customers/PROJECT17/ident#219 $<br>
&nbsp;* $Revision: #219 $<br>
&nbsp;* $DateTime: 2007/11/14 00:22:44 $<br>
&nbsp;* $Change: 70201 $<br>
&nbsp;* $Author: dtvswbld $<br>
&nbsp;*/<br>
<br>
#define TL_BUILD_VERSION &quot;customers/PROJECT17/70186&quot;<br>
<br>
/*<br>
&nbsp;* RELEASE - release identification<br>
&nbsp;*<br>
&nbsp;* Copyright (C) 1997-2004 Zoran Corporation.<br>
&nbsp;* All Rights Reserved<br>
&nbsp;*<br>
&nbsp;* $Id: //suprahd/customers/PROJECT17/RELEASE#15 $<br>
&nbsp;* $Revision: #15 $<br>
&nbsp;* $DateTime: 2007-12-13 14:24 $<br>
&nbsp;* $Change: 61847 $<br>
&nbsp;* $Author: catherine.lee $<br>
&nbsp;*/<br>
<br>
//#define TL_RELEASE_VERSION &quot;7.40-24_20080228_Michley&quot;<br>
#define TL_RELEASE_VERSION &quot;7.40-24_20080728_Michley&quot;<br>
<br>
<br>
<br>
That&#39;s all I had time for as others in the house wanted to use the TV to actually watch something.<br>
<br>
More later,<br>
<br>
keith<br>
<font color="#888888"><br>
--<br>
<br>
Keith R. Watson &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Georgia Institute of Technology<br>
Systems Support Specialist IV &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;College of Computing<br>
<a href="mailto:keith.watson@cc.gatech.edu">keith.watson@cc.gatech.edu</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 801 Atlantic Drive NW<br>
(404) 385-7401 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Atlanta, GA &nbsp;30332-0280<br>
<br>
</font></blockquote></div><br>