Sunday, November 23, 2014

LightwaveRF Integration with XBMC

First, register your node to the LightwaveRF Wifi-Link

# echo -ne "666,\!F*p" | nc -u -w1 192.168.1.x 9760

(if may be useful to list on post 9761 to watch responses
# nc -ul 9761)

Then watch your WiFi-Link to confirm the new node.

Then you should be ready to start sending coommands
echo -ne "001,\!R1D2F1" | nc -u -w1 192.168.1.x 9760

I used XBMC Service Callbacks to hook into Play/Stop/Pause/Resume and to call these scripts to interact with the lightong (Lights off on Play/Resume, Lights On on Stop, and 40% dim on Pause).
http://forum.kodi.tv/showthread.php?tid=151011

(Cinema Experience will be a better way to do this in future, so you're not always turning on/off lights when watching regular/daytime TV and just for Movie Nights)

Friday, January 17, 2014

TBS Driver Interrupts

The TBS drivers needs to be enabled to use the PCI-MSI interrupts, as opposed to standard IRQ interrupts which it does by default.

After a few channel lockups, I noticed this in syslog:
Jan 17 04:08:08 wilfrodo kernel: [24621.425926] irq 18: nobody cared (try booting with the "irqpoll" option)
and lots of these:
Jan 17 18:14:47 wilfrodo tvheadend[881]: TS: TurboSight TBS 6985 DVBS/S2 frontend/ASTRA: 10,714,000 kHz Horizontal (No satconf)/More4 +1: MPEG2VIDEO @ #2367: Continuity counter error, 395 duplicate log lines suppressed
Jan 17 18:14:47 wilfrodo tvheadend[881]: TS: TurboSight TBS 6985 DVBS/S2 frontend/ASTRA: 10,714,000 kHz Horizontal (No satconf)/More4 +1: DVBSUB @ #2371: Continuity counter error, 6 duplicate log lines suppressed


So, the resolution is:
# cat /etc/modprobe.d/tbs.conf
options saa716x_tbs-dvb int_type=1


reboot, and hopefully you will see the card using the PCI-MSI interrupts now, and the issue should be fixed.

root@wilfrodo:~# cat /proc/interrupts
           CPU0
  0:         49   IO-APIC-edge      timer
  1:          2   IO-APIC-edge      i8042
  6:          2   IO-APIC-edge      floppy
  7:          2   IO-APIC-edge      parport0
  8:          1   IO-APIC-edge      rtc0
  9:          3   IO-APIC-fasteoi   acpi
 12:          4   IO-APIC-edge      i8042
 14:          0   IO-APIC-edge      pata_atiixp
 15:          0   IO-APIC-edge      pata_atiixp
 16:        483   IO-APIC-fasteoi   ohci_hcd:usb2
 17:          2   IO-APIC-fasteoi   ohci_hcd:usb3, ohci_hcd:usb5
 18:          2   IO-APIC-fasteoi   ohci_hcd:usb4, ohci_hcd:usb6
 19:          3   IO-APIC-fasteoi   ehci_hcd:usb1
 22:      31878   IO-APIC-fasteoi   ahci
 43:     166751   PCI-MSI-edge      radeon
 44:     379215   PCI-MSI-edge      SAA716x Core
 45:        709   PCI-MSI-edge      snd_hda_intel
 46:      93290   PCI-MSI-edge      SAA716x Core
 47:     565591   PCI-MSI-edge      eth0
NMI:        201   Non-maskable interrupts
LOC:    1578108   Local timer interrupts
SPU:          0   Spurious interrupts
PMI:        201   Performance monitoring interrupts
IWI:          0   IRQ work interrupts
RTR:          0   APIC ICR read retries
RES:          0   Rescheduling interrupts
CAL:          0   Function call interrupts
TLB:          0   TLB shootdowns
TRM:          0   Thermal event interrupts
THR:          0   Threshold APIC interrupts
MCE:          0   Machine check exceptions
MCP:         10   Machine check polls
ERR:          1
MIS:          0



Thursday, January 2, 2014

Installing comskip

Ok, so looking to install Comskip to remove the ads from programs I've recorded from TVHeadend.

Following instructions from here - http://forum.xbmc.org/showthread.php?tid=150084

Havent done any builds on this box so:
apt-get install build-essential

Looks like using latest ffmpeg is a good idea, details here:
https://launchpad.net/~jon-severinsson/+archive/ffmpeg

sudo add-apt-repository ppa:jon-severinsson/ffmpeg
apt-get update
apt-get install ffmpeg


Then grab
wget http://www.xilka.com/xilka/source/comskip-0.93f.tar.xz 
tar xvf comskip-0.93f.tar.xz
cd comskip-0.93f/
./configure --prefix=/usr


A few problems
checking for AVCODEC... no
configure: error: Package requirements (libavcodec >= 53.42) were not met:

No package 'libavcodec' found


so
apt-get install libavformat-dev

and try again
checking for ARGTABLE2... no
configure: error: Package requirements (argtable2 >= 9) were not met:

No package 'argtable2' found


once more
apt-get install libargtable2-dev

and try again:

checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands


Ready to build
make -j8
make install

If all went well we should be able to run comskip
Comskip 0.93f.000, made using avcodec

Now, we'll try to figure out how it works.