Re: tm6000 and IR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Stefan

> Am 05.12.2010 17:09, schrieb Dmitri Belimov:
> > Hi
> >
> >> Em 02-12-2010 02:41, Dmitri Belimov escreveu:
> >>> Hi Stefan
> >>>
> >>>>>> Am 29.11.2010 09:44, schrieb Dmitri Belimov:
> >>>>>>> Hi
> >>>>>>>
> >>>>>>> I try add IR for our TV cards.
> >>>>>>> After my some changes IR is working. But when I remove USB
> >>>>>>> stick from USB port
> >>>>>> What has you change?
> >>>>> 1. Add vendor-specific init code for IR.
> >>>>> 2. Add vendor-specific key filter for IR.
> >>>>> 3. Add some code for show IR activity via power led
> >>>>> 4. Move TV card defines to header file.
> >>>>>
> >>>> work it also with TM6010_REQ07_RD8_IR_WAKEUP_SEL = 0xff and
> >>>> TM6010_REQ07_RD8_IR_WAKEUP_ADD = 0xff?
> >>> It works
> >>>
> >>>> I think, this both values are
> >>>> setting the remote control address mask and so. And it is not
> >>>> good if we set individual remote controls (better one setting
> >>>> for all).
> >>> The TV card must be controled only from own IR remotes not from
> >>> other. One for all may be with additional setting like other
> >>> ir_table. Too much IR remotes usually in one home much devices can
> >>> do some tasks without key filter when you pressed a key.
> >> Yes, but users should be allowed to replace the IR tables, in order
> >> to do some advance usage. Hardcoding the IR address at the driver
> >> is a bad practice. I never tried to play with IR on tm5600/6000,
> >> but is there a way for it to output the command+address code?
> > The tm6010 return only two bytes when key pressed. high byte is IR
> > vendor id, low byte is key code. saa7134 with our IR decoder
> > returned 4 bytes ->  2 bytes is IR vendor id, 1 byte is key code
> > and control byte. I don't know about common IR remotes how many
> > bytes it sended.
> >
> IR vendor ? nether rc5 nor nec protocol has this terminus . It has 
> address and command. for extended protocol double length.

Ok. Our IR remotes use extended NEC and send 4 bytes. 2 of this bytes is address
this address different from other. This value is 0x866B. Other data is 1 byte command and 
invert of command byte.

> > For switch tm6000 to other ir_table need know vendor id byte and
> > new ir_table. Or describe full value from remotes in ir_table and
> > add logic for use only one piece of this for filtering.
> >
> >> If not, then we'll probably need to add some logic to allow users
> >> to change the address.
> >>>>>> Has it received keys?
> >>>>> Yes. I received keys, and can control any programm via lirc
> >>>>>
> >>>>>> Which protocol you it?
> >>>>> Our remotes has NEC protocol.
> >>>> Damn, has you values for rc5 protocols, any idea?
> >>> IR_LEADER_CNT1 set 'b0xxxxxxx for RC5
> >>> IR_LEADER_CNT0 'bxxxxxxxx
> >>>
> >>> This value depend from clock frequency and pulse period.
> >>> I found this value for RC5 and IR_PULSE_CNT
> >>> clock frequency 12MHz, pulse period 1.78ms
> >>> 1.78 * 12000 = 16'h21360
> >>> clock frequency 30MHz, pulse period 1.78ms
> >>> 1.78 * 30000 = 16'h53400
> >>> clock frequency 12MHz, pulse period 1.72ms
> >>> 1.72 * 12000 = 16'h20640
> >>>
> >>> Try this value.
> >>>
> >>>>>> As
> >>>>>> I wrote that I haven't the right value for rc5 protocol, and
> >>>>>> nec protocol works, that I have tested.
> >>>>> IR over int works well. But I found two main problems:
> >>>>> 1. crash after remove
> >>>> has you test it with lastest git branch (for_v2.6.38)?
> >>> I used
> >>> git checkout -b media-master linuxtv/staging/v.2.6.37
> >>> but when kernel builded I get linux-image-2.6.35
> >> Wrong branch. The latest development branch is staging/for_v2.6.38.
> > Thank you. When I switched to this branch modules is not crash when
> > USB removed. But disable IR over interrupt after start video/radio
> >
> > With my best regards, Dmitry.
> >
> changing the interface configuration by initiation isoc urb can 
> deactivating the interrupt in endpoint

We configure USB stick when modules is loaded

/* Selects the proper interface */
 rc = usb_set_interface(usbdev, 0, 1);

