diff -uNr crrcsim-0.9.10.orig/documentation/input_method/walkera0701.txt crrcsim-0.9.10/documentation/input_method/walkera0701.txt
--- crrcsim-0.9.10.orig/documentation/input_method/walkera0701.txt	1970-01-01 01:00:00.000000000 +0100
+++ crrcsim-0.9.10/documentation/input_method/walkera0701.txt	2009-06-22 13:58:47.000000000 +0200
@@ -0,0 +1,70 @@
+Cable:
+======
+Walkera WK-0701 TX S-VIDEO connector to soundcard:
+
+
+ (back side of TX)
+      __   __              S-video:     
+     /  |_|  \             pin 2 (signal)    
+    / O 4 3 O \            pin 3 (GND)       
+   ( O 2   1 O )                             
+    \   ___   /      2 ______________________ Center pin of jack 3.5mm 
+     | [___] |                              
+      -------        3 ______________________ "Ground" of jack 3.5mm 
+
+
+No atenuators!  limiting resistor is already  inside TX.
+
+Configuration:
+==============
+
+Select: Options-> Controls -> Input Method -> Audio, /dev/dsp
+Select: File -> Save Setting  
+Select: File -> Exit
+
+Edit configuration file crrcsim.xml (Linux users  edit
+~/.crrcsim/crrcsim.xml)
+
+Search for device_type="PPM" and replace string PPM to PCM-WALKERA0701:
+
+example from crrcsim.xml:
+
+   <audio device_name="/dev/dsp" device_type="PCM-WALKERA0701">
+      <calibration>
+        <axis scale="1" offset="0" />
+        <axis scale="1" offset="0" />
+        <axis scale="1" offset="0" />
+        <axis scale="1" offset="0" />
+        <axis scale="1" offset="0" />
+        <axis scale="1" offset="0" />
+        <axis scale="1" offset="0" />
+        <axis scale="1" offset="0" />
+      </calibration>
+      <bindings radio_type="Custom">
+        <axes>
+          <aileron axis="1" polarity="1" />
+          <elevator axis="0" polarity="1" />
+          <rudder axis="3" polarity="1" />
+          <throttle axis="2" polarity="-1" />
+          <flap axis="-1" polarity="1" />
+          <spoiler axis="-1" polarity="1" />
+          <retract axis="-1" polarity="1" />
+          <pitch axis="-1" polarity="1" />
+
+
+Start crrcsim, check input signal from TX:
+
+Select: View -> Toggle Test Mode
+
+By mixer software (alsamixer etc.) set up input level from soundcard. 
+
+
+
+
+To disable Walkera PCM, edit config file, replace PCM-WALKERA0701 string by
+"PPM" string.
+
+----------------------------------------------------------------------
+Other method to connect walkera0701 to parport:  check  Walkera 0701
+joystick driver in 2.6.29 kernels.
+
diff -uNr crrcsim-0.9.10.orig/src/mod_inputdev/inputdev_audio/inputdev_audio.cpp crrcsim-0.9.10/src/mod_inputdev/inputdev_audio/inputdev_audio.cpp
--- crrcsim-0.9.10.orig/src/mod_inputdev/inputdev_audio/inputdev_audio.cpp	2009-03-07 17:41:23.000000000 +0100
+++ crrcsim-0.9.10/src/mod_inputdev/inputdev_audio/inputdev_audio.cpp	2009-06-22 13:56:02.000000000 +0200
@@ -6,6 +6,10 @@
  *   Copyright (C) 2005 - Joel Lienard
  *   Copyright (C) 2008 - Olivier Bordes
  *
+ *   modifications for walkera 0701 PCM  
+ *   Copyright (C) 2009 - Peter Popovec
+ *   http://zub.fei.tuke.sk/walkera-wk0701/
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2
  * as published by the Free Software Foundation.
@@ -33,12 +37,13 @@
 #include "inputdev_audio.h"
 
 #include <stdio.h>
+#include <string.h>
 #include <cstdlib>
 
 
 static paAudioData  AudioData;
 static int          synchro_index = 0;
-
+static int DevType = 0;
 
 // --------------------------------------------------------------------------
 /** This routine will be called by the PortAudio engine when audio is needed.
@@ -114,7 +119,7 @@
  *  Create an audio interface.
  */
 T_TX_InterfaceAudio::T_TX_InterfaceAudio()
