Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
project:gctx [2012/11/20 23:55]
jenda [Limitations]
project:gctx [2016/02/19 17:47] (current)
jenda
Line 1: Line 1:
 +====== Graphic card transmitter ======
 +
 +Use graphic card as a software defined transceiver!
 +
 +{{template>​infobox|
 +name=gctx|
 +image=EDITME|
 +sw=-|
 +hw=-|
 +founder=[[user:​jenda]]|
 +interested=[[user:​mrkva]]|
 +status=active
 +}}
 +
 +
 +===== Motivation =====
 +
 +Software defined receivers are pretty cheap now (rtl-sdr~200CZK~8USD),​ however transmitters are still expensive. But you probably have one very fast DAC already in your computer - your graphic card with VGA output!
 +
 +{{ :​project:​gctx:​sdrlenna.jpg?​direct&​400 |}}
 +
 +===== Goal =====
 +
 +Goal is to create GNU Radio sink, that will eat your data and transmit them.
 +
 +===== Transmitting arbitrary data (first try) =====
 +
 +We will create the signal in gnuradio, convert it to black-and-white images and then use ffmpeg to convert the images into video file. We then play this file with mplayer.
 +
 +Obtain your pixel clock and resolution (from now on, resolution means htotal and vtotal) using xvidtune.
 +
 +Create the following flowgraph.
 +
 +{{ :​project:​gctx:​flowgraph.png?​direct&​300 |}}
 +(audio is 2x oversampled -- the Complex to Real probably does not work with the I/Q samples as I expected)
 +
 +Set the project sample rate to your actual pixel clock.
 +
 +Run the flowgraph. It is slow (~10 MS/s).
 +
 +Create file named "​head"​ with the following content.
 +<​code>​
 +P5
 +your_x_resolution your_y_resolution
 +255
 +</​code>​
 +
 +Generate frames.
 +<​code>​
 +cat chn.raw | for i in `seq 1 560`; do ( cat head; head -c $(( 1712 * 1063 )) ) > frame$i.pgm;​ done
 +</​code>​
 +(change "1712 * 1063" for your resolution)
 +
 +Generate video
 +<​code>​
 +ffmpeg -i frame%d.pgm -r 60 -crf 25 -preset ultrafast ​ -y video.mkv
 +</​code>​
 +(adjust -r to your screen refresh rate)
 +
 +Play the video in baseband
 +<​code>​mplayer -vo xv -loop 0 -noborder video.mkv</​code>​
 +(on my machine, OpenGL output does not support vsync, xv output does. This is probably important)
 +
 +Play the video on harmonics - we use video filter to introduce sharp edges into the signal. Unfortunately the spectrum is then pretty crap.
 +<​code>​mplayer -vo xv -loop 0 -noborder -vf eq2=1:​3:​0.7:​1 video.mkv</​code>​
 +
 +===== Inspiration =====
 +
 +  * [[http://​www.erikyyy.de/​tempest/​|Tempest for Eliza]] - AM audio transceiver (tested up to 145 MHz with Intel Mobile 945) - frequency accuracy is +/- 20 kHz, can be fixed in software
 +  * [[http://​bellard.org/​dvbt/​|TV Signal Generation]] - PAL/SECAM and DVB-T Multiplex (!) transceiver
 +  * http://​www.reddit.com/​r/​raspberry_pi/​comments/​14k5o3/​raspberry_pi_fm_transmitter_with_no_additional/​
 +  * http://​bk.gnarf.org/​creativity/​vgasig/​
 +
 +
 +===== TODO =====
 +  * learn how GnuRadio works and how to write a simple sink for it
 +  * switch on VGA output and make it display our picture without affecting other screens
 +  * turn vsync and keep track how fast are frames being refreshed - learn SDL? :(
 +  * split incoming signal into separate pictures
 +  * display each picture for calculated time, generating the wanted signal
 +  * make a [[http://​www.w8ji.com/​shortwave%20broadcast%20amplifier.htm|super big power amplifier]] so the whole world can hear us!
 +
 +===== Limitations =====
 +
 +Highest pixel clock of a common graphic card could be around 200 MHz (1920x1200 at 85 Hz). This gives you ability to directly transmit up to ~50 MHz achieving reasonable signal quality. [[http://​bellard.org/​dvbt/​|This project]] picks harmonics of the signal to transmit on higher frequencies. Another way is to mix the generated signal with external oscillator and hope that you get sum of frequencies on the output. DVB-T transmitter linked above uses the first approach to correctly generate even so complex modulations like 16-QAM.
 +
 +2nd and 4th harmonic seem to be OK, 4th harmonic is weak, but still receivable on Baoveng UV-5R with default antenna.
 +===== Transmitting power =====
 +
 +With a graphic card alone and ~20 cm of wire as an antenna the range is a few metres. HF amplifier will be necessary to do anything outside of the laboratory.
 +
 +===== Playing under Linux and X.org =====
 +
 +(tested on EEE 1005HA with Intel Mobile 945)
 +
 +When no load is detected, graphic card turns the output off. Use [[http://​www.geeks3d.com/​20091230/​vga-hack-how-to-make-a-vga-dummy-plug/​|dummy plug]] to keep it on. It looks like that only one channel is necessary.
 +
 +[[http://​en.wikipedia.org/​wiki/​VGA_connector|PINOUT]]
 +
 +We can boost pixelclock a little bit (172.8 MHz here)!
 +
 +<​code>​
 +xrandr --newmode "​shorths" ​ 172.80 ​   1920     ​1920 ​       1921        1921     1200 1215 1216 1231
 +                            PIXELCLK HVIDEO HSYNCSTART ​ HSYNCSTOP ​    ​HTOTAL
 +                              MHz
 +xrandr --addmode VGA1 shorths
 +xrandr --output VGA1 --mode "​shorths"​ --same-as LVDS1
 +</​code>​
 +
 +Search for "​modeline"​ in man xorg.conf for more info on these numbers.
 +
 +Now the horizontal sync gap should be only 1 pixel wide.
 +
 +TODO: Eliminate VBLANK in similar way.
 +
  
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki