|
Edited by MDM63 at 2015-11-4 10:51
Found some time to fiddle with this today (night). I got my IR remote working and KODI 15.02 seems to work fine. Also mic works, but only in close range. I did not have heart to shout at my condo in the middle of the night.
I did the following things if anyone is interested.
Followed darqoq tutorial to setup the IR remote. I had to do some things little different.
Preparation:
Download the necessary lircd files from darqoq's mega account. (I haven't checked, but I have strong suspicion that the lircd might be already installed in this ROM...)
Find away to move the files to your Orange Pi. I tried to download them with the build in browser, but it required to install the MEGA android app an I could not find the folder where the MEGA app donwloaded the files.
You could use WinSPC (or any other SFTP app) to transfer the files to you Orange Pi plus. For this you will need SSH server for android. (I used SSHDroid). These apps are probably not necessary, but will ease the process, as one can use desktop computer to do all the commands and file editing. I had several issues using my wireless USB keyboard and the terminal emulator. (e.g. unable to edit files with nano, my arrow keys did not move the cursor for some reason.)
Installing:
Access the command line (Use the terminal emulator or SSH)
Become su
Remount /system as RW(read and write) to be enable to do the necessary changes.
- mount -o remount,rw /system
Copy code
Create dir
Copy the lircd files download from mega to to /etc/lircd
- cp /sdcard/Download/evtest /system/bin/evtest
- cp /sdcard/Download/lircd /system/bin/lircd
- cp /sdcard/Download/irw /system/bin/irw
- cp /sdcard/Download/irrecord /system/bin/irrecord
- cp /sdcard/Download/start_lircd.sh /system/bin/start_lircd.sh
- cp /sdcard/Download/stop_lircd.sh /system/bin/stop_lircd.sh
Copy code
Modify file permissions so we can run the necessary programs. (In this ROM chmod supports only octal mode descriptions!)
I used 777 for them all,(in general this is not very wise) if you are concerned with giving all access to every one to these files you are welcome to experiment with more restricted permissions. More information about user permissions can be found here.
- chmod 777 /system/bin/evtest
- chmod 777 /system/bin/lircd
- chmod 777 /system/bin/irw
- chmod 777 /system/bin/irrecord
- chmod 777 /system/bin/start_lircd.sh
- chmod 777 /system/bin/stop_lircd.sh
Copy code
Check that the module is loaded
You should get:
- sunxi_ir_rx 9154 0 - Live 0x00000000
Copy code
Find the correct event handler for the IR receiver.
- cat /proc/bus/input/devices
Copy code
You should get something on the lines of:
- I: Bus=0019 Vendor=0001 Product=0001 Version=0100
- N: Name="sunxi-ir"
- P: Phys=RemoteIR/input1
- S: Sysfs=/devices/virtual/input/input3
- U: Uniq=
- H: Handlers=sysrq kbd event5 cpufreq_interactive
- B: PROP=0
- B: EV=100003
- B: KEY=ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe
Copy code
For me it was event5.
There is some issue with the sunxi_ir_rx module. It needs to be uninstalled and the reinstalled to work properly. If you type
and press buttons of your remote, it will only give one result and then hang. (You can press ctrl+c to exit the evtest. You will probably need to become sudo again)
Reload the sunxi_ir_rx module.
- rmmod sunxi_ir_rx
- insmod /system/vendor/modules/sunxi-ir-rx.ko
Copy code
These next couple of steps are not as necessary as the others, but I leave them here for debugging purposes. You can skip straight to recording the IR remote commands.
Test the driver.
You should get something like this.
- ...
- Event code 254 (?)
- Event code 255 (?)
- Event type 20 (Repeat)
- Testing ... (interrupt to exit)
- Event: time 1444933051.375784, -------------- Report Sync ------------
Copy code
Check again that the module is loaded
Again you should get:
- sunxi_ir_rx 9154 0 - Live 0x00000000
Copy code
Check that you are still getting the same handler.
- cat /proc/bus/input/devices
Copy code
- I: Bus=0019 Vendor=0001 Product=0001 Version=0100
- N: Name="sunxi-ir"
- P: Phys=RemoteIR/input1
- S: Sysfs=/devices/virtual/input/input5
- U: Uniq=
- H: Handlers=sysrq kbd event5 cpufreq_interactive
- B: PROP=0
- B: EV=100003
- B: KEY=ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe
Copy code
Test that you get input events from the driver and that it won't hang after the fist key press.
Pressing any key on your IR remote, should add line with event.
- ...
- Event code 255 (?)
- Event type 20 (Repeat)
- Testing ... (interrupt to exit)
- Event: time 1444933164.078062, type 1 (Key), code 123 (Hanja), value 1
- Event: time 1444933164.078073, -------------- Report Sync ------------
- Event: time 1444933164.276381, type 1 (Key), code 123 (Hanja), value 0
- Event: time 1444933164.276389, -------------- Report Sync ------------
- Event: time 1444933164.477201, type 1 (Key), code 123 (Hanja), value 1
- Event: time 1444933164.477211, -------------- Report Sync ------------
- Event: time 1444933164.676388, type 1 (Key), code 123 (Hanja), value 0
- Event: time 1444933164.676396, -------------- Report Sync ------------
Copy code
Record your remote key presses.
- /system/bin/irrecord -H devinput -d name=sunxi-ir /etc/lircd/lircd.conf
Copy code
You can list accepted key names with following command.
Check /etc/lircd/lircd.conf, if your key codes are doubled like these.
- begin codes
- KEY_0 0x0100FF00000001 0x00000000000000
- KEY_1 0x01000100000001 0x00000000000000
- end codes
Copy code
Edit /etc/lircd/lircd.conf manually remove the second code part (0x00000000000000) (I have not tested if this is really necessary.)
- begin codes
- KEY_0 0x0100FF00000001
- KEY_1 0x01000100000001
- end codes
Copy code
Edit /etc/lircd/lircd.conf and change the 'name' from lircd.conf to devinput or linux-input-layer (this remote names are predefined in Kodi configuration, I used devinput)
- begin remote
- name devinput
Copy code
Bare minimum keys to record are:
KEY_DOWN, KEY_UP, KEY_LEF, KEY_ENTER, KEY_BACK
Test that it works.
Start lirc daemon.
- /system/bin/start_lirc.sh
Copy code
Run irw and press some keys, check that you get correct output that correlates to your /etc/lircd/lircd.conf.
- /system/bin/irw /dev/lircd
Copy code
Return should be something on the line of this:
- 000100c300000001 00 KEY_OK myremote
- 000100c500000001 00 KEY_DOWN myremote
- 000100a800000001 00 KEY_KPPLUS myremote
- 000100a000000001 00 KEY_POWER myremote
- 0001000800000001 00 KEY_8 myremote
- 0001000100000001 00 KEY_1 myremote
- 0001000600000001 00 KEY_6 myremote
Copy code
To stop the lircd deamon use:
Now you should have fully functioning IR remote.
To keep these setting after restart you need to make a script, save it somewhere you can find it and run it at start up.
First use your favourite editor to create a script. (I named mine startup.sh and saved it to /etc/lircd. It really does not matter much where you store your script and what name you give to it, as long as you can find it and the android can access it at boot.
Here is mine:
- [list=1]
- [*]#!/system/bin/sh
- [*]mount -o remount,rw /system
- [*]rmmod sunxi_ir_rx
- [*]insmod /system/vendor/modules/sunxi-ir-rx.ko
- [*]/system/bin/start_lircd.sh
- [/list]
Copy code
You need to give you script proper premissions.
- chmod 777 /etc/lircd/startup.sh
Copy code
Then I used Script Manager to run my script after boot.
Now only thing left is to uninstall the old Kodi (14) and install newest Kodi (15.02) from play store.
I will keep you updated as I get further with my fiddling. I am quite busy with my day job and other projects, but will come back to this time to time.
|
|