-  : cname("audio"), sDevName("")
+  : cname("audio"), sDevName(""), sDevType("")
 {
 #if DEBUG_TX_INTERFACE > 0
   printf("T_TX_InterfaceAudio::T_TX_InterfaceAudio()\n");
@@ -153,7 +158,13 @@
   
   SimpleXMLTransfer *tag = config->getChild("inputMethod.audio", true);
   sDevName = tag->attribute("device_name", "NOT_SPECIFIED");
-  
+  sDevType = tag->attribute("device_type", "PPM");
+  DevType = 0;
+  if(0==strcmp(sDevType.c_str(),"PCM-WALKERA0701")){
+    DevType = 1;
+    printf("WARNING !!! Using WALKERA 0701 PCM demodulator code !!!\n");
+    printf("for more info read documentation/input_method/walkera0701.txt\n");
+  }
   if (audio_rc_open() == 0)
     return(0);
   else
@@ -193,7 +204,8 @@
 
   SimpleXMLTransfer *tag = config->getChild("inputMethod.audio", true);
   tag->setAttributeOverwrite("device_name", sDevName);
-
+  tag->setAttributeOverwrite("device_type", sDevType);
+  
   T_TX_InterfacePPM::putBackIntoCfg(config);
   mixer->putBackIntoCfg(config);
 }
