[mythtv-users] Getting lirc working
Angus
sylvania at istop.com
Sat Mar 17 16:24:53 UTC 2007
Jon wrote:
> Angus wrote:
>
>> Jon wrote:
>>
>>> Angus wrote:
>>>
>>>
>>>> Jon wrote:
>>>>
>>>>
>>>>> Angus wrote:
>>>>>
>>>>>
>>>>>
>>>>>> Jon wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Angus wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Jon wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> Angus wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Jon wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> It sounds like your remote does not repeat keypresses. Does it have a
>>>>>>>>>>> LED? If so, does it continue flashing as you hold the button down? If
>>>>>>>>>>> not you can use a digital camera pointed at the ir transmitter to confirm.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>> Digital camera, eh?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> Digital cameras are sensitive to IR light.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Well, as an addendum, after pushing several keys for a while out of
>>>>>>>>>> frustration, it finally registered a "gap". So I went through the
>>>>>>>>>> process of testing every key, and you can imagine my frustration when I
>>>>>>>>>> finished and found every key was coded as 0x0. Here's the less
>>>>>>>>>> vacuous-looking part of the config file:
>>>>>>>>>> bits 0
>>>>>>>>>> eps 30
>>>>>>>>>> aeps 100
>>>>>>>>>>
>>>>>>>>>> one 0 0
>>>>>>>>>> zero 0 0
>>>>>>>>>> pre_data_bits 32
>>>>>>>>>> pre_data 0x800100A7
>>>>>>>>>> gap 339993
>>>>>>>>>> toggle_bit 0
>>>>>>>>>>
>>>>>>>>>> Now what do I try?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> Have you read http://www.linuxtv.org/v4lwiki/index.php/Remote_controllers
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>> Yes, I have.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> Specifically,
>>>>>>>>> saa7134: Most cards need only the saa7134 driver, but a few need the
>>>>>>>>> ir-kbd-i2c helper. Boards known to require ir-kbd-i2c include the Upmost
>>>>>>>>> Purple TV and the latest "i-series" Pinnacle PCTV boards (110i, 50i)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>> And I've been asking what that means over at v4l, but I haven't
>>>>>>>> gotten any response.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> It means you may need to modprobe ir-kdc-i2c before it will work. You
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> Ah, yes. But that module loads automatically with saa7134.
>>>>>> http://www.mythtv.org/wiki/index.php/KWorld_Global_TV_Terminator#Remote
>>>>>> also says that I might need a patch for that, which is apparently got
>>>>>> something to do with v4l, but I can't been able to get anyone there to
>>>>>> help me with that yet.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> might see if you can use the linux input interface instead of lirc.
>>>>>>> Open xev and press a few buttons on the remote to see if they register.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> I did, and the results were not remarkable. Anything I pressed
>>>>>> returned this:
>>>>>> KeyPress event, serial 28, synthetic NO, window 0x1e00001,
>>>>>> root 0x45, subw 0x0, time 959597, (-218,-78), root:(400,300),
>>>>>> state 0x0, keycode 177 (keysym 0x0, NoSymbol), same_screen YES,
>>>>>> XLookupString gives 0 bytes:
>>>>>> XmbLookupString gives 0 bytes:
>>>>>> XFilterEvent returns: False
>>>>>>
>>>>>> KeyRelease event, serial 31, synthetic NO, window 0x1e00001,
>>>>>> root 0x45, subw 0x0, time 959645, (-218,-78), root:(400,300),
>>>>>> state 0x0, keycode 177 (keysym 0x0, NoSymbol), same_screen YES,
>>>>>> XLookupString gives 0 bytes:
>>>>>> XFilterEvent returns: False
>>>>>>
>>>>>> Except for the "time" field, this is exactly what was returned with
>>>>>> every key I pressed. I get the feeling that means it isn't working here
>>>>>> either.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> I suspect your remote is not supported by the driver yet. If you are
>>>>> feeling adventurous, see the section titled "How to add remote control
>>>>> support to a card" at the url above. I once added support for a cx88
>>>>> based card before, it's not very difficult.
>>>>>
>>>>>
>>>>>
>>>> Which URL?
>>>> http://www.linuxtv.org/v4lwiki/index.php/Remote_controllers? It seems to
>>>> be only for "GPIO" remotes. How would I know if mine is "GPIO" and not
>>>> "C3PIO" for instance?
>>>>
>>>>
>>> Per the article: Sometimes remotes are not pure gpio and acts a bit
>>> differently. For example, keypress can be signalled by gpio and keyvalue
>>> can be read from i2c device. If you seen only 1 bit is changing in gpio
>>> once it's probably this situation.
>>>
>>>
>>>
>>>> Also, what makes you think I know any C?
>>>>
>>>>
>>> Nothing, I can do hello world in C and that is it. I basically found
>>> the remote definitions in my driver, cloned one and played with the gpio
>>> mask until I got different vaules for each key just like it says. It
>>> was a bit daunting at first. The first time I looked through it I just
>>> said screw it, but I came back to it a few months later and it worked on
>>> about the third try.
>>>
>>> Actually, I know a great
>>>
>>>
>>>> deal of C. But all the C-knowledge in the world can't help me understand
>>>> those instructions. Are there better ones anywhere?
>>>>
>>>>
>>> Assuming your card is correctly auto detected and you are not passing
>>> card=x to the driver, just find the case statement it is referring to.
>>> Note the remote that is bound to it. Find the remote definition, change
>>> mask_keycode to 0. Proceed from step 3.
>>>
>>>
>> Ah, could this be the problem? My card is *not* autodetected, and I
>> do have to pass card=x. Here's my /etc/modprobe.d/saa7134:
>> options saa7134 i2c_scan=1 card=65 tuner=54
>> If remove this file, then the card doesn't work at all
>>
>
> AFAIK, the remote will only work if the card auto detected. Some cards
> do not have pciid's, thus the driver has no way to know what they are.
> This was another problem I had. I made the driver default to my card if
> it couldn't read the pciid.
>
Ok, so we are clear about this:
1. I should hack into saa7134-input.c
2. Find the switch(dev->board) and have it execute the code for case
SAA7134_BOARD_KWORLD_TERMINATOR. This would be in the
saa7134_input_init1() function.
3. We are talking about the saa7134-input.c in the kernel source, right?
I'm asking, because v4l has a "driver" tar ball with files similarly named.
4. You did all this with only hello_world.c knowledge?
More information about the mythtv-users
mailing list