EanderAlx.org

Linux, Virtualization and whatever I find interesting ...

User Tools


Site Tools



XBMC Media Center with Jetway JNC98-525 and Atirc IR-receiver

I want to describe how I put together my home media PC. I will describe the software configuration in connection with the IR-receiver.
As software basis I've used XBMC. For remote control I've chosen the IR-recieve from atric. As hardware base I selected an board build by jetway (JNC98-525). It has HDMI and an NVIDIA ION2 Chipset.

Hardware and Software in detail

Hardware

Board

I bought this Board: NC98-510-LF
For the IR-Receiver we need a serial port on the board. This one has an serial port typ-9 (later this will be important).

CPU Atom D525 1.80GHz
RAM 2x DDR2 up to 4GB
Video NVIDIA ION2 GPU
Video Ports HDMI, VGA, DVI
Serial 1 * COM header internal

IR-Receiver

The IR-receiver Rev. 5 by the german manufacturer Atric.
This IR-receiver is available for various types of serial ports. You have to know which type your is.
You have to buy 10 1-pin cables (reason later described according to problems with the IR-receiver).

IR-Control

I bought One-All-URC-7960 here

Software

XBMC with minimal Ubuntu. Installed from live System on an CF-Card.
Download: here

Install standard Hardware and XBMC

This shouldn't be a problem

But some annotation:

xbmc10

  • My Monitor seems to hate mono mp3 so I convert these. Otherwise XBMC say that the audio device doesn't work.
    • Create “.asoundrc” in your home this should fix the problem if you had it.
      .asoundrc
      pcm.dmixer {
      type dmix
         ipc_key 1024
         ipc_key_add_uid false
         ipc_perm 0660
         slave {
            pcm "hw:1,3" 
            rate 48000
            channels 2
            period_time 0
            period_size 1024
            buffer_time 0
            buffer_size 4096
         }
      }
       
      pcm.!default {
         type plug
         slave.pcm "dmixer"
      }
  • The best to use HDMI audio output for me was to set:
    • Standard audio output to → standard
    • Digital output for pass-through → HDA NVidia hdmi

xbmc11

  • Now I doen't get sound via HDMI. One friend find the solution.
    /etc/asound.conf
    pcm.!default {
    type hw
    card 1
    device 3
    }
    .asoundrc
    pcm.!default {
            type plug
            slave {
                pcm "hw:1,3"
            }
    }
  • Sound Settings in xbmc seems to be irrelevant.

Installation of the IR-receiver

Atric provide a very comprehensive manual ( German/English )
This Informations should help to connect the IR-Receiver to your board.

I have hit a board which make trouble. Power for the IR-board and train the power-on-signal was no problem (described in the manual).
But after I installed the IR-Receiver as described the media PC wasn't able to boot. Both LEDs turned on but nothing happen. This only when serial connected.
After some testing an some help from a colleague who has more experience with serial ports as I have we find the problem. responsible for the trouble was the first pin. This pin (DCD) is responsible for (Data) Carrier Detect (Wikipedia) and normally not essential for serial communication.

You can use the one-pin-cables which you can bought at the website of the IR-receiver. So the DCD-pin can be disconnected.

The IR-receiver will use this pin for transport the IR-signal. You have to change this by put the jumper to DSR as transport pin (lirc can be configured to use DSR pin to receive IR-signal).

Pin assignment

  • The Pin assignment can be found in the manual of the IR-receiver and you mainboard (here).
  • In the manual of the IR-receiver on page 13 and 15 you can find the pin assignment of the serial connector.
  • In the manual of my mainboard the pin assignment of the serial port is located on page 15.
Pleas be careful the order of counting the pins is different
!!!! Wrong connected pins can be destructive !!!!
I don't take responsibility if you damage your Board! Please first read the manual's

I connect:

IR-Board Mainboard (counting type of Jetway)
Pin 1 not connected
Pin 2 Pin 2
Pin 5 Pin 5
Pin 6 Pin 6
Pin 7 Pin 7
Pin 9 Pin 9
My serial portMy IR-receiver
Jetway JNC98-525 Serial PortJetway JNC98-525 Serial Port

Configuration of the IR-receiver

Get signals (Xubuntu xbmc11):

