LinHES Forums
http://forum.linhes.org/

lirc crashes when client connects using homemade serial rcvr
http://forum.linhes.org/viewtopic.php?f=6&t=11494
Page 1 of 1

Author:  the_crowbar [ Fri Sep 08, 2006 8:14 am ]
Post subject:  lirc crashes when client connects using homemade serial rcvr

Hello all,

I am helping a friend setup KnoppMyth. I built him a serial port receiver using the more advanced circuit from lirc.org. I can load the lirc_serial module and then run mode2 to see my button presses on the remote. I then used irrecord to setup a config file. I copied the new config to /etc/lircd.conf. I can start lirc and it appears ready to go.

As soon as the first client tries to connect (irw or myth) lircd exits with an error. The default lirc in R5D1 is not compiled for debug so I downloaded 0.8 from lirc.org.

After installing lirc-0.8 in /usr/local and modifying the /etc/init.d/lircd script I am starting the new 0.8 version and I have debug output. Here is the log from lircd:
Code:
root@mythtv:~# tail /var/log/lircd
Sep  8 08:35:10 mythtv lircd: config file read
Sep  8 08:35:10 mythtv lircd: lircd(serial) ready
Sep  8 08:35:42 mythtv lircd: registering local client
Sep  8 08:35:42 mythtv lircd: accepted new client on /dev/lircd
Sep  8 08:35:42 mythtv lircd: could not get hardware features
Sep  8 08:35:42 mythtv lircd: this device driver does not support the new LIRC interface
Sep  8 08:35:42 mythtv lircd: major number of /dev/ttyS0 is 4
Sep  8 08:35:42 mythtv lircd: LIRC major number is 61
Sep  8 08:35:42 mythtv lircd: check if /dev/ttyS0 is a LIRC device
Sep  8 08:35:42 mythtv lircd: caught signal
root@mythtv:~#


Can anyone tell me what the problem is? I have tested the hardware on another box and lircd does not crash with it and I am able to see the button presses with irw.

Thanks,
James

Author:  the_crowbar [ Fri Sep 08, 2006 12:28 pm ]
Post subject: 

Here is a little more information about the problem. First of all the /dev/ttyS0 device is part of the problem. It looks like this:
Code:
root@mythtv:~# ls -l /dev/ttyS0
crw-rw-rw-  1 root dialout  4, 65 May  7  2004 /dev/ttyS0
root@mythtv:~#
 

Once I run setserial /dev/ttyS0 uart none I then must change the device to be a lirc device. (rm /dev/ttyS0; mknod /dev/ttyS0 c 61 0)

Once the device is recreated I was able to load the lirc module and get lircd to work with a different kernel.

I tried using kernel 2.6.17.11 and lirc cvs version. I used the .config from the stock knoppmyth kernel and turned off all hardware I do not have. I also turned off SMP. When booting from the stock 2.6.17.11 kernel lircd does not crash and everything is fine so long as I fix the /dev/ttyS0 device.

I am currently compiling the stock kernel with SMP turned off to see if that fixes things.

With the stock knoppmyth kernel even after running setserial and fixing the /dev/ttyS0 device I get this in the dmesg output:
Code:
BUG: using smp_processor_id() in preemptible [00000001] code: modprobe/6750
caller is init_port+0xb0/0x2a0 [lirc_serial]
 <c02fa777> debug_smp_processor_id+0x87/0xa0  <dccabaf0> init_port+0xb0/0x2a0 [lirc_serial]
 <dccac46c> init_module+0x2c/0xb0 [lirc_serial]  <c013def4> sys_init_module+0x114/0x1e0
 <c0103177> syscall_call+0x7/0xb
lirc_serial: auto-detected active high receiver
lirc_dev: lirc_register_plugin: sample_rate: 0

I don't know how to read a kernel crash, but obviously something is not right.

Author:  khrusher [ Fri Sep 08, 2006 2:51 pm ]
Post subject: 

read this...might not be your problem....but might be

http://mysettopbox.tv/phpBB2/viewtopic.php?t=4743&highlight=bug+using+smpprocessorid

Author:  the_crowbar [ Fri Sep 08, 2006 2:57 pm ]
Post subject:  Finally got things working

Ok. Here is how I got a homemade serial IR receiver working with KnoppMyth R5D1.

1) Recompile kernel and turn off SMP. ( I also changed sata_nv to compiled in instead of as a module. This eleminates the need for an initrd image).

2) Boot from newly compiled kernel.

3) Download LIRC. I used cvs, but 0.8 would most likely work as well.

4) Compile LIRC. I used ./configure --with-x --enable-debug --with-driver=serial. If you don't want to have to modify the /etc/init.d/lirc script add --prefix=/usr when running configure.

5) Make and make install for LIRC.

6) The /dev/ttyS0 device has the wrong major/minor numbers to work with LIRC. If you change it then setserial will not be able to release the com port. I renamed ttyS0 to ttyS00 and made a new ttyS0.
Code:
#mv /dev/ttyS0 /dev/ttyS00
#mknod /dev/ttyS0 c 61 0


7) KnoppMyth has a /etc/init.d/etc-setserial script that could be used to release com1 from the kernel driver, but instead I just added the needed part to /etc/init.d/lirc. The command is:
/bin/setserial /dev/ttyS00 uart none
I added this to right after the start section of the /etc/init.d/lirc script.

8) If you didn't add --prefix=/usr to the configure step with lirc you need to go through the /etc/init.d/lirc script and replace every instance of /usr/bin or /usr/sbin with /usr/local/bin or /usr/local/sbin.

Once I rebooted I had a working serial IR receiver.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/