How to enable S-Video output and use it

From The Neuros Technology Wiki

Jump to: navigation, search

Contents

Update

There's another way to switch the other outputs on in the THS7313 without having to modify the driver. Basically you need to get the I2C tools from [1] and compile it. I did this using scratchbox that I built specifically for the OSD2, but you could also compile under the normal toolchain by modifying the Makefile to point to the right places. In scratch box I used: CPPFLAGS="-I/home/neuros/cifs/usr/local/include" LDFLAGS="-L/home/neuros/cifs/usr/local/lib" LD_LIBRARY_PATH="/home/neuros/cifs/usr/local/lib" make


Then copy i2cget, i2cset, i2cdump, and i2cdetect to your "root" folder (/root) in the OSD2. Or you can put them in one of the bin dirs (/usr/bin, /usr/sbin, /usr/local/bin, etc).


I'd also suggest that you download the datasheet for the THS7313. Google it, its from TI's website. The page you want is page 35, which describes the structure of the data byte.


In order to read the value of a channel use:

i2cget -f 0 0x2c 0x01

0 is the 0th bus (only 1 i2c bus), 0x2c is the address of the THS7313, and 0x01 is the data address (channel 1). You can use this for channel 2 and 3 by changing 0x01 to 0x02 and 0x03. 0x00 and 0x04 will always read as 0x00. And why use the -f flag? Because the THS7313 driver is using the i2c bus as well. -f tells the program to force, so it'll ignore that the "device" is in use.

To set the value (i.e. turn channel 2 on, set to 5MHz filter, etc) use:

i2cset -f 0 0x2c 0x02 0x83

If you read the device again, you will see that channel 2 is now set. This can be another way to enable s-video on the fly.


The problem

The OSD2 does not have s-video outputs.

The solution

You can hook up a s-video output, but you will have to solder wires to unpopulated resistors, and you will have to modify the THS7313 driver source code. Note: If you are not good at soldering, please ask somebody else who is to do it for you. If you screw up your I/O board, I'm not responsible and neither is anybody else other than you. You have been warned.


Some detailed information

The component and hdmi outputs are generated by the hdmi chip. However, the da-vinci has 4 DAC's built in that can generate a variety of signals. Three of the DAC's are usable, and one is being used for composite video output. The fourth DAC is connected to ground, and is not usable. Those DAC's are called DAC A, DAC B, and DAC C.


Those 3 DAC's pass through a video amplifier chip, the THS7313. This chip has an I2C bus, and can be controlled through software/driver to turn on/off each of the 3 inputs and to set other features for those 3 inputs. We'll be modifying the driver code for this chip in order to turn on the other 2 inputs. By default, only the composite is turned on and the other two are not. This is logical because most users will not need to follow this guide, or to use RGB.


When the three signals exit the amplifier, they are called SD_VOUT1, SD_VOUT2 and SD_VOUT3. Those are the same names as used in the I/O board diagrams. Hence: DAC A --> AMP --> SD_VOUT1. DAC B --> AMP --> SD_VOUT2, etc. According to the I/O board diagram, there are three SD_VOUT outputs from the CPU board to the I/O board. Those three outputs go to behind the RCA connectors. You will notice that sheet 13 shows DNP, which means "do not populate". So the solution is two-fold.

  1. Solder two wires to the SD_VOUT2 and SD_VOUT3 pads.
  2. Modify the THS7313 driver to turn on those two signals.


How to do this

  1. Modify the THS7313 driver.
    1. Go into your OSD2 dir, into the kernel. The path is for me: /root/osd2/linux-davinci-2.6/drivers/char
    2. Edit davinci-ths7313.c
    3. Below the line: "static void ths7313_configure(void)" you will notice that it disables channel 2 and 3, and enables channel 1.
    4. Modify it so that it enables each of the 3 channels (use channel 1 as guide and replace the names with the right ones), and also that it sets the input mux - again using channel 1's example as a guide.
    5. Save the file, and go back to your root dir (/root/osd2/ for me).
    6. Make all.
    7. Make install, goto device, and flash.
  2. Modify your uboot environment parameters to use svideo.
    1. After flashing, press a key when uboot is about to boot up, press any key to stop.
    2. setenv videoarg video=davincifb:output=ntsd:format=s-video
    3. setenv yaffs_cmd 'setenv bootargs $(console) root=/dev/mtdblock4 rw $(ip) $(mem_reserve) $(ide_params) $(videoarg)'
    4. saveenv
    5. Reboot.
  3. Solder wires to the board.
    1. If you looked at the diagrams, you would see that R96 is SD_VOUT1, R98 is SD_VOUT2, and R100 is SD_VOUT3.
    2. Make sure the OSD2 is off. Just to be careful.
    3. Solder a thin wire carefully to the RIGHT pad (RCA sockets should be on your left). Make sure that you do NOT accidently solder the two pads together, and make sure that you don't have any solder touching the hole(s).
    4. Solder a wire to the hole right above the "R97" lettering and below the bottom resistor. This is ground. If you are not sure that you know what I'm talking about, use another ground.


That's it.


RGB

You can enable RGB in the same way, by modifying the 7313 code to allow all 3 inputs to pass through. I have not done this nor tested this, and so your milage may vary (YMMV).


If you enable RGB.. Keep in mind that SD_VOUT1 is R, SD_VOUT2 is G, and SD_VOUT3 is B. You will lose composite. In other words, you can use composite and s-video at the same time. But you can't do component or RGB through the DAC's (by default, component is through the hdmi chip) at the same time as composite / s-video.

Personal tools