The USB controller reserved one half of bandwith for ISOC. Other device on USB can work slowely.
Much better:

when module loaded
/* Selects the proper interface */
 rc = usb_set_interface(usbdev, 0, 2);

when start video/audio/TS
/* Selects the proper interface */
 rc = usb_set_interface(usbdev, 0, 1);

when stop video/audio/TS
/* Selects the proper interface */
 rc = usb_set_interface(usbdev, 0, 2);

And restart int pipe after each selection. What you mean about it?
Dynamic bandwith utilization.

With my best regards, Dmitry.

> here the different configurations
> 
> interface        altsetting    endpoint    fifo
> 0                    0                    isoc            0 byte
> 0                    0                    bulk            512    bytes
> 0                    0                    interrupt    0 byte
> 0                    1                    isoc            3x1024 bytes
> 0                    1                    bulk            512 bytes
> 0                    1                    interrupt    4 bytes
> 0                    2                    isoc            0 byte
> 0                    2                    bulk            512 bytes
> 0                    2                    interrupt    4 bytes
> 0                    3                    isoc            3x1024 bytes
> 0                    3                    bulk            512 bytes
> 0                    3                    interrupt    0 byte
> 
> 
> >>>>> 2. disable IR after start video/radio. Try solve this problem
> >>>>> right now.
> >>>> sorry, I don't understand that.
> >>> See dmesg with my comments
> >>>
> >>> after modprobe tm6000
> >>> [  150.009123] usb 1-1: link qh0-00ff/f4fa0b00 start 0 [1/0 us]
> >>> [  150.070012] Registered IR keymap rc-behold-columbus
> >>> [  150.070160] input: tm5600/60x0 IR (tm6000 #0)
> >>> as /class/input/input5 [  150.070217] rc0: tm5600/60x0 IR (tm6000
> >>> #0) as /class/rc/rc0 [  150.227066] usbcore: registered new
> >>> interface driver tm6000 [  151.063914] tm6000: open called
> >>> (dev=video0)
> >>>
> >>> press some keys
> >>> [  168.703849] tm6000_ir_urb_received start
> >>> [  168.703855] int_in ir urb received 08 86 08 86
> >>> [  169.586424] tm6000_ir_urb_received start
> >>> [  169.586431] int_in ir urb received 04 86 04 86
> >>> [  170.009832] tm6000_ir_urb_received start
> >>> [  170.009838] int_in ir urb received 04 86 04 86
> >>> [  170.344236] tm6000_ir_urb_received start
> >>> [  170.344242] int_in ir urb received 01 86 01 86
> >>> [  170.711642] tm6000_ir_urb_received start
> >>> [  170.711649] int_in ir urb received 02 86 02 86
> >>> [  171.082425] tm6000_ir_urb_received start
> >>> [  171.082429] int_in ir urb received 00 86 00 86
> >>>
> >>> start watch a TV
> >>> [  214.446038] tm6000: open called (dev=video0)
> >>> [  216.265019] xc5000: waiting for firmware upload
> >>> (dvb-fe-xc5000-1.6.114.fw)... [  216.267055] xc5000: firmware read
> >>> 12401 bytes. [  216.267057] xc5000: firmware uploading...
> >>> [  222.942009] xc5000: firmware upload complete...
> >>>
> >>> try press a key
> >>> [  224.137976] tm6000_ir_urb_received start
> >>> [  224.137981] not ready
> >>> [  224.138014] usb 1-1: unlink qh0-00ff/f4fa0b00 start 0 [1/0 us]
> >>> [  224.138177] usb 1-1: link qh0-00ff/f4fa0b00 start 0 [1/0 us]
> >>> [  224.138458] usb 1-1: unlink qh0-00ff/f4fa0b00 start 0 [1/0 us]
> >>> [  224.139225] tm6000_ir_urb_received start
> >>> [  224.139225] not ready
> >>>
> >>> IR over int die here
> >>> [  224.139225] ehci_hcd 0000:00:1d.7: shutdown urb f4ee58c0
> >>> ep3in-intr [  224.155239] tm6000 tm6000_irq_callback :urb resubmit
> >>> failed (error=-1) [  224.160990] tm6000 tm6000_irq_callback :urb
> >>> resubmit failed (error=-1)
> >>>
> >>> With my best regards, Dmitry.
> >>>
> >>>>> I attched my diffs.
> >>>>> This file has some debug junk.
> >>>>> With my best regards, Dmitry.
> >>>>>
> >>>> Stefan Ringel
> > --
> > To unsubscribe from this list: send the line "unsubscribe
> > linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux