I have a TV tuner card with an infrared sensor. I have made a script to remove/start ivtv kernel module and shutdown/restart lirc service on suspend/resume.
The problem is that the lirc service start command runs before ivtv has found and initialized the hardware, so it fails.
Is there a way to defer the lirc service start until after the hardware has been initialized?
The script file is:
and its contents:
#!/bin/sh # # Hauppauge PVR250 TV-card and TBS6680 DVB-card are dead after resume, fix it . /usr/lib/pm-utils/functions case "$1" in hibernate|suspend) # VLC prevents sleep killall vlc # LIRC... service lirc stop # Disable ivtv to prevent Hauppauge from being dead on resume rmmod ivtv # Disable TBS6680 dvb card to prevent it from being dead on resume rmmod saa716x_tbs_dvb ;; thaw|resume) modprobe saa716x_tbs_dvb modprobe ivtv # Here we need to wait until IR sensor device initialization is done! service lirc start ;; *) ;; esac exit
Snippet from syslog after resume:
lircd-0.9.0: lircd(devinput) ready, using /var/run/lirc/lircd lircd-0.9.0: accepted new client on /var/run/lirc/lircd lircd-0.9.0: initializing '/dev/input/event' lircd-0.9.0: unable to open '/dev/input/event' lircd-0.9.0: Failed to initialize hardware kernel: [34425.580877] init: Handling lirc-device-added event ... kernel: [34426.032906] ivtv: Start initialization, version 1.4.3 ... kernel: [34426.093966] ivtv0: Autodetected Hauppauge WinTV PVR-250 ... kernel: [34426.273807] init: Handling i2c-device-added event kernel: [34426.274758] Registered IR keymap rc-hauppauge kernel: [34426.274801] input: i2c IR (Hauppauge) as /devices/virtual/rc/rc13/input71 kernel: [34426.274854] rc13: i2c IR (Hauppauge) as /devices/virtual/rc/rc13 kernel: [34426.274856] ir-kbd-i2c: i2c IR (Hauppauge) detected at i2c-2/2-0018/ir0 [ivtv i2c driver #0] kernel: [34426.275080] init: Handling i2c-device-added event kernel: [34426.275135] init: Handling rc-device-added event ...