Lirc is installed when you use the live installation of XBMC. Now I had to configure it but the kernel-module used by lirc expect the IR-signal on the DCD-pin which was disconnected. So I had to change this. After some reaearch I find a solution. Inside the c-code of the kernel-module there is the data-pin set to DSR when a special hardware model is selected. You can give the type to modprobe when you load the module.

Previously you have to free the serial port.

Now test:

/etc/init.d/lirc stop
modprobe -r lirc_mceusb
setserial /dev/ttyS0 uart none
modprobe -v lirc_serial type=1
mode2 -d /dev/lirc1

Signals of your IR-Control should be appear as codes.

Configure lirc to load the right module

In /etc/lirc/hardware.conf you can configure which modules should be loaded when lircd starts here my version

/etc/lirc/hardware.conf
# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="Atric rev.5 IR Receiver"
REMOTE_MODULES="lirc_serial"
REMOTE_DRIVER=""
REMOTE_DEVICE="/dev/lirc1"
REMOTE_LIRCD_CONF="urc/urc-7960.conf"
REMOTE_LIRCD_ARGS=""
 
Chosen IR Transmitter
TRANSMITTER="None"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""
 
#Enable lircd
START_LIRCD="true"
 
#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD="false"
 
#Try to load appropriate kernel modules
LOAD_MODULES="true"
 
# Default configuration files for your hardware if any
LIRCMD_CONF=""
 
#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn't have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to "false"
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""
REMOTE_SOCKET=""
TRANSMITTER_SOCKET=""

Create /etc/modprobe.d/lirc.conf with the following content

lirc.conf
install lirc_serial /bin/setserial /dev/ttyS0 uart none; /sbin/modprobe --ignore-install lirc_serial type=1

Reboot, and if I doesn't forget to mention anything it should work and the right modules should be loaded. Repeat the test with “mode2”.

Now lirc had to learn to interpret the signals of your ir-control The tool irrecord will help you. You only have to read and do what the program say. Or, if you had the same ir-control, you could use my config if you want.

/etc/init.d/lirc stop
irrecord --device=/dev/lirc0 urc-7960

After that you have a config file. Thats my (orginal by M. Hippert → used as template) :

urc-7960.conf
# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.8.6(default) on Sun Feb 13 11:48:28 2011
#
# contributed by AN orginal by M. Hippert
# http://forum.team-mediaportal.com/fernbedienung-tastatur-ir-465/configfiles-fuer-girder-lirc-mit-oneforall-urc-7960-a-85801/
#
# Lirc Receiver: Atric
# model no. of remote control: ONE for ALL URC 7960 SmartControl
# devices being controlled by this remote: Code for stb: Technisat: 1195
# 
# press and hold the magic-Key for 3 sec -> blue ring will light up 2x
# select "stb"
# enter code "1195" -> blue ring will light up 2x
# 
# The keys PREVIEW, NEXT and "pop up X" failed
# The keys with same code
# Red & Rewind; Green & Stop; Yellow & Pause & Play; Blue & FastForward & 16:9; -/-- & list; back & Key-between-ChannelUp-and-ChannelDown
#
# Chance Code this keys:
#  * Press and hold the magic key for 3 sec. --> The Blue ring will light up 2x
#  * Press 9 9 4. --> The Blue ring will light up 2x
#  * Press and release the magic key.
#  * Enter the 5-digit magic-code
#  * dann die zu lernende Taste drücken
#  * Repeat all for the next key
# 
#
#  *** Magic-Code ***
#  Die Tasten richtig fest druecken, ansonsten kann es vorkommen, dass Tasten 
#  nicht angelernt werden obwohl der blaue Ring als Quittung blinkt
#  
#  Next		00240
#  Preview	00627
#  pop up X	00723
#  Rewind	00560
#  Stop		00243
#  Pause	00720
#  Play		00339
#  FastForward	00563
#  16:9		00274
#  list		00264
#  back & Key-between-ChannelUp-and-ChannelDown ------> not changed
#
# brand:                       urc-7960
# model no. of remote control: 
# devices being controlled by this remote:
#
 
