Question

I am trying to write a little Android app that makes use of the new infrared API added in Android 4.4 KitKat. →Documentation

I run into trouble because my app freezes and gets killed because it is unresponsive.

Some code:

...
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    irService = (ConsumerIrManager) getSystemService(CONSUMER_IR_SERVICE);
    Log.d("transmit", "lets go");
    irService.transmit(38000, new int[] { 70 });
    Log.d("transmit", "done");
...

And the logcat of this:

01-24 01:28:25.450: D/transmit(10551): lets go
01-24 01:29:14.610: D/transmit(10551): done

The call to transmit takes more than 30 secounds!

From the Documentation:

public void transmit (int carrierFrequency, int[] pattern)
Added in API level 19

Tansmit and infrared pattern

This method is synchronous; when it returns the pattern has been transmitted. Only patterns shorter than 2 seconds will be transmitted.

Parameters
carrierFrequency    The IR carrier frequency in Hertz.
pattern     The alternating on/off pattern in microseconds to transmit. <---- this is wrong, see http://stackoverflow.com/questions/20244337

Throug my phones' camera I saw the IR-LED flashing all the time, so I measured the real transmitted times with an ir sensor (+ means burst, - means space):

+64
-88448
+1835
-789
+1557
-768
+1579
-768
+1579
-768
+149
-491
+1664
-555
+533
-555
+1664
-555
+1664
-555
+1664
-555
+533
-555
+533
-555
+533
-555
+533
-533
+555
-555
+533
-555
+533
-555
+533
-555
+533
-555
+1664
-555
+1664
-555
+533
-555
+533
-555
+533
-555
+533
-555
+533
-555
+1664
-555
+533
-555
+533
-555
+1664
-555
+1664
-555
+1664
-555
+1664
-555
+1664
-555
+555
-388053
+60672
-384
+341
-714709
+61419
-320
+277
-533
+213
-1188181
+42069
-491
+299
-733269
+38421
-427
+341
-736917
+38208
-427
+320
-737131
+37867
-491
+320
-737429
+37696
-512
+299
-737600
+37739
-597
+256
-737536
+36736
-533
+320
-1213376
+36181
-683
+235
-739008
+35605
-789
+213
-1214336
+36181
-683
+256
-1213824
+36651
-576
+277
-1213440
+36160
-619
+277
-1213930
+35797
-555
+320
-1214272
+36480
-555
+299

Whats going on?

My device is a Galaxy Note 10.1 N8010 running OnmiROM 4.4 android. Maybe someone with a compatible device can test this?

Was it helpful?

Solution

Okay, after an update of OmniROM builds for my device the issue is fixed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top