@@ -260,7 +272,7 @@
   {
 
     AudioData.LastSamplesCounter = n;                         // lets update values
-    if(get_data(vals,&n))
+    if(DevType== 1 ? get_data_w0701(vals,&n):get_data(vals,&n))
     {
       for(i=0;i<11;i++)
         values[i]=vals[i];
@@ -516,6 +528,146 @@
 }
 
 
+#define RESERVE 40
+#define SYNC_PULSE 1306
+#define BIN0_PULSE 288
+#define BIN1_PULSE 438
+#define ANALOG_MIN_PULSE 318
+#define ANALOG_MAX_PULSE 878
+#define ANALOG_DELTA 80
+#define BIN_SAMPLE ((BIN0_PULSE + BIN1_PULSE) / 2)
+#define NO_SYNC 25
+
+int
+T_TX_InterfaceAudio::get_data_w0701 (float *values, int *nvalues)
+{
+  float x, px, max, min, moy;
+  int nval = AudioData.frameSize;
+  int i, j, k, chanel = 0;
+  int nibbles[26], crc1, crc2;
+  float dt_up = 0, dt_down = 0, val;
+  float *sig = AudioData.recordedSamples;
+
+  max= -100000;
+  min=  100000;
+  
+  for(i = 0; i < nval; i++)
+  {
+    x = sig[i];
+    if (x > max)
+      max = x;
+    if (x < min)
+      min = x;
+  }
+  moy = (max + min) / 2;
+  x = 0;
+  
+  chanel = 0;
+  j = (AudioData.frameIndex + 1024) % AudioData.frameSize;
+  for (i = 0; i < nval; i++)
+    {
+      px = x;
+      x = sig[j++];
+      if (j == AudioData.frameSize)
+	j = 0;
+
+      if ((x > moy) && (px < moy)) // rising edge
+	{
+	  dt_up =  j - (moy - px) / (x - px);
+	  if(dt_up < dt_down)
+	    dt_up += 1024;
+	  val = dt_up - dt_down;
+	  val = (val * 1000000) / SAMPLE_RATE;
+	  if (abs(val - SYNC_PULSE) < RESERVE ) 
+	    {
+	      chanel = 0;
+	      synchro_index = j;	//for OSCILLO  synchro
+//	      printf("DEBUG SYNC %f\n",val);
+	      continue;
+	    }
+	  if (val > (ANALOG_MIN_PULSE - RESERVE) && val < (ANALOG_MAX_PULSE + RESERVE))
+	    {
+	      if (chanel < NO_SYNC){
+		  val = val - ANALOG_MIN_PULSE + ANALOG_DELTA/2;
+                  if(val < 0)
+		    val = 0;
+		  nibbles[chanel++] |= (int) (val / ANALOG_DELTA);
+              }
+// 	      printf("DEBUG Analog = %d %f\n",(int)(val/80),val + ANALOG_MIN_PULSE - ANALOG_DELTA/2);
+	      continue;
+	    }
+	  chanel = NO_SYNC;  
+//	  printf ("DEBUG bad analog A=%f\n", val);
+	  continue;
+	}
+
+      if ((x < moy) && (px > moy)) // falling edge
+	{
+	  dt_down = j - (px - moy ) / (px - x);
+	  if(dt_down < dt_up)
+	    dt_down += 1024;
+	  val = dt_down - dt_up;
+	  val = (val * 1000000) / SAMPLE_RATE;
+	  if (val > (BIN0_PULSE - RESERVE) && val < (BIN1_PULSE + RESERVE))
+	    {
+	      if (chanel < NO_SYNC)
+		nibbles[chanel] = (val > BIN_SAMPLE) * 8;
+
+	      if (chanel == 24) // all nibbles
+		{
+
+		  for (crc1 = crc2 = k = 0; k < 10; k++)
+		    {
+		      crc1 += nibbles[k] & 7;
+		      crc2 += (nibbles[k] & 8) >> 3;
+		    }
+		  if ((nibbles[10] & 7) != (crc1 & 7))
+		    continue;
+		  if (((nibbles[10] & 8) >> 3) != (((crc1 >> 3) + crc2) & 1))
+                    continue;
+
+		  for (crc1 = crc2 =0, k = 11; k < 23; k++)
+		    {
+		      crc1 += nibbles[k] & 7;
+		      crc2 += (nibbles[k] & 8) >> 3;
+		    }
+		  if ((nibbles[23] & 7) != (crc1 & 7))
+		    continue;
+		  if (((nibbles[23] & 8) >> 3) != (((crc1 >> 3) + crc2) & 1))
+                    continue;
+
+		  values[0] = ((nibbles[0] & 7) * 256 + nibbles[1] * 16 + nibbles[2]) >> 2;
+		  values[0] *= ((nibbles[0] >> 2) & 2) - 1;
+		  values[1] = (nibbles[2] & 1) << 8 | (nibbles[3] << 4) | nibbles[4];
+		  values[1] *= (nibbles[2] & 2) - 1;
+		  values[2] = ((nibbles[5] & 7) * 256 + nibbles[6] * 16 + nibbles[7]) >> 2;
+		  values[2] *= ((nibbles[5] >> 2) & 2) - 1;
+		  values[3] =  (nibbles[7] & 1) << 8 | (nibbles[8] << 4) | nibbles[9];
+		  values[3] *= (nibbles[7] & 2) - 1;
+		  values[4] = ((nibbles[11] & 7) * 256 + nibbles[12] * 16 +  nibbles[13]) >> 2;
+		  values[4] *= ((nibbles[11] >> 2) & 2) - 1;
+		  values[5] = (nibbles[13] & 1) << 8 | (nibbles[14] << 4) | nibbles[15];
+		  values[5] *= (nibbles[13] & 2) - 1;
+		  values[6] = ((nibbles[16] & 7) * 256 + nibbles[17] * 16 + nibbles[18]) >> 2;
+		  values[6] *= ((nibbles[16] >> 2) & 2) - 1;
+		  values[7] = (nibbles[18] & 1) << 8 | (nibbles[19] << 4) | nibbles[20];
+		  values[7] *= (nibbles[18] & 2) - 1;
+		  for (k = 0; k < 8; k++)
+		    values[k] /= 512;
+		  *nvalues = 8;
+		  return 1;
+		}
+//              printf("DEBUG BIN[%d] %d %f\n",chanel,val > BIN_SAMPLE,val);
+	      continue;
+	    }
+	  chanel = NO_SYNC;
+//	  printf ("DEBUG Bad bin=%f\n", val);
+	}
+    }
+  return 0;
+}
+
+
 /**
  * \brief Re-open the audio interface
  *
diff -uNr crrcsim-0.9.10.orig/src/mod_inputdev/inputdev_audio/inputdev_audio.h crrcsim-0.9.10/src/mod_inputdev/inputdev_audio/inputdev_audio.h
--- crrcsim-0.9.10.orig/src/mod_inputdev/inputdev_audio/inputdev_audio.h	2009-03-07 17:41:23.000000000 +0100
+++ crrcsim-0.9.10/src/mod_inputdev/inputdev_audio/inputdev_audio.h	2009-06-22 13:47:45.000000000 +0200
@@ -120,6 +120,7 @@
   
     // The device is identified by its device name
     std::string sDevName;     ///< name of the device as reported by Portaudio
+    std::string sDevType;     ///< type of device PPM / PCM-WALKERA0701 / ...
     int         inputDevice;  ///< internal device index for Portaudio
 
     #if PORTAUDIO > 0
@@ -130,6 +131,7 @@
     int   audio_rc_close();
     int   get_data_from_audio_interface(float *values);
     int   get_data(float *values, int *nvalues);
+    int   get_data_w0701(float *values, int *nvalues);
 };
 
 #endif
