Leadtek Winfast DTV-1000S remote control support
Hi, I've been using the testing drivers for the dtv 1000s and they have been working great, there was no remote control support however so after a bit of messing around I managed to patch the files and get my remote working. The patch is below, but i'm new to the mailing list and patches and the like so not sure if this is useful or correct, but it works for me so I thought I would contribute it. Cheers diff -Naur dtv1000s-orig/linux/drivers/media/common/ir-keymaps.c dtv1000s-remote/linux/drivers/media/common/ir-keymaps.c --- dtv1000s-orig/linux/drivers/media/common/ir-keymaps.c 2009-10-07 21:27:39.315700245 +1100 +++ dtv1000s-remote/linux/drivers/media/common/ir-keymaps.c 2009-10-07 21:27:59.727200476 +1100 @@ -1630,6 +1630,7 @@ [ 0x37 ] = KEY_RADIO, /* FM */ [ 0x38 ] = KEY_DVD, + [ 0x1a ] = KEY_MODE,/* change to MCE mode on Y04G0051*/ [ 0x3e ] = KEY_F21, /* MCE +VOL, on Y04G0033 */ [ 0x3a ] = KEY_F22, /* MCE -VOL, on Y04G0033 */ [ 0x3b ] = KEY_F23, /* MCE +CH, on Y04G0033 */ diff -Naur dtv1000s-orig/linux/drivers/media/video/saa7134/saa7134-cards.c dtv1000s-remote/linux/drivers/media/video/saa7134/saa7134-cards.c --- dtv1000s-orig/linux/drivers/media/video/saa7134/saa7134-cards.c 2009-06-20 05:22:30.0 +1000 +++ dtv1000s-remote/linux/drivers/media/video/saa7134/saa7134-cards.c 2009-10-07 21:23:23.243700429 +1100 @@ -6638,6 +6638,7 @@ case SAA7134_BOARD_REAL_ANGEL_220: case SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG: case SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS: + case SAA7134_BOARD_LEADTEK_WINFAST_DTV1000S: dev-has_remote = SAA7134_REMOTE_GPIO; break; case SAA7134_BOARD_FLYDVBS_LR300: diff -Naur dtv1000s-orig/linux/drivers/media/video/saa7134/saa7134-input.c dtv1000s-remote/linux/drivers/media/video/saa7134/saa7134-input.c --- dtv1000s-orig/linux/drivers/media/video/saa7134/saa7134-input.c 2009-06-20 05:22:30.0 +1000 +++ dtv1000s-remote/linux/drivers/media/video/saa7134/saa7134-input.c 2009-10-07 21:24:32.555700167 +1100 @@ -605,6 +605,12 @@ mask_keycode = 0x7f; polling = 40; /* ms */ break; + case SAA7134_BOARD_LEADTEK_WINFAST_DTV1000S: + ir_codes = ir_codes_winfast; + mask_keycode = 0x5f00; + mask_keyup = 0x02; + polling = 50; // ms + break; } if (NULL == ir_codes) { printk(%s: Oops: IR config error [card=%d]\n, -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: pctv nanoStick Solo not recognized
Hi Matteo, Sorry for being quite in the first place. On Tue, 20 Oct 2009, Matteo Miraz wrote: Devin, it worked. I added the new vendor, and changed the other entry. I'm wondering if exists a pinnacle pctv 73e se usb device... attached to this mail there is the (easy) patch. This patch is in fact the right way to do things. Acked-by: Patrick Boettcher pboettc...@kernellabs.com While you are at it, can you please also changed the vendor ID for the PCTV282E-device to PCTVSYSTEMS and file a new patch? thanks for the help, -- Patrick Boettcher - Kernel Labs http://www.kernellabs.com/ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: ISDB-T tuner
Hi all, On Tue, 20 Oct 2009, Akihiro TSUKADA wrote: And just for you information, in addition to EarthSoft PT1, there is a driver for 'Friio' ISDB-T USB receiver (which I wrote;) , and it is already included in the main repository. Dibcom is maybe for Brazil and may or may not work in Japan. I'm just stepping in here to clarify Dibcom's ISDB-T support: it's purely limited to demodulation with the dib8000-driver. Meaning, using a Dibcom reference-design in Japan will give you the BCAS encrypted transport stream, not more. This way is primarily used in set-top-boxes and car-receivers and things like that. -- Patrick Boettcher - Kernel Labs http://www.kernellabs.com/ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC/PATCH 00/14] Media controller update based on Hans' v4l-dvb-mc tree
Hi everybody, here's a set of patches to clean up and extend Hans' initial media controller implementation. Patches prefixed by v4l deal with the v4l core code and update existing drivers when required by an API change. The core now offers two functions to deal with entities and links: - v4l2_entity_init() will initialize an entity. For subdevices the v4l2_subdev_init() performs part of the entity initialization as well, which leads me to believe that the API is currently ill-defined. - v4l2_entity_connect() creates a link between two entities. All possible links should be created using that function before the subdevice is registered. As I don't own any ivtv hardware the media controller code was difficult to test so I've implemented media controller support in the UVC driver for testing purpose. The code can be found in patches prefixed by uvc. This is mostly playground code. There are known and unknown bugs (especially in the ivtv driver as I haven't been able to test that code; v4l2_entity_connect is definitely called with bad parameters in there) as well as design issues. There's a lot of code missing. I'm mostly interested in getting feedback on the changes, especially the new v4l2_entity_pad and v4l2_entity_link objects. Feel free to comment on the public userspace API too, I realized after changing it to mimic the new kernel API that the way the previous API exposed local and remote pads instead of pads and links is probably more space efficient. I'll keep playing with the code and I'll start porting the OMAP3 camera driver to the in-progress media controller API. I'll discover problems (and hopefully solutions) along the way so another round of patches can be expected later, maybe in a week. Of course I'll appreciate comments before that, as the earlier I get feedback the easier it will be to incorporate it in the code. No pressure though, I know that a few developers have left for the kernel summit in Japan. -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC/PATCH 01/14] v4l-mc: Rename pins to pads
Entities connection points are now named pads to avoid confusing them with physical pins. Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com Index: v4l-dvb-mc/linux/include/linux/videodev2.h === --- v4l-dvb-mc.orig/linux/include/linux/videodev2.h +++ v4l-dvb-mc/linux/include/linux/videodev2.h @@ -1561,8 +1561,8 @@ struct v4l2_mc_io { }; struct v4l2_mc_io_status { - __u32 active_pins; - __u8 nr_of_remote_pins; + __u32 active_pads; + __u8 nr_of_remote_pads; }; struct v4l2_mc_entity { @@ -1598,7 +1598,7 @@ struct v4l2_mc_ios { /* Should have enough room for inputs+outputs elements */ struct v4l2_mc_io_status *status; /* Should have enough room for total_possible_links elements */ - struct v4l2_mc_io *remote_pins; + struct v4l2_mc_io *remote_pads; }; struct v4l2_mc_link { Index: v4l-dvb-mc/linux/include/media/v4l2-mc.h === --- v4l-dvb-mc.orig/linux/include/media/v4l2-mc.h +++ v4l-dvb-mc/linux/include/media/v4l2-mc.h @@ -4,9 +4,9 @@ #include linux/list.h struct v4l2_entity_io { - u32 active; /* bitmask of active remote pins */ - u8 nr_of_remote_pins; /* number of remote pins */ - struct v4l2_mc_io *remote_pins; /* specify possible remote pins */ + u32 active; /* bitmask of active remote pads */ + u8 nr_of_remote_pads; /* number of remote pads */ + struct v4l2_mc_io *remote_pads; /* specify possible remote pads */ }; struct v4l2_entity { @@ -46,7 +46,7 @@ struct v4l2_entity { }; static inline void v4l2_entity_prep(struct v4l2_entity *ent, u8 num_inputs, u8 num_outputs, - struct v4l2_entity_io *links, struct v4l2_mc_io *remote_pins) + struct v4l2_entity_io *links, struct v4l2_mc_io *remote_pads) { int i; @@ -54,8 +54,8 @@ static inline void v4l2_entity_prep(stru ent-num_outputs = num_outputs; ent-links = links; for (i = 0; i num_inputs + num_outputs; i++) { - links[i].nr_of_remote_pins = 1; - links[i].remote_pins = remote_pins + i; + links[i].nr_of_remote_pads = 1; + links[i].remote_pads = remote_pads + i; } } @@ -71,11 +71,11 @@ static inline void v4l2_entity_connect(s source_link = source-num_inputs + source-outputs++; sink_link = sink-inputs++; - source-links[source_link].remote_pins[0].entity = sink-id; - source-links[source_link].remote_pins[0].io = sink_link; + source-links[source_link].remote_pads[0].entity = sink-id; + source-links[source_link].remote_pads[0].io = sink_link; source-links[source_link].active = active; - sink-links[sink_link].remote_pins[0].entity = source-id; - sink-links[sink_link].remote_pins[0].io = source_link; + sink-links[sink_link].remote_pads[0].entity = source-id; + sink-links[sink_link].remote_pads[0].io = source_link; sink-links[sink_link].active = active; } Index: v4l-dvb-mc/v4l2-apps/util/v4l2-mc.cpp === --- v4l-dvb-mc.orig/v4l2-apps/util/v4l2-mc.cpp +++ v4l-dvb-mc/v4l2-apps/util/v4l2-mc.cpp @@ -223,7 +223,7 @@ static void show_topology(int fd) ios.entity = ent.id; ios.status = (struct v4l2_mc_io_status *) malloc((ent.inputs + ent.outputs) * sizeof(struct v4l2_mc_io_status)); - ios.remote_pins = (struct v4l2_mc_io *) + ios.remote_pads = (struct v4l2_mc_io *) malloc(ent.total_possible_links * sizeof(struct v4l2_mc_io)); if (ioctl(fd, VIDIOC_MC_ENUM_LINKS, ios) = 0) { int i; @@ -233,46 +233,46 @@ static void show_topology(int fd) int j; printf(\tInput %d: , i); - if (ios.status[i].nr_of_remote_pins == 1) { + if (ios.status[i].nr_of_remote_pads == 1) { printf(%s/%d %s\n, - entity2s(fd, ios.remote_pins[p].entity).c_str(), - ios.remote_pins[p].io, - ios.status[i].active_pins == 1 ? (active) : ); + entity2s(fd, ios.remote_pads[p].entity).c_str(), + ios.remote_pads[p].io, + ios.status[i].active_pads == 1 ? (active) : ); } else { - for (j = 0; j ios.status[i].nr_of_remote_pins; j++) { + for (j = 0; j
[RFC/PATCH 04/14] v4l-subdev: Add pads operations
Add a v4l2_subdev_pad_ops structure for the operations that need to be performed at the pad level such as format-related operations. Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com Index: v4l-dvb-mc/linux/include/media/v4l2-subdev.h === --- v4l-dvb-mc.orig/linux/include/media/v4l2-subdev.h +++ v4l-dvb-mc/linux/include/media/v4l2-subdev.h @@ -232,11 +232,21 @@ struct v4l2_subdev_video_ops { int (*enum_frameintervals)(struct v4l2_subdev *sd, struct v4l2_frmivalenum *fival); }; +struct v4l2_subdev_pad_ops { + int (*enum_fmt)(struct v4l2_subdev *sd, unsigned int pad, struct v4l2_fmtdesc *fmtdesc); + int (*enum_framesizes)(struct v4l2_subdev *sd, unsigned int pad, struct v4l2_frmsizeenum *fsize); + int (*enum_frameintervals)(struct v4l2_subdev *sd, unsigned int pad, struct v4l2_frmivalenum *fival); + int (*get_fmt)(struct v4l2_subdev *sd, unsigned int pad, struct v4l2_format *fmt); + int (*try_fmt)(struct v4l2_subdev *sd, unsigned int pad, struct v4l2_format *fmt); + int (*set_fmt)(struct v4l2_subdev *sd, unsigned int pad, struct v4l2_format *fmt); +}; + struct v4l2_subdev_ops { const struct v4l2_subdev_core_ops *core; const struct v4l2_subdev_tuner_ops *tuner; const struct v4l2_subdev_audio_ops *audio; const struct v4l2_subdev_video_ops *video; + const struct v4l2_subdev_pad_ops *pad; }; #define V4L2_SUBDEV_NAME_SIZE 32 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC/PATCH 02/14] v4l-mc: Merge input and output pads
The media controller doesn't need separate counts of input and output pads. Merge them into a pads count. Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com Index: v4l-dvb-mc/linux/drivers/media/video/v4l2-device.c === --- v4l-dvb-mc.orig/linux/drivers/media/video/v4l2-device.c +++ v4l-dvb-mc/linux/drivers/media/video/v4l2-device.c @@ -107,15 +107,12 @@ static long mc_enum_entities(struct v4l2 strlcpy(mc_ent.descr, ent-descr, sizeof(mc_ent.descr)); mc_ent.type = ent-type; mc_ent.subtype = ent-subtype; - mc_ent.inputs = ent-inputs; - mc_ent.outputs = ent-outputs; + mc_ent.pads = ent-pads; mc_ent.total_possible_links = 0; if (ent-links) { int l; - for (l = 0; l ent-inputs; l++) - mc_ent.total_possible_links += ent-links[l].nr_of_remote_pads; - for (l = ent-num_inputs; l ent-num_inputs + ent-outputs; l++) + for (l = 0; l ent-pads; l++) mc_ent.total_possible_links += ent-links[l].nr_of_remote_pads; } mc_ent.v4l.major = ent-v4l.major; @@ -139,25 +136,13 @@ static long mc_enum_links(struct v4l2_de if (ent == NULL) return -EINVAL; if (ent-links) { - for (l = 0; l ent-inputs; l++) - total_possible_links += ent-links[l].nr_of_remote_pads; - for (l = ent-num_inputs; l ent-num_inputs + ent-outputs; l++) + for (l = 0; l ent-pads; l++) total_possible_links += ent-links[l].nr_of_remote_pads; } if (ios.status) { int s = 0; - for (l = 0; l ent-inputs; l++, s++) { - struct v4l2_mc_io_status stat = { 0, 0 }; - - if (ent-links) { - stat.active_pads = ent-links[l].active; - stat.nr_of_remote_pads = ent-links[l].nr_of_remote_pads; - } - if (copy_to_user(uios-status + s, stat, sizeof(stat))) - return -EFAULT; - } - for (l = ent-num_inputs; l ent-num_inputs + ent-outputs; l++, s++) { + for (l = 0; l ent-pads; l++, s++) { struct v4l2_mc_io_status stat = { 0, 0 }; if (ent-links) { @@ -172,13 +157,7 @@ static long mc_enum_links(struct v4l2_de if (ios.remote_pads total_possible_links) { int p = 0; - for (l = 0; l ent-inputs; l++) { - if (copy_to_user(uios-remote_pads + p, ent-links[l].remote_pads, - ent-links[l].nr_of_remote_pads * sizeof(ent-links[l].remote_pads[0]))) - return -EFAULT; - p += ent-links[l].nr_of_remote_pads; - } - for (l = ent-num_inputs; l ent-num_inputs + ent-outputs; l++) { + for (l = 0; l ent-pads; l++) { if (copy_to_user(uios-remote_pads + p, ent-links[l].remote_pads, ent-links[l].nr_of_remote_pads * sizeof(ent-links[l].remote_pads[0]))) return -EFAULT; Index: v4l-dvb-mc/linux/include/linux/videodev2.h === --- v4l-dvb-mc.orig/linux/include/linux/videodev2.h +++ v4l-dvb-mc/linux/include/linux/videodev2.h @@ -1554,15 +1554,18 @@ struct v4l2_dbg_chip_ident { #define V4L2_SUBDEV_TYPE_VID_ENCODER 2 #define V4L2_SUBDEV_TYPE_MISC 3 +#define V4L2_PAD_TYPE_INPUT1 +#define V4L2_PAD_TYPE_OUTPUT 2 struct v4l2_mc_io { __u32 entity; /* entity ID */ - __u8 io;/* input or output index */ + __u8 pad; /* pad index */ }; struct v4l2_mc_io_status { __u32 active_pads; __u8 nr_of_remote_pads; + __u32 type; /* pad type */ }; struct v4l2_mc_entity { @@ -1571,8 +1574,7 @@ struct v4l2_mc_entity { char descr[256]; __u32 type; __u32 subtype; - __u8 inputs; - __u8 outputs; + __u8 pads; __u32 total_possible_links; union { @@ -1595,7 +1597,7 @@ struct v4l2_mc_entity { struct v4l2_mc_ios { __u32 entity; - /* Should have enough room for inputs+outputs elements */ + /* Should have enough room for pads elements */ struct v4l2_mc_io_status *status; /* Should have enough room for total_possible_links elements */ struct v4l2_mc_io *remote_pads; Index: v4l-dvb-mc/linux/include/media/v4l2-mc.h === --- v4l-dvb-mc.orig/linux/include/media/v4l2-mc.h +++ v4l-dvb-mc/linux/include/media/v4l2-mc.h @@ -17,11 +17,9
[RFC/PATCH 03/14] v4l-mc: Replace the active pads bitmask by a link flag
Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com Index: v4l-dvb-mc/linux/drivers/media/video/v4l2-device.c === --- v4l-dvb-mc.orig/linux/drivers/media/video/v4l2-device.c +++ v4l-dvb-mc/linux/drivers/media/video/v4l2-device.c @@ -145,10 +145,8 @@ static long mc_enum_links(struct v4l2_de for (l = 0; l ent-pads; l++, s++) { struct v4l2_mc_io_status stat = { 0, 0 }; - if (ent-links) { - stat.active_pads = ent-links[l].active; + if (ent-links) stat.nr_of_remote_pads = ent-links[l].nr_of_remote_pads; - } if (copy_to_user(uios-status + s, stat, sizeof(stat))) return -EFAULT; } Index: v4l-dvb-mc/linux/include/linux/videodev2.h === --- v4l-dvb-mc.orig/linux/include/linux/videodev2.h +++ v4l-dvb-mc/linux/include/linux/videodev2.h @@ -1560,10 +1560,10 @@ struct v4l2_dbg_chip_ident { struct v4l2_mc_io { __u32 entity; /* entity ID */ __u8 pad; /* pad index */ + __u8 active;/* link is active */ }; struct v4l2_mc_io_status { - __u32 active_pads; __u8 nr_of_remote_pads; __u32 type; /* pad type */ }; Index: v4l-dvb-mc/linux/include/media/v4l2-mc.h === --- v4l-dvb-mc.orig/linux/include/media/v4l2-mc.h +++ v4l-dvb-mc/linux/include/media/v4l2-mc.h @@ -4,7 +4,6 @@ #include linux/list.h struct v4l2_entity_io { - u32 active; /* bitmask of active remote pads */ u8 nr_of_remote_pads; /* number of remote pads */ struct v4l2_mc_io *remote_pads; /* specify possible remote pads */ }; @@ -68,10 +67,10 @@ static inline void v4l2_entity_connect(s sink_link = sink-pads++; source-links[source_link].remote_pads[0].entity = sink-id; source-links[source_link].remote_pads[0].pad = sink_link; - source-links[source_link].active = active; + source-links[source_link].remote_pads[0].active = active; sink-links[sink_link].remote_pads[0].entity = source-id; sink-links[sink_link].remote_pads[0].pad = source_link; - sink-links[sink_link].active = active; + sink-links[sink_link].remote_pads[0].active = active; } #endif -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC/PATCH 05/14] v4l-mc: Clean up link API
Make the link API easier to use and more intuitive by introducing pad and link objects. The entity API is now made of two functions: - v4l2_entity_init() initializes an entity. The caller must provide an array of pads as well as an estimated number of links. The links array is allocated dynamically and will be reallocated if it grows beyond the initial estimate. - v4l2_entity_connect() connects two entities. An entry in the link array of each entity is allocated and stores pointers to source and sink pads. Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com Index: v4l-dvb-mc/linux/drivers/media/video/Makefile === --- v4l-dvb-mc.orig/linux/drivers/media/video/Makefile +++ v4l-dvb-mc/linux/drivers/media/video/Makefile @@ -10,7 +10,7 @@ stkwebcam-objs:= stk-webcam.o stk-senso omap2cam-objs := omap24xxcam.o omap24xxcam-dma.o -videodev-objs := v4l2-dev.o v4l2-ioctl.o v4l2-device.o +videodev-objs := v4l2-dev.o v4l2-ioctl.o v4l2-device.o v4l2-mc.o # V4L2 core modules Index: v4l-dvb-mc/linux/drivers/media/video/ivtv/ivtv-driver.c === --- v4l-dvb-mc.orig/linux/drivers/media/video/ivtv/ivtv-driver.c +++ v4l-dvb-mc/linux/drivers/media/video/ivtv/ivtv-driver.c @@ -697,11 +697,11 @@ static int __devinit ivtv_init_struct1(s v4l2_subdev_init(itv-sd_encoder, NULL); v4l2_subdev_init(itv-sd_decoder, NULL); strlcpy(itv-sd_encoder.name, MPEG encoder, sizeof(itv-sd_encoder.name)); - v4l2_entity_prep(itv-sd_encoder.entity, SD_ENC_NUM_INPUTS + SD_ENC_NUM_OUTPUTS, - itv-sd_enc_links, itv-sd_enc_remote); - v4l2_entity_prep(itv-sd_decoder.entity, SD_DEC_NUM_INPUTS + SD_DEC_NUM_OUTPUTS, - itv-sd_dec_links, itv-sd_dec_remote); strlcpy(itv-sd_decoder.name, MPEG decoder, sizeof(itv-sd_decoder.name)); + v4l2_entity_init(itv-sd_encoder.entity, SD_ENC_NUM_PADS, +itv-sd_encoder_pads, 0); + v4l2_entity_init(itv-sd_decoder.entity, SD_DEC_NUM_PADS, +itv-sd_decoder_pads, 0); err = v4l2_device_register_subdev(itv-v4l2_dev, itv-sd_encoder); if (err) return err; @@ -1020,7 +1020,7 @@ static int __devinit ivtv_probe(struct p retval = v4l2_device_register_subdev(itv-v4l2_dev, itv-sd_decoder); if (retval) goto free_io; - v4l2_entity_connect(itv-sd_encoder.entity, itv-sd_decoder.entity, 0); + v4l2_entity_connect(itv-sd_encoder.entity, 0, itv-sd_decoder.entity, 0, 0); } else { itv-dec_mem = itv-enc_mem; Index: v4l-dvb-mc/linux/drivers/media/video/ivtv/ivtv-driver.h === --- v4l-dvb-mc.orig/linux/drivers/media/video/ivtv/ivtv-driver.h +++ v4l-dvb-mc/linux/drivers/media/video/ivtv/ivtv-driver.h @@ -321,6 +321,8 @@ struct ivtv_stream { const char *name; /* name of the stream */ int type; /* stream type */ + struct v4l2_entity_pad pad; + u32 id; spinlock_t qlock; /* locks access to the queues */ unsigned long s_flags; /* status flags, see above */ @@ -615,18 +617,13 @@ struct ivtv { struct v4l2_device v4l2_dev; struct v4l2_subdev sd_gpio; /* GPIO sub-device */ - struct v4l2_entity_io sd_gpio_links; - struct v4l2_mc_io sd_gpio_remote; + struct v4l2_entity_pad sd_gpio_pad; struct v4l2_subdev sd_encoder; /* Bridge encoder sub-device */ -#define SD_ENC_NUM_INPUTS (10) -#define SD_ENC_NUM_OUTPUTS (10) - struct v4l2_entity_io sd_enc_links[SD_ENC_NUM_INPUTS + SD_ENC_NUM_OUTPUTS]; - struct v4l2_mc_io sd_enc_remote[SD_ENC_NUM_INPUTS + SD_ENC_NUM_OUTPUTS]; +#define SD_ENC_NUM_PADS20 /* 10 inputs, 10 outputs */ + struct v4l2_entity_pad sd_encoder_pads[SD_ENC_NUM_PADS]; struct v4l2_subdev sd_decoder; /* Bridge decoder sub-device */ -#define SD_DEC_NUM_INPUTS (10) -#define SD_DEC_NUM_OUTPUTS (10) - struct v4l2_entity_io sd_dec_links[SD_DEC_NUM_INPUTS + SD_DEC_NUM_OUTPUTS]; - struct v4l2_mc_io sd_dec_remote[SD_DEC_NUM_INPUTS + SD_DEC_NUM_OUTPUTS]; +#define SD_DEC_NUM_PADS20 /* 10 inputs, 10 outputs */ + struct v4l2_entity_pad sd_decoder_pads[SD_DEC_NUM_PADS]; u16 instance; /* High-level state info */ @@ -653,8 +650,6 @@ struct ivtv { /* Streams */ int stream_buf_size[IVTV_MAX_STREAMS]; /* stream buffer size */ struct ivtv_stream streams[IVTV_MAX_STREAMS]; /* stream data */ - struct v4l2_entity_io stream_links[IVTV_MAX_STREAMS]; - struct v4l2_mc_io stream_remote[IVTV_MAX_STREAMS]; atomic_t capturing; /* count number
[RFC/PATCH 10/14] uvcvideo: Fix extension units parsing
The bNrInPins field is an 8 bit integer, not a 16 bit integer. Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com Index: v4l-dvb-mc/linux/drivers/media/video/uvc/uvc_driver.c === --- v4l-dvb-mc.orig/linux/drivers/media/video/uvc/uvc_driver.c +++ v4l-dvb-mc/linux/drivers/media/video/uvc/uvc_driver.c @@ -835,7 +835,7 @@ static int uvc_parse_vendor_control(stru unit-type = UVC_VC_EXTENSION_UNIT; memcpy(unit-extension.guidExtensionCode, buffer[4], 16); unit-extension.bNumControls = buffer[20]; - unit-extension.bNrInPins = get_unaligned_le16(buffer[21]); + unit-extension.bNrInPins = buffer[21]; unit-extension.baSourceID = (__u8 *)unit + sizeof *unit; memcpy(unit-extension.baSourceID, buffer[22], p); unit-extension.bControlSize = buffer[22+p]; @@ -1099,7 +1099,7 @@ static int uvc_parse_standard_control(st unit-type = buffer[2]; memcpy(unit-extension.guidExtensionCode, buffer[4], 16); unit-extension.bNumControls = buffer[20]; - unit-extension.bNrInPins = get_unaligned_le16(buffer[21]); + unit-extension.bNrInPins = buffer[21]; unit-extension.baSourceID = (__u8 *)unit + sizeof *unit; memcpy(unit-extension.baSourceID, buffer[22], p); unit-extension.bControlSize = buffer[22+p]; -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC/PATCH 14/14] uvcvideo: Register subdevices for each entity
Userspace applications can now discover the UVC device topology using the media controller API. Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com Index: v4l-dvb-mc/linux/drivers/media/video/uvc/uvc_driver.c === --- v4l-dvb-mc.orig/linux/drivers/media/video/uvc/uvc_driver.c +++ v4l-dvb-mc/linux/drivers/media/video/uvc/uvc_driver.c @@ -762,9 +762,12 @@ static struct uvc_entity *uvc_alloc_enti struct uvc_entity *entity; unsigned int num_inputs; unsigned int size; + unsigned int i; + extra_size = ALIGN(extra_size, sizeof(*entity-pads)); num_inputs = (type UVC_TERM_OUTPUT) ? num_pads : num_pads - 1; - size = sizeof(*entity) + extra_size + num_inputs; + size = sizeof(*entity) + extra_size + sizeof(*entity-pads) * num_pads ++ num_inputs; entity = kzalloc(size, GFP_KERNEL); if (entity == NULL) return NULL; @@ -772,8 +775,17 @@ static struct uvc_entity *uvc_alloc_enti entity-id = id; entity-type = type; + entity-num_links = 0; + entity-num_pads = num_pads; + entity-pads = ((void *)(entity + 1)) + extra_size; + + for (i = 0; i num_inputs; ++i) + entity-pads[i].type = V4L2_PAD_TYPE_INPUT; + if (!UVC_ENTITY_IS_OTERM(entity)) + entity-pads[num_pads-1].type = V4L2_PAD_TYPE_OUTPUT; + entity-bNrInPins = num_inputs; - entity-baSourceID = ((__u8 *)entity) + sizeof(*entity) + extra_size; + entity-baSourceID = (__u8 *)(entity-pads[num_pads]); return entity; } @@ -1158,6 +1170,77 @@ next_descriptor: } /* + * Video subdevices registration and unregistration + */ + +static int uvc_mc_register_subdev(struct uvc_video_chain *chain, + struct uvc_entity *entity) +{ + const u32 flags = V4L2_LINK_FLAG_ACTIVE | V4L2_LINK_FLAG_PERMANENT; + struct uvc_entity *remote; + unsigned int i; + u8 remote_pad; + int ret; + + for (i = 0; i entity-num_pads; ++i) { + if (entity-pads[i].type != V4L2_PAD_TYPE_INPUT) + continue; + + remote = uvc_entity_by_id(chain-dev, entity-baSourceID[i]); + if (remote == NULL) + return -EINVAL; + + remote_pad = remote-num_pads - 1; + ret = v4l2_entity_connect(remote-subdev.entity, remote_pad, + entity-subdev.entity, i, flags); + if (ret 0) + return ret; + } + + return v4l2_device_register_subdev(chain-dev-vdev, entity-subdev); +} + +static struct v4l2_subdev_ops uvc_subdev_ops = { +}; + +static int uvc_mc_init_subdev(struct uvc_video_chain *chain, + struct uvc_entity *entity) +{ + v4l2_subdev_init(entity-subdev, uvc_subdev_ops); + snprintf(entity-subdev.name, sizeof(entity-subdev.name), uvc-%u, +entity-id); + + return v4l2_entity_init(entity-subdev.entity, entity-num_pads, + entity-pads, 0); +} + +static int uvc_mc_register_subdevs(struct uvc_video_chain *chain) +{ + struct uvc_entity *entity; + int ret; + + list_for_each_entry(entity, chain-entities, chain) { + ret = uvc_mc_init_subdev(chain, entity); + if (ret 0) { + uvc_printk(KERN_INFO, Failed to initialize subdev for + entity %u\n, entity-id); + return ret; + } + } + + list_for_each_entry(entity, chain-entities, chain) { + ret = uvc_mc_register_subdev(chain, entity); + if (ret 0) { + uvc_printk(KERN_INFO, Failed to register subdev for + entity %u\n, entity-id); + return ret; + } + } + + return 0; +} + +/* * UVC device scan */ @@ -1708,6 +1791,12 @@ static int uvc_register_chains(struct uv ret = uvc_register_terms(dev, chain); if (ret 0) return ret; + + ret = uvc_mc_register_subdevs(chain); + if (ret 0) { + uvc_printk(KERN_INFO, Failed to register subdevs + (%d).\n, ret); + } } return 0; Index: v4l-dvb-mc/linux/drivers/media/video/uvc/uvcvideo.h === --- v4l-dvb-mc.orig/linux/drivers/media/video/uvc/uvcvideo.h +++ v4l-dvb-mc/linux/drivers/media/video/uvc/uvcvideo.h @@ -278,6 +278,12 @@ struct uvc_entity { __u16 type; char name[64]; + /* Media controller-related fields. */ +
[RFC/PATCH 13/14] uvcvideo: Register a v4l2_device
As a first step to the media controller integration register a v4l2_device for each UVC control interface and make the video_device a child of the v4l2_device. Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com Index: v4l-dvb-mc/linux/drivers/media/video/uvc/uvc_driver.c === --- v4l-dvb-mc.orig/linux/drivers/media/video/uvc/uvc_driver.c +++ v4l-dvb-mc/linux/drivers/media/video/uvc/uvc_driver.c @@ -1544,6 +1544,9 @@ static void uvc_delete(struct uvc_device uvc_status_cleanup(dev); uvc_ctrl_cleanup_device(dev); + if (dev-vdev.name[0]) + v4l2_device_unregister(dev-vdev); + list_for_each_safe(p, n, dev-chains) { struct uvc_video_chain *chain; chain = list_entry(p, struct uvc_video_chain, list); @@ -1641,7 +1644,7 @@ static int uvc_register_video(struct uvc * unregistered before the reference is released, so we don't need to * get another one. */ - vdev-parent = dev-intf-dev; + vdev-entity.parent = dev-vdev; vdev-minor = -1; vdev-fops = uvc_fops; vdev-release = uvc_release; @@ -1772,6 +1775,10 @@ static int uvc_probe(struct usb_interfac linux-uvc-devel mailing list.\n); } + /* Register the V4L2 device. */ + if (v4l2_device_register(intf-dev, dev-vdev) 0) + goto error; + /* Initialize controls. */ if (uvc_ctrl_init_device(dev) 0) goto error; @@ -1780,7 +1787,7 @@ static int uvc_probe(struct usb_interfac if (uvc_scan_device(dev) 0) goto error; - /* Register video devices. */ + /* Register video device nodes. */ if (uvc_register_chains(dev) 0) goto error; Index: v4l-dvb-mc/linux/drivers/media/video/uvc/uvcvideo.h === --- v4l-dvb-mc.orig/linux/drivers/media/video/uvc/uvcvideo.h +++ v4l-dvb-mc/linux/drivers/media/video/uvc/uvcvideo.h @@ -68,6 +68,7 @@ struct uvc_xu_control { #include linux/poll.h #include linux/usb/video.h +#include media/v4l2-device.h #include compat.h /* -- @@ -476,6 +477,7 @@ struct uvc_device { atomic_t users; /* Video control interface */ + struct v4l2_device vdev; __u16 uvc_version; __u32 clock_frequency; -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC/PATCH 11/14] uvcvideo: Refactor chain scan
Don't handle the first output terminal in a chain in a special way. Use uvc_scan_chain_entity() like for all other entities, making the chain scan code more generic. Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com Index: v4l-dvb-mc/linux/drivers/media/video/uvc/uvc_driver.c === --- v4l-dvb-mc.orig/linux/drivers/media/video/uvc/uvc_driver.c +++ v4l-dvb-mc/linux/drivers/media/video/uvc/uvc_driver.c @@ -1256,13 +1256,12 @@ static int uvc_scan_chain_entity(struct break; case UVC_TT_STREAMING: - if (uvc_trace_param UVC_TRACE_PROBE) - printk( - IT %d\n, entity-id); - - if (!UVC_ENTITY_IS_ITERM(entity)) { - uvc_trace(UVC_TRACE_DESCR, Unsupported input - terminal %u.\n, entity-id); - return -1; + if (UVC_ENTITY_IS_ITERM(entity)) { + if (uvc_trace_param UVC_TRACE_PROBE) + printk( - IT %d\n, entity-id); + } else { + if (uvc_trace_param UVC_TRACE_PROBE) + printk( OT %d, entity-id); } break; @@ -1342,10 +1341,11 @@ static int uvc_scan_chain_forward(struct } static int uvc_scan_chain_backward(struct uvc_video_chain *chain, - struct uvc_entity *entity) + struct uvc_entity **_entity) { + struct uvc_entity *entity = *_entity; struct uvc_entity *term; - int id = -1, i; + int id = -EINVAL, i; switch (UVC_ENTITY_TYPE(entity)) { case UVC_VC_EXTENSION_UNIT: @@ -1389,34 +1389,49 @@ static int uvc_scan_chain_backward(struc id = 0; break; + + case UVC_ITT_VENDOR_SPECIFIC: + case UVC_ITT_CAMERA: + case UVC_ITT_MEDIA_TRANSPORT_INPUT: + case UVC_OTT_VENDOR_SPECIFIC: + case UVC_OTT_DISPLAY: + case UVC_OTT_MEDIA_TRANSPORT_OUTPUT: + case UVC_TT_STREAMING: + id = UVC_ENTITY_IS_OTERM(entity) ? entity-output.bSourceID : 0; + break; + } + + if (id = 0) { + *_entity = NULL; + return id; + } + + entity = uvc_entity_by_id(chain-dev, id); + if (entity == NULL) { + uvc_trace(UVC_TRACE_DESCR, Found reference to + unknown entity %d.\n, id); + return -EINVAL; } - return id; + *_entity = entity; + return 0; } static int uvc_scan_chain(struct uvc_video_chain *chain, - struct uvc_entity *oterm) + struct uvc_entity *term) { struct uvc_entity *entity, *prev; - int id; - entity = oterm; - list_add_tail(entity-chain, chain-entities); - uvc_trace(UVC_TRACE_PROBE, Scanning UVC chain: OT %d, entity-id); + uvc_trace(UVC_TRACE_PROBE, Scanning UVC chain:); - id = entity-output.bSourceID; - while (id != 0) { - prev = entity; - entity = uvc_entity_by_id(chain-dev, id); - if (entity == NULL) { - uvc_trace(UVC_TRACE_DESCR, Found reference to - unknown entity %d.\n, id); - return -EINVAL; - } + entity = term; + prev = NULL; + while (entity != NULL) { + /* Entity must not be part of an existing chain */ if (entity-chain.next || entity-chain.prev) { uvc_trace(UVC_TRACE_DESCR, Found reference to - entity %d already in chain.\n, id); + entity %d already in chain.\n, entity-id); return -EINVAL; } @@ -1428,14 +1443,10 @@ static int uvc_scan_chain(struct uvc_vid if (uvc_scan_chain_forward(chain, entity, prev) 0) return -EINVAL; - /* Stop when a terminal is found. */ - if (UVC_ENTITY_IS_TERM(entity)) - break; - /* Backward scan */ - id = uvc_scan_chain_backward(chain, entity); - if (id 0) - return id; + prev = entity; + if (uvc_scan_chain_backward(chain, entity) 0) + return -EINVAL; } return 0; -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC/PATCH 06/14] v4l-mc: Remove subdev v4l2_dev field
A pointer to the v4l2_device is stored in the v4l2_entity structure that v4l2_subdev derives from. There is no need to hold an extra copy of the pointer. Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com Index: v4l-dvb-mc/linux/include/media/v4l2-subdev.h === --- v4l-dvb-mc.orig/linux/include/media/v4l2-subdev.h +++ v4l-dvb-mc/linux/include/media/v4l2-subdev.h @@ -261,7 +261,6 @@ struct v4l2_subdev { struct v4l2_entity entity; struct module *owner; u32 flags; - struct v4l2_device *v4l2_dev; const struct v4l2_subdev_ops *ops; /* name must be unique */ char name[V4L2_SUBDEV_NAME_SIZE]; @@ -290,7 +289,6 @@ static inline void v4l2_subdev_init(stru sd-entity.subtype = V4L2_SUBDEV_TYPE_MISC; sd-entity.name = sd-name; sd-ops = ops; - sd-v4l2_dev = NULL; sd-flags = 0; sd-name[0] = '\0'; sd-grp_id = 0; @@ -308,7 +306,7 @@ static inline void v4l2_subdev_init(stru /* Send a notification to v4l2_device. */ #define v4l2_subdev_notify(sd, notification, arg) \ - ((!(sd) || !(sd)-v4l2_dev || !(sd)-v4l2_dev-notify) ? -ENODEV : \ -(sd)-v4l2_dev-notify((sd), (notification), (arg))) + ((!(sd) || !(sd)-entity.parent || !(sd)-entity.parent-notify) ? \ + -ENODEV : (sd)-entity.parent-notify((sd), (notification), (arg))) #endif Index: v4l-dvb-mc/linux/drivers/media/video/bt819.c === --- v4l-dvb-mc.orig/linux/drivers/media/video/bt819.c +++ v4l-dvb-mc/linux/drivers/media/video/bt819.c @@ -256,7 +256,7 @@ static int bt819_s_std(struct v4l2_subde v4l2_dbg(1, debug, sd, set norm %llx\n, (unsigned long long)std); - if (sd-v4l2_dev == NULL || sd-v4l2_dev-notify == NULL) + if (sd-entity.parent == NULL || sd-entity.parent-notify == NULL) v4l2_err(sd, no notify found!\n); if (std V4L2_STD_NTSC) { @@ -308,7 +308,7 @@ static int bt819_s_routing(struct v4l2_s if (input 0 || input 7) return -EINVAL; - if (sd-v4l2_dev == NULL || sd-v4l2_dev-notify == NULL) + if (sd-entity.parent == NULL || sd-entity.parent-notify == NULL) v4l2_err(sd, no notify found!\n); if (decoder-input != input) { Index: v4l-dvb-mc/linux/drivers/media/video/v4l2-device.c === --- v4l-dvb-mc.orig/linux/drivers/media/video/v4l2-device.c +++ v4l-dvb-mc/linux/drivers/media/video/v4l2-device.c @@ -333,10 +333,10 @@ int v4l2_device_register_subdev(struct v if (v4l2_dev == NULL || sd == NULL || !sd-name[0]) return -EINVAL; /* Warn if we apparently re-register a subdev */ - WARN_ON(sd-v4l2_dev != NULL); + WARN_ON(sd-entity.parent != NULL); if (!try_module_get(sd-owner)) return -ENODEV; - sd-v4l2_dev = v4l2_dev; + sd-entity.parent = v4l2_dev; spin_lock(v4l2_dev-lock); sd-entity.id = v4l2_dev-subdev_id++; list_add_tail(sd-entity.list, v4l2_dev-subdevs); @@ -348,12 +348,12 @@ EXPORT_SYMBOL_GPL(v4l2_device_register_s void v4l2_device_unregister_subdev(struct v4l2_subdev *sd) { /* return if it isn't registered */ - if (sd == NULL || sd-v4l2_dev == NULL) + if (sd == NULL || sd-entity.parent == NULL) return; - spin_lock(sd-v4l2_dev-lock); + spin_lock(sd-entity.parent-lock); list_del(sd-entity.list); - spin_unlock(sd-v4l2_dev-lock); - sd-v4l2_dev = NULL; + spin_unlock(sd-entity.parent-lock); + sd-entity.parent = NULL; module_put(sd-owner); } EXPORT_SYMBOL_GPL(v4l2_device_unregister_subdev); Index: v4l-dvb-mc/linux/drivers/media/video/zoran/zoran_card.c === --- v4l-dvb-mc.orig/linux/drivers/media/video/zoran/zoran_card.c +++ v4l-dvb-mc/linux/drivers/media/video/zoran/zoran_card.c @@ -1196,7 +1196,7 @@ zoran_setup_videocodec (struct zoran *zr static void zoran_subdev_notify(struct v4l2_subdev *sd, unsigned int cmd, void *arg) { - struct zoran *zr = to_zoran(sd-v4l2_dev); + struct zoran *zr = to_zoran(sd-entity.parent); /* Bt819 needs to reset its FIFO buffer using #FRST pin and LML33 card uses GPIO(7) for that. */ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC/PATCH 09/14] uvcvideo: Merge iterms, oterms and extensions linked lists
All terminals and units are now added to a single linked list of entities per chain. This makes terminals and units handling code more generic. Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com Index: v4l-dvb-mc/linux/drivers/media/video/uvc/uvc_ctrl.c === --- v4l-dvb-mc.orig/linux/drivers/media/video/uvc/uvc_ctrl.c +++ v4l-dvb-mc/linux/drivers/media/video/uvc/uvc_ctrl.c @@ -744,17 +744,7 @@ struct uvc_control *uvc_find_control(str v4l2_id = V4L2_CTRL_ID_MASK; /* Find the control. */ - __uvc_find_control(chain-processing, v4l2_id, mapping, ctrl, next); - if (ctrl !next) - return ctrl; - - list_for_each_entry(entity, chain-iterms, chain) { - __uvc_find_control(entity, v4l2_id, mapping, ctrl, next); - if (ctrl !next) - return ctrl; - } - - list_for_each_entry(entity, chain-extensions, chain) { + list_for_each_entry(entity, chain-entities, chain) { __uvc_find_control(entity, v4l2_id, mapping, ctrl, next); if (ctrl !next) return ctrl; @@ -946,17 +936,7 @@ int __uvc_ctrl_commit(struct uvc_video_c int ret = 0; /* Find the control. */ - ret = uvc_ctrl_commit_entity(chain-dev, chain-processing, rollback); - if (ret 0) - goto done; - - list_for_each_entry(entity, chain-iterms, chain) { - ret = uvc_ctrl_commit_entity(chain-dev, entity, rollback); - if (ret 0) - goto done; - } - - list_for_each_entry(entity, chain-extensions, chain) { + list_for_each_entry(entity, chain-entities, chain) { ret = uvc_ctrl_commit_entity(chain-dev, entity, rollback); if (ret 0) goto done; @@ -1070,8 +1050,9 @@ int uvc_xu_ctrl_query(struct uvc_video_c int ret; /* Find the extension unit. */ - list_for_each_entry(entity, chain-extensions, chain) { - if (entity-id == xctrl-unit) + list_for_each_entry(entity, chain-entities, chain) { + if (UVC_ENTITY_TYPE(entity) == UVC_VC_EXTENSION_UNIT + entity-id == xctrl-unit) break; } Index: v4l-dvb-mc/linux/drivers/media/video/uvc/uvc_driver.c === --- v4l-dvb-mc.orig/linux/drivers/media/video/uvc/uvc_driver.c +++ v4l-dvb-mc/linux/drivers/media/video/uvc/uvc_driver.c @@ -1215,7 +1215,6 @@ static int uvc_scan_chain_entity(struct return -1; } - list_add_tail(entity-chain, chain-extensions); break; case UVC_VC_PROCESSING_UNIT: @@ -1254,7 +1253,6 @@ static int uvc_scan_chain_entity(struct if (uvc_trace_param UVC_TRACE_PROBE) printk( - IT %d\n, entity-id); - list_add_tail(entity-chain, chain-iterms); break; case UVC_TT_STREAMING: @@ -1267,7 +1265,6 @@ static int uvc_scan_chain_entity(struct return -1; } - list_add_tail(entity-chain, chain-iterms); break; default: @@ -1276,6 +1273,7 @@ static int uvc_scan_chain_entity(struct return -1; } + list_add_tail(entity-chain, chain-entities); return 0; } @@ -1306,7 +1304,7 @@ static int uvc_scan_chain_forward(struct return -EINVAL; } - list_add_tail(forward-chain, chain-extensions); + list_add_tail(forward-chain, chain-entities); if (uvc_trace_param UVC_TRACE_PROBE) { if (!found) printk( (-); @@ -1326,7 +1324,7 @@ static int uvc_scan_chain_forward(struct return -EINVAL; } - list_add_tail(forward-chain, chain-oterms); + list_add_tail(forward-chain, chain-entities); if (uvc_trace_param UVC_TRACE_PROBE) { if (!found) printk( (-); @@ -1382,7 +1380,7 @@ static int uvc_scan_chain_backward(struc if (uvc_trace_param UVC_TRACE_PROBE) printk( %d, term-id); - list_add_tail(term-chain, chain-iterms); + list_add_tail(term-chain, chain-entities); uvc_scan_chain_forward(chain, term, entity); } @@ -1403,7 +1401,7 @@ static int uvc_scan_chain(struct uvc_vid int id; entity = oterm; - list_add_tail(entity-chain, chain-oterms); +
[RFC/PATCH 12/14] uvcvideo: Factorize common field in uvc_entity structure
The bNrInPins and baSourceID fields are common among all entities (some of use bSourceID but this is conceptually the same). Move those two fields out of entity type-specific unions into the uvc_entity structure top level. Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com Index: v4l-dvb-mc/linux/drivers/media/video/uvc/uvc_driver.c === --- v4l-dvb-mc.orig/linux/drivers/media/video/uvc/uvc_driver.c +++ v4l-dvb-mc/linux/drivers/media/video/uvc/uvc_driver.c @@ -248,29 +248,9 @@ static struct uvc_entity *uvc_entity_by_ entity = list_entry(dev-entities, struct uvc_entity, list); list_for_each_entry_continue(entity, dev-entities, list) { - switch (UVC_ENTITY_TYPE(entity)) { - case UVC_TT_STREAMING: - if (entity-output.bSourceID == id) + for (i = 0; i entity-bNrInPins; ++i) + if (entity-baSourceID[i] == id) return entity; - break; - - case UVC_VC_PROCESSING_UNIT: - if (entity-processing.bSourceID == id) - return entity; - break; - - case UVC_VC_SELECTOR_UNIT: - for (i = 0; i entity-selector.bNrInPins; ++i) - if (entity-selector.baSourceID[i] == id) - return entity; - break; - - case UVC_VC_EXTENSION_UNIT: - for (i = 0; i entity-extension.bNrInPins; ++i) - if (entity-extension.baSourceID[i] == id) - return entity; - break; - } } return NULL; @@ -776,6 +756,28 @@ error: return ret; } +static struct uvc_entity *uvc_alloc_entity(u16 type, u8 id, + unsigned int num_pads, unsigned int extra_size) +{ + struct uvc_entity *entity; + unsigned int num_inputs; + unsigned int size; + + num_inputs = (type UVC_TERM_OUTPUT) ? num_pads : num_pads - 1; + size = sizeof(*entity) + extra_size + num_inputs; + entity = kzalloc(size, GFP_KERNEL); + if (entity == NULL) + return NULL; + + entity-id = id; + entity-type = type; + + entity-bNrInPins = num_inputs; + entity-baSourceID = ((__u8 *)entity) + sizeof(*entity) + extra_size; + + return entity; +} + /* Parse vendor-specific extensions. */ static int uvc_parse_vendor_control(struct uvc_device *dev, const unsigned char *buffer, int buflen) @@ -827,21 +829,18 @@ static int uvc_parse_vendor_control(stru break; } - unit = kzalloc(sizeof *unit + p + 2*n, GFP_KERNEL); + unit = uvc_alloc_entity(UVC_VC_EXTENSION_UNIT, buffer[3], + p + 1, 2*n); if (unit == NULL) return -ENOMEM; - unit-id = buffer[3]; - unit-type = UVC_VC_EXTENSION_UNIT; memcpy(unit-extension.guidExtensionCode, buffer[4], 16); unit-extension.bNumControls = buffer[20]; - unit-extension.bNrInPins = buffer[21]; - unit-extension.baSourceID = (__u8 *)unit + sizeof *unit; - memcpy(unit-extension.baSourceID, buffer[22], p); + memcpy(unit-baSourceID, buffer[22], p); unit-extension.bControlSize = buffer[22+p]; - unit-extension.bmControls = (__u8 *)unit + sizeof *unit + p; - unit-extension.bmControlsType = (__u8 *)unit + sizeof *unit - + p + n; + unit-extension.bmControls = (__u8 *)unit + sizeof(*unit); + unit-extension.bmControlsType = (__u8 *)unit + sizeof(*unit) + + n; memcpy(unit-extension.bmControls, buffer[23+p], 2*n); if (buffer[24+p+2*n] != 0) @@ -938,13 +937,11 @@ static int uvc_parse_standard_control(st return -EINVAL; } - term = kzalloc(sizeof *term + n + p, GFP_KERNEL); + term = uvc_alloc_entity(type | UVC_TERM_INPUT, buffer[3], + 1, n + p); if (term == NULL) return -ENOMEM; - term-id = buffer[3]; - term-type = type | UVC_TERM_INPUT; - if (UVC_ENTITY_TYPE(term) == UVC_ITT_CAMERA) { term-camera.bControlSize = n; term-camera.bmControls = (__u8 *)term + sizeof *term; @@ -999,13 +996,12 @@ static int uvc_parse_standard_control(st return 0; } - term =
[RFC/PATCH 08/14] uvcvideo: Rely on videodev to reference-count the device
The uvcvideo driver has a driver-wide lock and a reference count to protect against a disconnect/open race. Now that videodev handles the race itself, reference-counting in the driver can be removed. This is a backport from the v4l-dvb tree. Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com --- a/linux/drivers/media/video/uvc/uvc_driver.cWed Sep 02 08:12:26 2009 +0200 +++ b/linux/drivers/media/video/uvc/uvc_driver.cWed Sep 30 02:07:19 2009 +0200 @@ -1531,22 +1531,92 @@ */ /* + * Delete the UVC device. + * + * Called by the kernel when the last reference to the uvc_device structure + * is released. + * + * As this function is called after or during disconnect(), all URBs have + * already been canceled by the USB core. There is no need to kill the + * interrupt URB manually. + */ +static void uvc_delete(struct uvc_device *dev) +{ + struct list_head *p, *n; + + usb_put_intf(dev-intf); + usb_put_dev(dev-udev); + + uvc_status_cleanup(dev); + uvc_ctrl_cleanup_device(dev); + + list_for_each_safe(p, n, dev-chains) { + struct uvc_video_chain *chain; + chain = list_entry(p, struct uvc_video_chain, list); + kfree(chain); + } + + list_for_each_safe(p, n, dev-entities) { + struct uvc_entity *entity; + entity = list_entry(p, struct uvc_entity, list); + kfree(entity); + } + + list_for_each_safe(p, n, dev-streams) { + struct uvc_streaming *streaming; + streaming = list_entry(p, struct uvc_streaming, list); + usb_driver_release_interface(uvc_driver.driver, + streaming-intf); + usb_put_intf(streaming-intf); + kfree(streaming-format); + kfree(streaming-header.bmaControls); + kfree(streaming); + } + + kfree(dev); +} + +static void uvc_release(struct video_device *vdev) +{ + struct uvc_streaming *stream = video_get_drvdata(vdev); + struct uvc_device *dev = stream-dev; + + video_device_release(vdev); + + /* Decrement the registered streams count and delete the device when it +* reaches zero. +*/ + if (atomic_dec_and_test(dev-nstreams)) + uvc_delete(dev); +} + +/* * Unregister the video devices. */ static void uvc_unregister_video(struct uvc_device *dev) { struct uvc_streaming *stream; + /* Unregistering all video devices might result in uvc_delete() being +* called from inside the loop if there's no open file handle. To avoid +* that, increment the stream count before iterating over the streams +* and decrement it when done. +*/ + atomic_inc(dev-nstreams); + list_for_each_entry(stream, dev-streams, list) { if (stream-vdev == NULL) continue; - if (stream-vdev-minor == -1) - video_device_release(stream-vdev); - else - video_unregister_device(stream-vdev); + video_unregister_device(stream-vdev); stream-vdev = NULL; } + + /* Decrement the stream count and call uvc_delete explicitly if there +* are no stream left. +*/ + if (atomic_dec_and_test(dev-nstreams)) + uvc_delete(dev); } static int uvc_register_video(struct uvc_device *dev, @@ -1580,7 +1650,7 @@ vdev-parent = dev-intf-dev; vdev-minor = -1; vdev-fops = uvc_fops; - vdev-release = video_device_release; + vdev-release = uvc_release; strlcpy(vdev-name, dev-name, sizeof vdev-name); /* Set the driver data before calling video_register_device, otherwise @@ -1598,6 +1668,7 @@ return ret; } + atomic_inc(dev-nstreams); return 0; } @@ -1653,61 +1724,6 @@ * USB probe, disconnect, suspend and resume */ -/* - * Delete the UVC device. - * - * Called by the kernel when the last reference to the uvc_device structure - * is released. - * - * Unregistering the video devices is done here because every opened instance - * must be closed before the device can be unregistered. An alternative would - * have been to use another reference count for uvc_v4l2_open/uvc_release, and - * unregister the video devices on disconnect when that reference count drops - * to zero. - * - * As this function is called after or during disconnect(), all URBs have - * already been canceled by the USB core. There is no need to kill the - * interrupt URB manually. - */ -void uvc_delete(struct kref *kref) -{ - struct uvc_device *dev = container_of(kref, struct uvc_device, kref); - struct list_head *p, *n; - - /* Unregister the video devices. */ - uvc_unregister_video(dev); - usb_put_intf(dev-intf); - usb_put_dev(dev-udev); - -
Re: uvcvideo causes ehci_hcd to halt
Ozan Çağlayan wrote On 14-10-2009 11:16: Alan Stern wrote On 13-10-2009 17:53: Can you add a dump_stack() call just after the ehci_err() line in drivers/usb/host/ehci-hcd.c:handshake_on_error_set_halt()? It should provide some clues. At the same time (i.e., during the same test) you should collect a usbmon trace. Alan Stern Hi. First the backtrace: [ 149.510272] uvcvideo: Found UVC 1.00 device BisonCam, NB Pro (5986:0203) [ 149.515017] input: BisonCam, NB Pro as /devices/pci:00/:00:1d.7/usb1/1-5/1-5:1.0/input/input10 [ 149.515588] usbcore: registered new interface driver uvcvideo [ 149.516247] USB Video Class driver (v0.1.0) [ 149.658012] Pid: 1137, comm: hald-probe-vide Tainted: G C 2.6.31.4-128 #2 [ 149.658012] Call Trace: [ 149.658012] [c0373f62] handshake_on_error_set_halt+0x36/0x65 [ 149.658012] [c0374073] enable_periodic+0x32/0x72 [ 149.658012] [c03741c9] qh_link_periodic+0x116/0x11e [ 149.658012] [c0374665] qh_schedule+0x120/0x12c [ 149.658012] [c03775d0] intr_submit+0x8c/0x124 [ 149.658012] [c0377d2a] ehci_urb_enqueue+0x7a/0xa5 [ 149.658012] [c036965f] usb_hcd_submit_urb+0xbb/0x13c [ 149.658012] [c0369b1e] usb_submit_urb+0x1f1/0x20d [ 149.658012] [f854aaff] uvc_status_start+0x18/0x1a [uvcvideo] [ 149.658012] [f8546e23] uvc_v4l2_open+0x8a/0xcf [uvcvideo] [ 149.658012] [f7c3d74a] v4l2_open+0x68/0x7c [videodev] [ 149.658012] [c01c648e] chrdev_open+0x125/0x13c [ 149.658012] [c01c28a9] __dentry_open+0x119/0x207 [ 149.658012] [c01c2a31] nameidata_to_filp+0x2c/0x43 [ 149.658012] [c01c6369] ? chrdev_open+0x0/0x13c [ 149.658012] [c01ccc28] do_filp_open+0x3e5/0x741 [ 149.658012] [c01ccfe9] ? getname+0x20/0xb7 [ 149.658012] [c01d4be8] ? alloc_fd+0x55/0xbe [ 149.658012] [c01c2699] do_sys_open+0x4a/0xe2 [ 149.658012] [c0435527] ? do_page_fault+0x2d6/0x304 [ 149.658012] [c01c2773] sys_open+0x1e/0x26 [ 149.658012] [c0103214] sysenter_do_call+0x12/0x28 [ 149.658012] ehci_hcd :00:1d.7: force halt; handhake f7c66024 4000 - -110 And the usbmon trace during modprobe uvcvideo can be found at: http://cekirdek.pardus.org.tr/~ozan/ivir/logs/usbmon.trace.bad I also manage to not reproduce the problem so it's kinda racy. You can find good/bad dmesg/usbmon traces at: http://cekirdek.pardus.org.tr/~ozan/ivir/logs ping! in case it's got lost between high traffic :) Thanks. -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Lifeview lv8h pci-e
I'd like to help to anyone who needs testing for this card. It seems that everyhting is recognized but the cx23885 needs something just to make it work. Thanks 2009/10/13 Oinatz Aspiazu oaspi...@gmail.com: Hello: I'm using an Arch Linux, kernel 2.6.30-ARCH. I've a Lifeview LV8H pci-e dvb-t (low profile card) , that says: # lspci -vv 03:00.0 Multimedia video controller: Conexant Systems, Inc. CX23885 PCI Video and Audio Decoder (rev 02) Subsystem: Conexant Systems, Inc. Device ec80 Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast TAbort- TAbort- MAbort- SERR- PERR- INTx- Latency: 0, Cache Line Size: 64 bytes Interrupt: pin A routed to IRQ 17 Region 0: Memory at fe80 (64-bit, non-prefetchable) [size=2M] Capabilities: access denied Kernel driver in use: cx23885 Kernel modules: cx23885 cx23885 driver version 0.0.2 loaded The cx23885 module, is supported by the kernel but does not seem to work for this device. If i load the module without parameters, I get: # dmesg | grep cx23885 ACPI: PCI Interrupt Link [LNEA] enabled at IRQ 17 cx23885 :03:00.0: PCI INT A - Link[LNEA] - GSI 17 (level, low) - IRQ 17 cx23885[0]: Your board isn't known (yet) to the driver. cx23885[0]: Try to pick one of the existing card configs via cx23885[0]: card=n insmod option. Updating to the latest cx23885[0]: version might help as well. cx23885[0]: Here is a list of valid choices for the card=n insmod option: cx23885[0]: card=0 - UNKNOWN/GENERIC cx23885[0]: card=1 - Hauppauge WinTV-HVR1800lp cx23885[0]: card=2 - Hauppauge WinTV-HVR1800 cx23885[0]: card=3 - Hauppauge WinTV-HVR1250 cx23885[0]: card=4 - DViCO FusionHDTV5 Express cx23885[0]: card=5 - Hauppauge WinTV-HVR1500Q cx23885[0]: card=6 - Hauppauge WinTV-HVR1500 cx23885[0]: card=7 - Hauppauge WinTV-HVR1200 cx23885[0]: card=8 - Hauppauge WinTV-HVR1700 cx23885[0]: card=9 - Hauppauge WinTV-HVR1400 cx23885[0]: card=10 - DViCO FusionHDTV7 Dual Express cx23885[0]: card=11 - DViCO FusionHDTV DVB-T Dual Express cx23885[0]: card=12 - Leadtek Winfast PxDVR3200 H cx23885[0]: card=13 - Compro VideoMate E650F cx23885[0]: card=14 - TurboSight TBS 6920 cx23885[0]: card=15 - TeVii S470 cx23885[0]: card=16 - DVBWorld DVB-S2 2005 cx23885[0]: card=17 - NetUP Dual DVB-S2 CI CORE cx23885[0]: subsystem: 14f1:ec80, board: UNKNOWN/GENERIC [card=0,autodetect ed] cx23885_dev_checkrevision() Hardware revision = 0xb0 cx23885[0]/0: found at :03:00.0, rev: 2, irq: 17, latency: 0, mmio: 0xfe8000 00 cx23885 :03:00.0: setting latency timer to 64 IRQ 17/cx23885[0]: IRQF_DISABLED is not guaranteed on shared IRQs Loading card=4, all the devices /dev/dvb/ are created (frontend,..). I get: # dmesg | grep cx23885 Código: Seleccionar todo cx23885 driver version 0.0.2 loaded cx23885 :03:00.0: PCI INT A - Link[LNEA] - GSI 17 (level, low) - IRQ 17 CORE cx23885[0]: subsystem: 14f1:ec80, board: DViCO FusionHDTV5 Express [card=4,insmod option] cx23885_dvb_register() allocating 1 frontend(s) cx23885[0]: cx23885 based dvb card DVB: registering new adapter (cx23885[0]) cx23885_dev_checkrevision() Hardware revision = 0xb0 cx23885[0]/0: found at :03:00.0, rev: 2, irq: 17, latency: 0, mmio: 0xfe80 cx23885 :03:00.0: setting latency timer to 64 IRQ 17/cx23885[0]: IRQF_DISABLED is not guaranteed on shared IRQs Going to Kaffeine or making an scan from the console, it says that is in mode ATSC and that is not compatable. I'm living in Spain, and I have used this card as a PAL system. initial transponder 54600 0 3 9 1 0 0 0 initial transponder 57800 0 2 9 3 0 0 0 initial transponder 625833000 0 2 9 3 0 0 0 initial transponder 705833000 0 3 9 1 0 0 0 initial transponder 649833000 0 3 9 1 0 0 0 initial transponder 673833000 0 3 9 1 0 0 0 WARNING: frontend type (ATSC) is not compatible with requested tuning type (OFDM) WARNING: frontend type (ATSC) is not compatible with requested tuning type (OFDM) WARNING: frontend type (ATSC) is not compatible with requested tuning type (OFDM) WARNING: frontend type (ATSC) is not compatible with requested tuning type (OFDM) WARNING: frontend type (ATSC) is not compatible with requested tuning type (OFDM) WARNING: frontend type (ATSC) is not compatible with requested tuning type (OFDM) ERROR: initial tuning failed I've tried all options from the driver from the list. Only card=4, seems to be valid. Anyone can help me? Thanks and sorry for my english, Oinatz Aspiazu -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at
Re: Re : ISDB-T tuner
so, which device can I buy, working in Japan, in linux, and in digital (working after 2011)? known to work devices 0. 774 Friio white http://www.friio.com/ (in Japanese) USB2.0 ISDB-T, with a card-reader device, without BCAS card DVB driver: in v4l-dvb main repository direct net shopping only, pretty expensive. card reader is very unstable due to its large initial power consumption, and pratically needs a self-powered USB hub to used this reader. (receiver itself is OK in bus-powered) 1. Earthsoft PT1 http://earthsoft.jp/PT/index.html (in Japanese) PCI 2xISDB-T + 2xISDB-S, 4 concurrent streaming no BCAS card, no card-reader. DVB driver: in v4l-dvb main repository very popular in this area but discontinued. PT2 has been released but highly out of stock, and no driver yet. 2. SKNet MonsterTV HDUS, or HDUSF http://www.sknet-web.co.jp/product/mtvhdus.html USB2.0 ISDB-T, with BCAS cardreader, remote-controller a bit old but maybe most available in stores. I don't know much about this device, but it is reported to work in Linux, (with some firmware hack?) and some people seems to have written DVB driver. you may find it from http://2sen.dip.jp/cgi-bin/hdusup/upload.cgi (up0432.zip??) I heard that some another version(series?) have internal encryption and are difficult to make it work in Linux. note 0. DVB drivers output scrambled streams as is. an user-land application is necessary to descramble. stand-alone descrambler: http://www.marumo.ne.jp/junk/arib_std_b25-0.2.4.lzh patch to mplayer/gstreamer demuxer: http://2sen.dip.jp/cgi-bin/dtvup/source/up0176.zip note 1. you have to prepare yourself PC/SC card reader and a BCAS card if the device does not bundle them. I guess you already have a BCAS card in hand already;) Card reader must be supported by PC/SC to be used with the above descrambling applications. for example, http://www.amazon.co.jp/gp/switch-language/product/B001NEIRH0/ref=dp_change_lang?ie=UTF8language=en_JP is told to work, but I'm not sure. note 2. re-using a BCAS card for non-autorized (bundeled) devices is probably against the EULA of the card. (one seg. programs are not scrambled and can be viewed without a BCAS card). - akihiro -- GyaO! - Anime, Dramas, Movies, and Music videos [FREE] http://pr.mail.yahoo.co.jp/gyao/ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re : Re : ISDB-T tuner
Thanks for your answer! I will give back my pixela to the shop! and I think I will choose the SKNet MonsterTV HDUS. I don't have BCAS card because I will give back the pixela! Do you think than SKNet MonsterTV HDUS is good? Can I use it with Mythtv? (if you know mythtv) Thank you very much for your help! - Message d'origine De : Akihiro TSUKADA ts...@yahoo.co.jp À : Romont Sylvain psgma...@yahoo.fr Cc : linux-media@vger.kernel.org Envoyé le : Mar 20 Octobre 2009, 23 h 05 min 14 s Objet : Re: Re : ISDB-T tuner so, which device can I buy, working in Japan, in linux, and in digital (working after 2011)? known to work devices 0. 774 Friio white http://www.friio.com/ (in Japanese) USB2.0 ISDB-T, with a card-reader device, without BCAS card DVB driver: in v4l-dvb main repository direct net shopping only, pretty expensive. card reader is very unstable due to its large initial power consumption, and pratically needs a self-powered USB hub to used this reader. (receiver itself is OK in bus-powered) 1. Earthsoft PT1 http://earthsoft.jp/PT/index.html (in Japanese) PCI 2xISDB-T + 2xISDB-S, 4 concurrent streaming no BCAS card, no card-reader. DVB driver: in v4l-dvb main repository very popular in this area but discontinued. PT2 has been released but highly out of stock, and no driver yet. 2. SKNet MonsterTV HDUS, or HDUSF http://www.sknet-web.co.jp/product/mtvhdus.html USB2.0 ISDB-T, with BCAS cardreader, remote-controller a bit old but maybe most available in stores. I don't know much about this device, but it is reported to work in Linux, (with some firmware hack?) and some people seems to have written DVB driver. you may find it from http://2sen.dip.jp/cgi-bin/hdusup/upload.cgi (up0432.zip??) I heard that some another version(series?) have internal encryption and are difficult to make it work in Linux. note 0. DVB drivers output scrambled streams as is. an user-land application is necessary to descramble. stand-alone descrambler: http://www.marumo.ne.jp/junk/arib_std_b25-0.2.4.lzh patch to mplayer/gstreamer demuxer: http://2sen.dip.jp/cgi-bin/dtvup/source/up0176.zip note 1. you have to prepare yourself PC/SC card reader and a BCAS card if the device does not bundle them. I guess you already have a BCAS card in hand already;) Card reader must be supported by PC/SC to be used with the above descrambling applications. for example, http://www.amazon.co.jp/gp/switch-language/product/B001NEIRH0/ref=dp_change_lang?ie=UTF8language=en_JP is told to work, but I'm not sure. note 2. re-using a BCAS card for non-autorized (bundeled) devices is probably against the EULA of the card. (one seg. programs are not scrambled and can be viewed without a BCAS card). - akihiro -- GyaO! - Anime, Dramas, Movies, and Music videos [FREE] http://pr.mail.yahoo.co.jp/gyao/ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: uvcvideo causes ehci_hcd to halt
On Tue, 20 Oct 2009, [UTF-8] Ozan ÃaÄlayan wrote: Hi. First the backtrace: [ 149.510272] uvcvideo: Found UVC 1.00 device BisonCam, NB Pro (5986:0203) [ 149.515017] input: BisonCam, NB Pro as /devices/pci:00/:00:1d.7/usb1/1-5/1-5:1.0/input/input10 [ 149.515588] usbcore: registered new interface driver uvcvideo [ 149.516247] USB Video Class driver (v0.1.0) [ 149.658012] Pid: 1137, comm: hald-probe-vide Tainted: G C 2.6.31.4-128 #2 [ 149.658012] Call Trace: [ 149.658012] [c0373f62] handshake_on_error_set_halt+0x36/0x65 [ 149.658012] [c0374073] enable_periodic+0x32/0x72 [ 149.658012] [c03741c9] qh_link_periodic+0x116/0x11e [ 149.658012] [c0374665] qh_schedule+0x120/0x12c [ 149.658012] [c03775d0] intr_submit+0x8c/0x124 [ 149.658012] [c0377d2a] ehci_urb_enqueue+0x7a/0xa5 ... [ 149.658012] ehci_hcd :00:1d.7: force halt; handhake f7c66024 4000 - -110 And the usbmon trace during modprobe uvcvideo can be found at: http://cekirdek.pardus.org.tr/~ozan/ivir/logs/usbmon.trace.bad I also manage to not reproduce the problem so it's kinda racy. You can find good/bad dmesg/usbmon traces at: http://cekirdek.pardus.org.tr/~ozan/ivir/logs ping! in case it's got lost between high traffic :) Yes, sorry, my email client tends to hide messages with non-ASCII characters in the From: address. It's unforunate. :-( I can't tell exactly what's wrong, but I've got a hunch that the patch below might help. If it doesn't, send another dmesg log but this time with CONFIG_USB_DEBUG enabled in the kernel. Alan Stern Index: usb-2.6/drivers/usb/host/ehci-q.c === --- usb-2.6.orig/drivers/usb/host/ehci-q.c +++ usb-2.6/drivers/usb/host/ehci-q.c @@ -818,6 +818,9 @@ qh_make ( dbg (intr period %d uframes, NYET!, urb-interval); goto done; + } else if (qh-period ehci-periodic_size) { + qh-period = ehci-periodic_size; + urb-interval = qh-period 3; } } else { int think_time; @@ -840,6 +843,10 @@ qh_make ( usb_calc_bus_time (urb-dev-speed, is_input, 0, max_packet (maxp))); qh-period = urb-interval; + if (qh-period ehci-periodic_size) { + qh-period = ehci-periodic_size; + urb-interval = qh-period; + } } } -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re : Re : ISDB-T tuner
I search a little about the SKNet MonsterTV HDUS and the dvb driver, but I think the BCAS card-reader is not working, is it true? - Message d'origine De : Akihiro TSUKADA ts...@yahoo.co.jp À : Romont Sylvain psgma...@yahoo.fr Cc : linux-media@vger.kernel.org Envoyé le : Mar 20 Octobre 2009, 23 h 05 min 14 s Objet : Re: Re : ISDB-T tuner so, which device can I buy, working in Japan, in linux, and in digital (working after 2011)? known to work devices 0. 774 Friio white http://www.friio.com/ (in Japanese) USB2.0 ISDB-T, with a card-reader device, without BCAS card DVB driver: in v4l-dvb main repository direct net shopping only, pretty expensive. card reader is very unstable due to its large initial power consumption, and pratically needs a self-powered USB hub to used this reader. (receiver itself is OK in bus-powered) 1. Earthsoft PT1 http://earthsoft.jp/PT/index.html (in Japanese) PCI 2xISDB-T + 2xISDB-S, 4 concurrent streaming no BCAS card, no card-reader. DVB driver: in v4l-dvb main repository very popular in this area but discontinued. PT2 has been released but highly out of stock, and no driver yet. 2. SKNet MonsterTV HDUS, or HDUSF http://www.sknet-web.co.jp/product/mtvhdus.html USB2.0 ISDB-T, with BCAS cardreader, remote-controller a bit old but maybe most available in stores. I don't know much about this device, but it is reported to work in Linux, (with some firmware hack?) and some people seems to have written DVB driver. you may find it from http://2sen.dip.jp/cgi-bin/hdusup/upload.cgi (up0432.zip??) I heard that some another version(series?) have internal encryption and are difficult to make it work in Linux. note 0. DVB drivers output scrambled streams as is. an user-land application is necessary to descramble. stand-alone descrambler: http://www.marumo.ne.jp/junk/arib_std_b25-0.2.4.lzh patch to mplayer/gstreamer demuxer: http://2sen.dip.jp/cgi-bin/dtvup/source/up0176.zip note 1. you have to prepare yourself PC/SC card reader and a BCAS card if the device does not bundle them. I guess you already have a BCAS card in hand already;) Card reader must be supported by PC/SC to be used with the above descrambling applications. for example, http://www.amazon.co.jp/gp/switch-language/product/B001NEIRH0/ref=dp_change_lang?ie=UTF8language=en_JP is told to work, but I'm not sure. note 2. re-using a BCAS card for non-autorized (bundeled) devices is probably against the EULA of the card. (one seg. programs are not scrambled and can be viewed without a BCAS card). - akihiro -- GyaO! - Anime, Dramas, Movies, and Music videos [FREE] http://pr.mail.yahoo.co.jp/gyao/ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
saa7134-empress output format problem
Hello - I have a saa7134 video encoder card RTD Embedded Technologies VFG73 in 2.6.28.9 with recent v4l2 (3919b17dc88e). It has two compression channels and no tuner. The output pixel format for the compressed devices is showing 'BGR3' and it should be 'MPEG'. The data from the output device appears to be uncompressed data. Also, the video standard has been disconnected from the input device. The input device /dev/video1 is NTSC, and the encoded output device /dev/video3 is PAL. They should both be NTSC. H.Verkuil had initially fixed this problem last April. I'm wondering if I missed something obvious or missed changes in the last 6 months or if there could be a regression problem. Thanks for your help. dmesg: [9.055669] saa7133[0]: registered device video0 [v4l2] [9.058483] saa7133[0]: registered device vbi0 [9.218654] saa7133[1]: registered device video1 [v4l2] [9.218922] saa7133[1]: registered device vbi1 [9.234472] saa7133[0]: registered device video2 [mpeg] [9.234802] saa7133[1]: registered device video3 [mpeg] Prior correct pixel format (compare to further below): Format Video Capture: Width/Height : 720/576 Pixel Format : 'MPEG' Field : Any Bytes per Line: 0 Size Image: 12032 Colorspace: Unknown () Current info: # v4l2-ctl --device /dev/video3 --all Driver Info: Driver name : saa7134 Card type : RTD Embedded Technologies VFG73 Bus info : PCI::02:09.0 Driver version: 527 Capabilities : 0x0515 Video Capture Video Overlay VBI Capture Read/Write Streaming Format Video Capture: Width/Height : 720/576 Pixel Format : 'BGR3' Field : Interlaced Bytes per Line: 2160 Size Image: 1244160 Colorspace: Unknown () Format Video Overlay: Left/Top: 0/0 Width/Height: 0/0 Field : Any Chroma Key : 0x Global Alpha: 0x00 Clip Count : 0 Clip Bitmap : No Format VBI Capture: Sampling Rate : 2700 Hz Offset : 256 samples (9.48148e-06 secs after leading edge) Samples per Line: 2048 Sample Format : GREY Start 1st Field : 7 Count 1st Field : 16 Start 2nd Field : 319 Count 2nd Field : 16 Framebuffer Format: Capability: Clipping List Flags : Width : 0 Height: 0 Pixel Format : '' Bytes per Line: 0 Size image: 0 Colorspace: Unknown () Crop Capability Video Capture: Bounds : Left 0, Top 46, Width 720, Height 578 Default : Left 0, Top 48, Width 720, Height 576 Pixel Aspect: 54/59 Crop: Left 0, Top 48, Width 720, Height 576 Video input : 0 (Composite 0) Audio input : 0 (audio) Frequency: 0 (0.00 MHz) Video Standard = 0x00ff PAL-B/B1/G/H/I/D/D1/K Tuner: Name : Capabilities : 62.5 kHz Frequency range : 0.0 MHz - 0.0 MHz Signal strength/AFC : 0%/0 Current audio mode : mono Available subchannels: # v4l2-ctl --device /dev/video1 --all Driver Info: Driver name : saa7134 Card type : RTD Embedded Technologies VFG73 Bus info : PCI::02:08.0 Driver version: 527 Capabilities : 0x0515 Video Capture Video Overlay VBI Capture Read/Write Streaming Format Video Capture: Width/Height : 720/576 Pixel Format : 'BGR3' Field : Interlaced Bytes per Line: 2160 Size Image: 1244160 Colorspace: Unknown () Format Video Overlay: Left/Top: 0/0 Width/Height: 0/0 Field : Any Chroma Key : 0x Global Alpha: 0x00 Clip Count : 0 Clip Bitmap : No Format VBI Capture: Sampling Rate : 2700 Hz Offset : 256 samples (9.48148e-06 secs after leading edge) Samples per Line: 2048 Sample Format : GREY Start 1st Field : 10 Count 1st Field : 12 Start 2nd Field : 273 Count 2nd Field : 12 Framebuffer Format: Capability: Clipping List Flags : Width : 0 Height: 0 Pixel Format : '' Bytes per Line: 0 Size image: 0 Colorspace: Unknown () Crop Capability Video Capture: Bounds : Left 0, Top 44, Width 704, Height 480 Default : Left 0, Top 46, Width 704, Height 480 Pixel Aspect: 11/10 Crop: Left 0, Top 46, Width 704, Height 480 Video input : 0 (Composite 0) Audio input : 0 (audio) Frequency: 0 (0.00 MHz) Video Standard = 0xb000 NTSC-M/M-JP/M-KR Tuner: Name : Capabilities : 62.5 kHz Frequency range : 0.0 MHz - 0.0 MHz
Re: [PATCH 2/6 v5] Support for TVP7002 in dm365 board
Sekhar, Nori, Sekhar wrote: On Fri, Oct 16, 2009 at 00:17:46, Kevin Hilman wrote: santiago.nu...@ridgerun.com writes: From: Santiago Nunez-Corrales santiago.nu...@ridgerun.com This patch provides support for TVP7002 in architecture definitions within DM365. Signed-off-by: Santiago Nunez-Corrales santiago.nu...@ridgerun.com --- arch/arm/mach-davinci/board-dm365-evm.c | 170 ++- 1 files changed, 166 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index a1d5e7d..6c544d3 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c @@ -38,6 +38,11 @@ #include mach/common.h #include mach/mmc.h #include mach/nand.h +#include mach/gpio.h +#include linux/videodev2.h +#include media/tvp514x.h +#include media/tvp7002.h +#include media/davinci/videohd.h static inline int have_imager(void) @@ -48,8 +53,11 @@ static inline int have_imager(void) static inline int have_tvp7002(void) { - /* REVISIT when it's supported, trigger via Kconfig */ +#ifdef CONFIG_VIDEO_TVP7002 + return 1; +#else return 0; +#endif I've said this before, but I'll say it again. I don't like the #ifdef-on-Kconfig-option here. Can you add a probe hook to the platform_data so that when the tvp7002 is found it can call pdata-probe() which could then set a flag for use by have_tvp7002(). This will have he same effect without the ifdef since if the driver is not compiled in, its probe can never be triggered. But this wouldn't work when TVP7002 is built as a module. Correct? The current patch does not take care of the module case as well. Patch 6/6 of this series does seem to make the TVP7002 driver available as module. Well, that was the intention given the inherent convenience of loading/unloading the TVP7002 driver for applications. Now, given that scenario, I know the #ifdef option is not elegant, but it is simple and accomplishes the purpose with the module approach. Any other suggestions/ideas? Thanks, Sekhar Regards, -- Santiago Nunez-Corrales, Eng. RidgeRun Engineering, LLC Guayabos, Curridabat San Jose, Costa Rica +(506) 2271 1487 +(506) 8313 0536 http://www.ridgerun.com -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 0/6 v5] Support for TVP7002 in DM365
Santiago, When you are submitting the next set of patches, please include only TVP7002 driver and Kconfig/Makefile changes for TVP7002. The vpfe capture driver in the upstream tree is not up to date with the Arago tree that we use for development. So as such your patches for board/platform code, vpfe capture etc may not work in upstream. I hope to update the upstream tree in few weeks from now. Also your tvp7002 patch needs to use the video timings APIs that I am currently developing. I plan to send a patch for this in a day or two for review to this mailing list. Murali Karicheri Software Design Engineer Texas Instruments Inc. Germantown, MD 20874 email: m-kariche...@ti.com -Original Message- From: Santiago Nunez-Corrales [mailto:snu...@ridgerun.com] Sent: Thursday, October 15, 2009 10:42 AM To: davinci-linux-open-sou...@linux.davincidsp.com Cc: Narnakaje, Snehaprabha; Karicheri, Muralidharan; Diego Dompe; todd.fisc...@ridgerun.com; Grosen, Mark; Linux Media Mailing List Subject: [PATCH 0/6 v5] Support for TVP7002 in DM365 This series of patches provide support for the TVP7002 decoder in DM365. Support includes: * Inclusion of the chip in v4l2 definitions * Definition in board specific data structures * Linking within the VPFE architecture * Definition of TVP7002 specific data structures * Kconfig and Makefile support The v5 series corrects many issued pointed out by Snehaprabha Narnakaje, Muralidharan Karicheri, Vaibhav Hiremath and Hans Verkuil and solves testing problems. Tested on DM365 TI EVM with resolutions 720p, 10...@60, 576P and 480P. -- Santiago Nunez-Corrales, Eng. RidgeRun Engineering, LLC Guayabos, Curridabat San Jose, Costa Rica +(506) 2271 1487 +(506) 8313 0536 http://www.ridgerun.com -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: HP/Yuan EC372S DVB-T
Dnia 2009-10-20, wto o godzinie 02:26 +0300, Antti Palosaari pisze: Do you have Windows XP drivers? I think I could fix that device if I get my device working with Windows. And I only have XP... Hi, As far as I remember I've just installed (on XP) drivers from CD. It was included with the card. I've made a copy: http://sciborek.com/ec372/windrv.tar.bz2 Regards Patryk -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[cron job] v4l-dvb daily build 2.6.22 and up: ERRORS, 2.6.16-2.6.21: ERRORS
This message is generated daily by a cron job that builds v4l-dvb for the kernels and architectures in the list below. Results of the daily build of v4l-dvb: date:Tue Oct 20 19:00:03 CEST 2009 path:http://www.linuxtv.org/hg/v4l-dvb changeset: 13156:f6680fa8e7ec gcc version: gcc (GCC) 4.3.1 hardware:x86_64 host os: 2.6.26 linux-2.6.22.19-armv5: OK linux-2.6.23.12-armv5: OK linux-2.6.24.7-armv5: OK linux-2.6.25.11-armv5: OK linux-2.6.26-armv5: OK linux-2.6.27-armv5: OK linux-2.6.28-armv5: OK linux-2.6.29.1-armv5: OK linux-2.6.30-armv5: OK linux-2.6.31-armv5: OK linux-2.6.32-rc3-armv5: ERRORS linux-2.6.32-rc3-armv5-davinci: ERRORS linux-2.6.27-armv5-ixp: ERRORS linux-2.6.28-armv5-ixp: ERRORS linux-2.6.29.1-armv5-ixp: ERRORS linux-2.6.30-armv5-ixp: ERRORS linux-2.6.31-armv5-ixp: ERRORS linux-2.6.32-rc3-armv5-ixp: ERRORS linux-2.6.28-armv5-omap2: OK linux-2.6.29.1-armv5-omap2: OK linux-2.6.30-armv5-omap2: OK linux-2.6.31-armv5-omap2: ERRORS linux-2.6.32-rc3-armv5-omap2: ERRORS linux-2.6.22.19-i686: WARNINGS linux-2.6.23.12-i686: OK linux-2.6.24.7-i686: OK linux-2.6.25.11-i686: OK linux-2.6.26-i686: OK linux-2.6.27-i686: OK linux-2.6.28-i686: OK linux-2.6.29.1-i686: WARNINGS linux-2.6.30-i686: WARNINGS linux-2.6.31-i686: WARNINGS linux-2.6.32-rc3-i686: ERRORS linux-2.6.23.12-m32r: OK linux-2.6.24.7-m32r: OK linux-2.6.25.11-m32r: OK linux-2.6.26-m32r: OK linux-2.6.27-m32r: OK linux-2.6.28-m32r: OK linux-2.6.29.1-m32r: OK linux-2.6.30-m32r: OK linux-2.6.31-m32r: OK linux-2.6.32-rc3-m32r: ERRORS linux-2.6.30-mips: WARNINGS linux-2.6.31-mips: OK linux-2.6.32-rc3-mips: ERRORS linux-2.6.27-powerpc64: ERRORS linux-2.6.28-powerpc64: ERRORS linux-2.6.29.1-powerpc64: ERRORS linux-2.6.30-powerpc64: ERRORS linux-2.6.31-powerpc64: ERRORS linux-2.6.32-rc3-powerpc64: ERRORS linux-2.6.22.19-x86_64: WARNINGS linux-2.6.23.12-x86_64: OK linux-2.6.24.7-x86_64: OK linux-2.6.25.11-x86_64: OK linux-2.6.26-x86_64: OK linux-2.6.27-x86_64: OK linux-2.6.28-x86_64: OK linux-2.6.29.1-x86_64: WARNINGS linux-2.6.30-x86_64: WARNINGS linux-2.6.31-x86_64: WARNINGS linux-2.6.32-rc3-x86_64: ERRORS sparse (linux-2.6.31): OK sparse (linux-2.6.32-rc3): OK linux-2.6.16.61-i686: ERRORS linux-2.6.17.14-i686: ERRORS linux-2.6.18.8-i686: ERRORS linux-2.6.19.5-i686: ERRORS linux-2.6.20.21-i686: OK linux-2.6.21.7-i686: OK linux-2.6.16.61-x86_64: ERRORS linux-2.6.17.14-x86_64: ERRORS linux-2.6.18.8-x86_64: ERRORS linux-2.6.19.5-x86_64: ERRORS linux-2.6.20.21-x86_64: OK linux-2.6.21.7-x86_64: OK Detailed results are available here: http://www.xs4all.nl/~hverkuil/logs/Tuesday.log Full logs are available here: http://www.xs4all.nl/~hverkuil/logs/Tuesday.tar.bz2 The V4L2 specification failed to build, but the last compiled spec is here: http://www.xs4all.nl/~hverkuil/spec/v4l2.html The DVB API specification from this daily build is here: http://www.xs4all.nl/~hverkuil/spec/dvbapi.pdf -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: saa7134-empress output format problem
On Tue, Oct 20, 2009 at 10:11 AM, Gordon Smith spider.karma+linux-me...@gmail.com wrote: Hello - I have a saa7134 video encoder card RTD Embedded Technologies VFG73 in 2.6.28.9 with recent v4l2 (3919b17dc88e). It has two compression channels and no tuner. I can clarify that my card is RTD Embedded Technologies VFG7350. # v4l2-ctl --device /dev/video3 --all Driver Info: Driver name : saa7134 Card type : RTD Embedded Technologies VFG73 Bus info : PCI::02:09.0 Driver version: 527 Capabilities : 0x0515 Video Capture Video Overlay VBI Capture Read/Write Streaming -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: S2API and DVB-T tuning [Solved]
DUBOST Brice a écrit : DUBOST Brice a écrit : Hello, I have some problems with DVB-T tuning under s2-api/DVB API 5 To run these tests I use scan-s2-7effc68db255 My machine runs the following kernel (uname -a) Linux fixe_barcelone 2.6.31-13-generic #42-Ubuntu SMP Thu Oct 8 20:03:54 UTC 2009 x86_64 GNU/Linux And I own 3 DVB-T devices : 1: 01:00.0 Multimedia controller: Philips Semiconductors SAA7146 (rev 01) Subsystem: Technotrend Systemtechnik GmbH Device 1012 Flags: bus master, medium devsel, latency 64, IRQ 21 Memory at fa6ffc00 (32-bit, non-prefetchable) [size=512] Kernel driver in use: budget_ci dvb Kernel modules: budget-ci 2: Bus 001 Device 010: ID 2040:7070 Hauppauge 3: Bus 001 Device 011: ID 07ca:a815 AVerMedia Technologies, Inc. All three devices tune well and work flawlessly with scan (dvb api v3) But when I use scan-s2, only the AVerMedia is able to lock I use the dvb-t/es-Collserola as an initial tuning file. I thought the S2API shouldn't change the tuning behavior. I tried to search the Mailing list archives via google I unfortunately found nothing. I'm sorry if this subject was discussed before. What can I do to investigate more on this issue ? Hello One more information, if I change 51400 8MHz 2/3 AUTO QAM64 8k 1/4 NONE by 51400 8MHz 2/3 AUTO AUTO 8k 1/4 NONE it works with scan-s2 With old scan it works for both Hope this will help to find the issue Hello After playing a bit more with S2API, I understood that the S2API is using DVB API v3 for DVB-T. So I investigated a bit more this issue. The problem came from the fact that scan-s2 was not giving all the parameters needed for DVB-T to the new API By making scan-s2 setting the following parameters, it works DTV_DELIVERY_SYSTEM DTV_FREQUENCY DTV_MODULATION DTV_GUARD_INTERVAL DTV_CODE_RATE_HP DTV_CODE_RATE_LP DTV_TRANSMISSION_MODE DTV_HIERARCHY DTV_BANDWIDTH_HZ Problem solved :D Best regards -- Brice A: Yes. Q: Are you sure? A: Because it reverses the logical flow of conversation. Q: Why is top posting annoying in email? -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: CAM initialisation failing
Hi, I also have a lot of problems with my CAM module (Povercam Pro). It works in about 50% when trying to watch channels on my Viaccess card. Can you maybe share your patch? Gregor -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: HP/Yuan EC372S DVB-T
On 10/20/2009 07:39 PM, Patryk Ściborek wrote: Dnia 2009-10-20, wto o godzinie 02:26 +0300, Antti Palosaari pisze: Do you have Windows XP drivers? I think I could fix that device if I get my device working with Windows. And I only have XP... Hi, As far as I remember I've just installed (on XP) drivers from CD. It was included with the card. I've made a copy: http://sciborek.com/ec372/windrv.tar.bz2 Thanks. Now I found why I was failing earlier - it was due to USB2.0 ExpressCard adapter I was using... :-( After I plugged it to Linux laptop native ExpressCard slot it attachs demod. Tuning is still always failing with filter timeouts. I even opened my box, there is DiBcom 7700C1-ACXXa-G and Microtune MT2266F. I will hack that more later. regards Antti -- http://palosaari.fi/ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] v1.1: Multi-plane (discontiguous) buffers
Hello, we are currently working on a chip that requires a separate buffer for each plane in a frame. Our hardware requires, those plane buffers not to be placed immediately one after another. There is no support for such buffers in V4L2 yet and we would like to propose a solution for this problem. Purpose and requirements = Currently, the v4l2_buffer struct supports only contiguous memory buffers, i.e. one frame has to fit in one, contiguous physical buffer. A driver receives and passes back to the userspace (e.g. when mmap()ing) only one pointer (offset). Our hardware requires two physically separate buffers for Y and CbCr components, which must be placed in two different memory banks. A similar problem was also expressed by Jun Nie in a recent discussion on this list: http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/10462. That proposal included a hardcoded 3-plane format. There also was a requirement for per-plane stride as well and although we have not included it in this proposal, it could be easily incorporated into this design (see comments below). We would like to add support for a more general type of buffers: n-plane buffers. No changes should be made to break the existing API. Proposed extensions The proposed extensions to the framework are as follows: 1. Add two new memory types: enum v4l2_memory { V4L2_MEMORY_MMAP = 1, V4L2_MEMORY_USERPTR = 2, V4L2_MEMORY_OVERLAY = 3, +V4L2_MEMORY_MULTI_USERPTR= 4, +V4L2_MEMORY_MULTI_MMAP = 5, }; The new types would be used to identify multi-planar buffers. 2. Modify the buffer struct (no change to size): struct v4l2_buffer { /* ... */ union { __u32 offset; unsigned long userptr; +unsigned long multi_info_ptr; } m; /* ... */ }; 3. The multi_info_ptr would contain a userspace pointer to a structure further describing the buffer: + struct v4l2_multiplane_info { + __u32 count; Rather than introducing this new struct, perhaps it would be better to reuse the v4l2_buffer length field as a 'count' for multiplanes. That length field is currently unused for multiplane formats. + struct v4l2_plane[0]; + }; Where the v4l2_plane array would contain count elements: + struct v4l2_plane { + __u32 parent_index; + __u32 bytesused; + union { + __u32 offset; + unsigned long userptr; + } m; + __u32 flags; + __u32 length; + __u32 reserved; Make this reserved[4]. + }; parent_index - index of the parent v4l2_buffer Why do we need this index? offset, userptr, bytesused, length - same as in v4l2_buffer struct but for current frame flags - one flag currently: V4L2_PLANE_FLAG_MAPPED (or reuse V4L2_BUF_FLAG_MAPPED for that) Isn't this just a copy of the v4l2_buffer flags? Why do we need it again? A stride field could also be added if there is a need for one. How this would work === --- 1. Formats --- No need to change the format API, although new formats for such buffers may be needed and added, as required. --- 2. Requesting, querying and mapping buffers --- No changes to existing applications/drivers required. A driver (and the videobuffer framework components) willing to support multi-plane buffers would have to be made aware of the new memory types: VIDIOC_REQBUFS: --- - MULTI_MMAP: * application: pass the new memory type and count of multi-plane buffers (not plane count) normally * driver: fills in count as usual, being the number of actually allocated buffers (i.e. 1 for each multi-plane buffer, not each plane) - MULTI_USERPTR: * no changes VIDIOC_QUERYBUFS: - - MULTI_MMAP: * application: pass a v4l2_buffer struct as usual, but with the new memory type and a userspace pointer (in multi_info_ptr) to an instance of v4l2_multiplane_info structure. The structure and the embedded v4l2_plane[] array has to be preallocated in userspace and have count set to the required number of planes. * driver fills offset fields in each v4l2_plane struct, analogically to offsets in normal v4l2_buffers. - MULTI_USERPTR: n/a mmap() - Basically just like in normal buffer case, but with planes instead of buffers and one mmap() call per each plane. - application calls mmap count
Re: [RFC] Video events, version 2.1
Hans Verkuil wrote: [clip] #define V4L2_EVENT_ALL 0x07ff I suggest using 0 instead of 0x07ff. Yes, 0 is still a magic number, but somehow it feels a lot less magic :-) Okay. #define V4L2_EVENT_PRIVATE_START0x0800 #define V4L2_EVENT_RESERVED 0x1000 Rather than calling this RESERVED turn this into a mask: #define V4L2_EVENT_MASK 0x0fff Ok. VIDIOC_DQEVENT is used to get events. count is number of pending events after the current one. sequence is the event type sequence number and the data is specific to event type. The user will get the information that there's an event through exception file descriptors by using select(2). When an event is available the poll handler sets POLLPRI which wakes up select. -EINVAL will be returned if there are no pending events. VIDIOC_SUBSCRIBE_EVENT and VIDIOC_UNSUBSCRIBE_EVENT are used to subscribe and unsubscribe from events. The argument is struct v4l2_event_subscription which now only contains the type field for the event type. Every event can be subscribed or unsubscribed by one ioctl by using special type V4L2_EVENT_ALL. struct v4l2_event { __u32 count; __u32 type; __u32 sequence; struct timeval timestamp; __u32 reserved[8]; __u8data[64]; }; struct v4l2_event_subscription { __u32 type; __u32 reserved[8]; }; #define VIDIOC_DQEVENT _IOR('V', 84, struct v4l2_event) #define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 85, struct v4l2_event_subscription) #define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 86, struct v4l2_event_subscription) Perhaps we should use just one ioctl and use a flag in the event_subscription struct to tell whether to subscribe or unsubscribe? Just brainstorming here. Having two ioctls would be equivalent to STREAMON and STREAMOFF, that's why I originally picked that. I can't immediately figure a way it could be done nicely by using a flag. OK. The size of the event queue is decided by the driver. Which events will be discarded on queue overflow depends on the implementation. Questions - One more question I have is that there can be situations that the application wants to know something has happened but does not want an explicit notification from that. So it gets an event from VIDIOC_DQEVENT but does not want to get woken up for that reason. I guess one flag in event subscription should do that. Perhaps that is something that should be implemented when needed, though. Yeah, lets implement this only when needed. Are there enough reserved fields now? Personally I think 4 reserved fields for the event_subscription is enough. 8 reserved fields for that seems overkill to me. struct v4l2_format is IMO a good example of having enough unused fields. ;) I see that 8 reserved fields might make sense at least for v4l2_event. I wouldn't mind if we had that many in v4l2_event_subscription as well. There is already proposed use for three of them: - flags (e.g. notification / no notification) - entity - number of pending events The two first ones might make sense in v4l2_event_subscription as well. That would leave just two reserved fields afterwards. The entity field would fit to v4l2_event_subscription for the same reasons than to v4l2_event; if there are several entities the event could be coming from we could limit it to just some. Perhaps a bit far-fetched but still... And I wouldn't be surprised if a need appeared to something like priority as Tomasz suggested. After all that we'd be left with just one reserved field if we decided to use all 32 bits for priority. The basic event delivery problem is IMO very well understood but there are just so many ideas on extensions (many of which sound quite reasonable) already at this point that I'm slightly worried about the future if we just have a few reserved fields. Unnecessary bloat still must be kept away, of course. Good points. I agree with you. How about the event type high order bits split? Yes, what's the purpose of that? I don't see a good reason for that. Me neither. Although even if we don't see use for them now it doesn't mean there couldn't be any in future. We can always say that the reserved bits are no more reserved but not the other way around. I originally though those few bits could be used for flags that now are part of the structure. Or we could just drop the reserved bits, I'm not against that. I propose to just drop it, but document that we shouldn't use the top 4-bits for now. We might use it in the future if we ever need an event enum and want to do something like the NEXT_CTRL flag that QUERYCTRL supports. Regards, Hans -- Sakari Ailus sakari.ai...@maxwell.research.nokia.com -- Hans Verkuil - video4linux
Re: [RFC/PATCH 00/14] Media controller update based on Hans' v4l-dvb-mc tree
On Wednesday 21 October 2009 00:15:37 Hans Verkuil wrote: Hi Laurent, Hi everybody, here's a set of patches to clean up and extend Hans' initial media controller implementation. Patches prefixed by v4l deal with the v4l core code and update existing drivers when required by an API change. The core now offers two functions to deal with entities and links: - v4l2_entity_init() will initialize an entity. For subdevices the v4l2_subdev_init() performs part of the entity initialization as well, which leads me to believe that the API is currently ill-defined. - v4l2_entity_connect() creates a link between two entities. All possible links should be created using that function before the subdevice is registered. As I don't own any ivtv hardware the media controller code was difficult to test so I've implemented media controller support in the UVC driver for testing purpose. The code can be found in patches prefixed by uvc. This is mostly playground code. There are known and unknown bugs (especially in the ivtv driver as I haven't been able to test that code; v4l2_entity_connect is definitely called with bad parameters in there) as well as design issues. There's a lot of code missing. I'm mostly interested in getting feedback on the changes, especially the new v4l2_entity_pad and v4l2_entity_link objects. Feel free to comment on the public userspace API too, I realized after changing it to mimic the new kernel API that the way the previous API exposed local and remote pads instead of pads and links is probably more space efficient. I'll keep playing with the code and I'll start porting the OMAP3 camera driver to the in-progress media controller API. I'll discover problems (and hopefully solutions) along the way so another round of patches can be expected later, maybe in a week. Of course I'll appreciate comments before that, as the earlier I get feedback the easier it will be to incorporate it in the code. No pressure though, I know that a few developers have left for the kernel summit in Japan. While I haven't been able to do an in-depth review Thanks for the early feedback. it is clear to me that the switch to 'pads' is definitely the right direction. That leads to much cleaner code. With regards to the code kernel API to set up all these relationships: I expect we'll end up with a few generic core functions that do all the hard work, and a bunch of static inline convenience functions on top of that. That tends to work quite well. That's what I predict as well. One tip: it might be useful to have a tree ready with just a single driver that is converted to use mc, links and pads (e.g. uvc). That makes it easy to experiment with different data structures and APIs. It's much harder to do this if you have a lot of dependencies on your code. Good point. I'll setup a tree on linuxtv.org. Next step is the implementation of device nodes for subdevs. I'd like to reorganise the videodev core code for that, as we will have a dirty structures dependency otherwise (the v4l2_subdev structure will have two v4l2_entity fields, one as a direct child as v4l2_subdev inherits from v4l2_entity, and one through the video_device structure used for the subdev device node). -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
parse-sniffusb2.pl update
I have updated/rewrote parts of the parse-sniffusb2.pl script since I noticed some minor errors that I had in the previous version. I believe everything should be correct now. Attached is a newer version for review with the name parse1b-sniffusb2.pl Thanks, Franklin Meng #!/usr/bin/perl # # Author: Franklin Meng fmeng2...@yahoo.com # Parser for USB snoops captured from SniffUSB 2.0. # use strict; use warnings; use Data::Dumper; my $urbhash; foreach my $curfile (@ARGV) { parsefile($curfile); #we can only process 1 file exit; } sub parsefile { my $curfile = shift; my $s1 = 0; my $t1 = 0; my $tmp1 = ; my $printurb = 0; my $cururb = 0; open(FD, $curfile) || die(Error: $!\n); while(FD) { chomp; if (/URB\s+(\d+)\s+going\s+down/) { # print previous urb if available if($printurb != 0 exists($urbhash-{$printurb}-{'SetupPacket'})) { print $urbhash-{$printurb}-{'SetupPacket'} $urbhash-{$printurb}-{'Direction'} $urbhash-{$printurb}-{'TransferBufferMDL'}\n; ## delete urb information #delete($urbhash-{$printurb}); } # delete urb information delete($urbhash-{$printurb}); $printurb = 0; #reset here $tmp1 = ; $s1 = 0; $t1 = 0; # store next urb info here $cururb = $1; $urbhash-{$1} = undef; next; } elsif (/URB\s+(\d+)\s+coming\s+back/) { # print previous urb if available if($printurb != 0 exists($urbhash-{$printurb}-{'SetupPacket'})) { print $urbhash-{$printurb}-{'SetupPacket'} $urbhash-{$printurb}-{'Direction'} $urbhash-{$printurb}-{'TransferBufferMDL'}\n; ## delete urb information #delete($urbhash-{$printurb}); } # delete urb information delete($urbhash-{$printurb}); $printurb = 0; #reset here $tmp1 = ; $s1 = 0; $t1 = 0; # flag next urb for print out if(exists($urbhash-{$1})) { $printurb = $1; } else { die Error: cannot match urb!!\n; } $cururb = $1; next; } elsif (/\-{2}\s+(URB_FUN.+)\:/) { # store urb function (used for debugging) if(!exists($urbhash-{$cururb}-{'Function'})) { $urbhash-{$cururb}-{'Function'} = $1; } next; } elsif (/USBD_TRANSFER_DIRECTION_IN/) { #store in direction #check if we already stored a value if(!exists($urbhash-{$cururb}-{'Direction'})) { $urbhash-{$cururb}-{'Direction'} = ; } next; } elsif (/USBD_TRANSFER_DIRECTION_OUT/) { #store out direction #check if we already stored a value if(!exists($urbhash-{$cururb}-{'Direction'})) { $urbhash-{$cururb}-{'Direction'} = ; } next; } elsif (/TransferBufferMDL\s+=\s+/) { #flag data packet $t1 = 1; next; } elsif (/SetupPacket\s+=/) { #flag setup packet $s1 = 1; next; } elsif (/(.+\s+\=|ms\])/ ($s1 || $t1)) { #save data packet and reset if($s1 ($tmp1 ne )) { $tmp1 =~ s/^\s+//; $urbhash-{$cururb}-{'SetupPacket'} = $tmp1; } elsif($t1 ($tmp1 ne )) { $tmp1 =~ s/^\s+//; $urbhash-{$cururb}-{'TransferBufferMDL'} = $tmp1 } $tmp1 = ; $s1 = 0; $t1 = 0; next; } elsif (/^\s+\d+\:(.+)/ ($s1 || $t1)) { #capture packet $tmp1 = $tmp1 . $1; } } # print remaining URB if($printurb != 0 exists($urbhash-{$printurb}-{'SetupPacket'})) { print $urbhash-{$printurb}-{'SetupPacket'} $urbhash-{$printurb}-{'Direction'} $urbhash-{$printurb}-{'TransferBufferMDL'}\n; # # delete urb information # delete($urbhash-{$printurb}); } # delete urb information delete($urbhash-{$printurb}); # Maybe we should warn for the URB's that did not have matches? # print out stuff remaining in the hash for debugging #print Dumper($urbhash); }
Kworld 315U help?
I was wondering if someone would be able to help me with getting the analog and inputs for the Kworld 315U working. I was able to get the digital part working with help from Douglas Schilling and wanted to get the remaining portions of the device working. I have traces but have not made much progress. In addition I also have some questions about the information that the parse_em28xx.pl skips and does not decode. For example here is some of the data that doesn't seem to be decoded.. unknown: 40 03 00 00 a0 00 01 00 08 unknown: c0 02 00 00 a0 00 01 00 d0 unknown: 40 03 00 00 a0 00 01 00 08 unknown: c0 02 00 00 a0 00 01 00 d0 unknown: 40 03 00 00 a0 00 01 00 22 unknown: c0 02 00 00 a0 00 01 00 01 unknown: 40 03 00 00 a0 00 01 00 04 unknown: c0 02 00 00 a0 00 02 00 1a eb unknown: 40 03 00 00 a0 00 01 00 20 unknown: c0 02 00 00 a0 00 01 00 46 unknown: 40 03 00 00 a0 00 01 00 14 unknown: c0 02 00 00 a0 00 04 00 4e 07 01 00 Anyways, any help that can be provided is appreciated. Thanks, Franklin Meng -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html