title: Sending infrared pattern with KitKat API on Samsung Galaxy S4
body: <p>KitKat IR sdk<br/>
  <a href="http://developer.android.com/reference/android/hardware/ConsumerIrManager.html" rel="nofollow">http://developer.android.com/reference/android/hardware/ConsumerIrManager.html</a></p>
  
  <p>LG IR sdk<br/>
  <a href="http://developer.lgmobile.com/MOBILE_HELP/topic/lge.mobilesdk.LGQRemote.api/Documents/reference/com/lge/hardware/IRBlaster/IRBlaster1.htm#sendIRPattern(int" rel="nofollow">http://developer.lgmobile.com/MOBILE_HELP/topic/lge.mobilesdk.LGQRemote.api/Documents/reference/com/lge/hardware/IRBlaster/IRBlaster1.htm#sendIRPattern(int</a>, int[])</p>
  
  <p>I am developing android application which uses infrared transmitter. There are 2 buttons which should send given ir patter. I have used raspberry pi with lirc to read these codes from original remote for my device. </p>
  
  <p>My pattern to be sent looks like this (It's decimal duration values):<br/></p>
  
  <pre><code>1771     821    3499     823     869
  </code></pre>
  
  <p>Using LG IR sdk on <strong>LG2</strong> I am able to send this data properly this using method mentioned above:</p>
  
  <pre><code>int frequency=38000;
  int[] rawCodes=new int[]{1771,821,3499,823,869};
  mIR.sendIRPattern(frequency, rawCodes);
  </code></pre>
  
  <p>I tested sent data with LG G2 again on raspberry pi with lirc and decoded values are nearly identical as values in given array.
  Unfortunately using KitKat sdk ConsumerIrManager on <strong>Samsung Galaxy S4</strong>: </p>
  
  <pre><code>int frequency=38000;
  int[] rawCodes=new int[]{1771,821,3499,823,869};
  irManager.transmit(frequency,rawCodes);
  </code></pre>
  
  <p>Sent data is diffrent than I expected. Reading data sent by samsung with lirc  it looks like sometimes received data is correct but sometimes there are totatally different values (like 2 quite big values). Do you guys know what I am doing wrong? As far as I know there are no difference between LG sdk and Kitkat sdk methods so I don't know why these 2 phones sometimes send different signals.</p>