User Tools

Site Tools


tutorials:cb1:customization:wireless_music_box

This is an old revision of the document!


Make Cubieboard a Music Box with IR remote

About this Article

Abstract

Cubieboard series have support for infra-read (IR) support and analog sound ouput. Together with mplayer, Cubieboard could be turned into a great music box.

Prerequisite

  • A Cubieboard (1,2,3 are ok, theoretically)
  • An IR remote (NEC compatible remote, like usual TV remote)
  • Debian/Lubuntu Linux with IR support

Kernel Configuration

Select the sunxi IR support in kernel config, it's straightforward.

  <*> Device Drivers  --->  
    <*> Input device support  ---> 
      <*> Keyboards  ---> 
      <*> sunxi IR support

IR interface

If your kernel has already support IR feature, you can test the IR device interface.

root@Cubieboard1:~# dmesg | grep -i  sunxi-ir
[    2.254701] input: sunxi-ir as /devices/virtual/input/input0

If you see the above line, /dev/input/event0 should be the IR device interface.

Keycode

It is time to test your IR remote and get the keycodes.

root@Cubieboard1 ~# cat /dev/input/event0 | hexdump

Grasp your remote pointing to Cubieboad IR receiver and press a key, watch the output and last three columns, maybe like this

0000000 c0d6 528c c81c 0000 0001 0009 0001 0000
0000010 c0d6 528c c830 0000 0000 0000 0000 0000
0000020 c0d6 528c 9c3f 0004 0001 0009 0000 0000
0000030 c0d6 528c 9c51 0004 0000 0000 0000 0000
0000040 c0d7 528c 3275 0001 0001 0015 0001 0000
0000050 c0d7 528c 3292 0001 0000 0000 0000 0000
0000060 c0d7 528c 272b 0004 0001 0015 0000 0000
0000070 c0d7 528c 273e 0004 0000 0000 0000 0000

Pay attention to digits such as "0009", "0015", yes, they are the remote keycode, and you'd better write them down.

Software Installation

root@Cubieboard1:~# apt-get install lirc mplayer

LIRC Configuration

Player Program

tutorials/cb1/customization/wireless_music_box.1385207114.txt.gz · Last modified: 2013/12/23 14:50 (external edit)