begin remote
 
  name  MyRemote
  bits           13
  flags RC5|CONST_LENGTH
  eps            30
  aeps          100
 
  one           927   838
  zero          927   838
  plead         934
  gap          113492
  toggle_bit_mask 0x800
 
      begin codes
          BTN_BACK                 0x1232
          KEY_STOP                 0x1236
          KEY_NEXT                 0x122E
          KEY_REWIND               0x122C
          KEY_PLAY                 0x1235
          KEY_FASTFORWARD          0x1234
          KEY_LIST                 0x022F
          KEY_PAUSE                0x1229
          KEY_RECORD               0x1237
          KEY_VOLUMEUP             0x1210
          KEY_VOLUMEDOWN           0x1211
          KEY_MUTE                 0x120D
          KEY_CHANNELUP            0x1220
          KEY_CHANNELDOWN          0x1221
          KEY_BACK                 0x1222
          KEY_OK                   0x0217
          BTN_RIGHT                0x0216
          KEY_UP                   0x0210
          KEY_DOWN                 0x0211
          BTN_LEFT                 0x0215
          KEY_YELLOW               0x022D
          KEY_RED                  0x022B
          KEY_GREEN                0x022C
          KEY_BLUE                 0x022E
          KEY_INFO                 0x020F
          KEY_MENU                 0x0212
          KEY_TV2                  0x122F
          BTN_1                    0x1201
          BTN_2                    0x1202
          BTN_3                    0x1203
          BTN_4                    0x1204
          BTN_5                    0x1205
          BTN_6                    0x1206
          BTN_7                    0x1207
          BTN_8                    0x1208
          BTN_9                    0x1209
          BTN_0                    0x1200
      end codes
 
end remote

After including this into the /etc/lirc/lircd.conf and starting lirc you sould see the translated commands with irw

/etc/lirc/lircd.conf
##urc-7960
include "/etc/lirc/urc-7960.conf"
/etc/init.d/lirc start
irw

Configuring XBMC

Create an “Lircmap.xml” in your xbmc-data home.

touch ~/.xbmc/userdata/Lircmap.xml

The Documentation can be found here. After reboot XBMC should use the new file.

Here is my:

Lircmap.xml
<lircmap>
	<remote device="urc-7960">
		<start>KEY_SCREEN</start>
		<skipminus>KEY_BACK</skipminus>
		<stop>KEY_STOP</stop>
		<skipplus>KEY_NEXT</skipplus>
		<reverse>KEY_REWIND</reverse>
		<play>KEY_PLAY</play>
		<forward>KEY_FASTFORWARD</forward>
		<start>KEY_LIST</start>
		<pause>KEY_PAUSE</pause>
		<record>KEY_RECORD</record>
		<volumeplus>KEY_VOLUMEUP</volumeplus>
		<mute>KEY_MUTE</mute>
		<volumeminus>KEY_VOLUMEDOWN</volumeminus>
		<left>BTN_LEFT</left>
		<right>BTN_RIGHT</right>
		<up>KEY_UP</up>
		<down>KEY_DOWN</down>
		<select>KEY_OK</select>
		<pageplus>KEY_CHANNELUP</pageplus>
		<back>BTN_BACK</back>
		<pageminus>KEY_CHANNELDOWN</pageminus>
		<red>KEY_RED</red> <!-- HOME -->
		<myvideo>KEY_GREEN</myvideo>
		<mymusic>KEY_YELLOW</mymusic>
		<mypictures>KEY_BLUE</mypictures>
		<info>KEY_INFO</info>
		<title>KEY_MENU</title> <!-- CONTEX MENU -->
		<display>KEY_TV2</display>  <!-- FULL SCREEN -->
		<mytv>KEY_MODE</mytv>
		<menu>KEY_ESC</menu>
		<back>BTN_BACK</back>
		<one>KEY_1</one>
		<two>KEY_2</two>
		<three>KEY3</three>
		<four>KEY_4</four>
		<five>KEY_5</five>
		<six>KEY_6</six>
		<seven>KEY_7</seven>
		<eight>KEY_8</eight>
		<nine>KEY_9</nine>
		<power>BTN_EXTRA</power>
		<zero>KEY_0</zero>
	</remote>
</lircmap>

Perhaps you have to adapt the keymap for remote so that it fit to you wishes. The orginal is located in “/usr/share/xbmc/system/keymaps/”. You can copy it to ~/.xbmc/userdata/keymaps/ and edit it.

Have fun with the new remote-control.

linux/xbmc_jetway_jnc98-525-lf_atric_ir.txt · Last modified: 23.03.2013 21:30 by eanderalx