|
From: Benjamin K. <be...@kr...> - 2013-04-07 16:35:35
|
I believe I have found a bug in 'daemons/hw_ftdi.c'. Line 440 should read: pulsewidth = f_sample * ((__u64) (pulse & PULSE_MASK)) / 1000000ul; Instead of what it currently reads: pulsewidth = f_sample * ((__u32) (pulse & PULSE_MASK)) / 1000000ul; I've attached a patch file with this change. I discovered this bug while using this configuration file: http://lirc.sourceforge.net/remotes/motorola/DCT2000 (included in the Ubuntu distribution of LIRC as: /usr/share/lirc/extras/transmitters/motorola/dctxxxx.conf) In that file, the header is specified as: header 9036 4424 The relevant pieces of code in 'daemons/hw_ftdi.c' are: static int tx_baud_rate = 65536; /* Default transmit baud rate */ __u32 f_sample = tx_baud_rate * 8; /* Default sampling rate 524288 Hz */ int pulsewidth = f_sample * ((__u32) (pulse & PULSE_MASK)) / 1000000ul; The largest pulse from the configuration file has a duration of 9036us. pulse = 9036; Given that pulse: 9036 * 524288 = 4737466368 However, 2^32 = 4294967296 Difference = 442499072 The result (verified using xmode2) was that the first header pulse was lasting ~844us instead of 9036us. Changing '__u32' to '__u64' resolved the issue. This was tested on a machine running the 64bit version of Ubuntu 12.10. This bug impacts the Motorola set-top-boxes, which from my experience are the majority of the set-top-boxes distributed by cable providers in my area (Boston, MA). I recently switched from Comcast to RCN as my cable provider, and both use Motorola cable boxes which use this same configuration file. This bug prevents the home-brew FTDI based transmitters (using Albert's design from http://www.huitsing.nl/irftdi/) from communicating with these set-top-boxes. - Ben -- Benjamin Kraus be...@kr... |