saa7115: Fix standards detection
PATCH v2 1/8 saa7115: Fix standards detection
There are several bugs at saa7115 standards detection:
After the fix, the driver is returning the proper standards, as tested with 3 different broadcast sources:
On an invalid channel (without any TV signal):
[ 4394.931630] saa7115 15-0021: Status byte 2 (0x1f)=0xe0 [ 4394.931635] saa7115 15-0021: detected std mask = 00ffffff
With a PAL/M signal:
[ 4410.836855] saa7115 15-0021: Status byte 2 (0x1f)=0xb1 [ 4410.837727] saa7115 15-0021: Status byte 1 (0x1e)=0x82 [ 4410.837731] saa7115 15-0021: detected std mask = 00000900
With a NTSC/M signal:
[ 4422.383893] saa7115 15-0021: Status byte 2 (0x1f)=0xb1 [ 4422.384768] saa7115 15-0021: Status byte 1 (0x1e)=0x81 [ 4422.384772] saa7115 15-0021: detected std mask = 0000b000
Tests were done with a WinTV PVR USB2 Model 29xx card.
--- drivers/media/video/saa7115.c | 47 +++++++++++++++++++++++++++------------- 1 files changed, 32 insertions(+), 15 deletions(-)
drivers/media/video/saa7115.c +31 -14
@@ -1344,35 +1344,52 @@ static int saa711x_g_vbi_data(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_datstatic int saa711x_querystd (struct v4l2_subdev *sd,v4l2_std_id *std) {struct saa711x_state *state =to_state (sd); -int reg1e; +int reg1f, reg1e; - *std =V4L2_STD_ALL ; -if (state->ident !=V4L2_IDENT_SAA7115 ) { -int reg1f =saa711x_read (sd,R_1F_STATUS_BYTE_2_VD_DEC ); - -if (reg1f &0x20 ) - *std =V4L2_STD_525_60 ; -else - *std =V4L2_STD_625_50 ; - -return 0 ; + reg1f =saa711x_read (sd,R_1F_STATUS_BYTE_2_VD_DEC ); +v4l2_dbg (1 , debug, sd,"Status byte 2 (0x1f)=0x%02x\n" , reg1f); +if (reg1f &0x40 ) { +/* horizontal/vertical not locked */ + *std =V4L2_STD_ALL ; + goto ret; } +if (reg1f &0x20 ) + *std =V4L2_STD_525_60 ; +else + *std =V4L2_STD_625_50 ; + +if (state->ident !=V4L2_IDENT_SAA7115 ) + goto ret; reg1e =saa711x_read (sd,R_1E_STATUS_BYTE_1_VD_DEC );switch (reg1e &0x03 ) {case 1 : - *std =V4L2_STD_NTSC ; + *std &=V4L2_STD_NTSC ;break ;case 2 : - *std =V4L2_STD_PAL ; +/* +* V4L2_STD_PAL just cover the european PAL standards. +* This is wrong, as the device could also be using an +* other PAL standard. +*/ + *std &=V4L2_STD_PAL |V4L2_STD_PAL_N | V4L2_STD_PAL_Nc | +V4L2_STD_PAL_M |V4L2_STD_PAL_60 ;break ;case 3 : - *std =V4L2_STD_SECAM ; + *std &=V4L2_STD_SECAM ;break ;default : +/* Can't detect anything */ + *std =V4L2_STD_ALL ;break ; } + +v4l2_dbg (1 , debug, sd,"Status byte 1 (0x1e)=0x%02x\n" , reg1e); + +ret: +v4l2_dbg (1 , debug, sd,"detected std mask = %08Lx\n" , *std); +return 0 ; }
Signature · 1 line
1.7.6.4
PATCH v2 2/8 pvrusb2: implement VIDIOC_QUERYSTD
--- drivers/media/video/pvrusb2/pvrusb2-hdw.c | 7 +++++++ drivers/media/video/pvrusb2/pvrusb2-hdw.h | 3 +++ drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 7 +++++++ 3 files changed, 17 insertions(+), 0 deletions(-)
drivers/media/video/pvrusb2/pvrusb2-hdw.c +7 -0
@@ -2993,6 +2993,13 @@ static void pvr2_subdev_set_control(struct pvr2_hdw *hdw, int id, pvr2_subdev_set_control(hdw, id, #lab, (hdw)->lab##_val); \ } +int pvr2_hdw_get_detected_std (struct pvr2_hdw *hdw,v4l2_std_id *std) +{ +v4l2_device_call_all (&hdw->v4l2_dev,0 , + video, querystd, std); +return 0 ; +} +/* Execute whatever commands are required to update the state of all the sub-devices so that they match our current control values. */ static void pvr2_subdev_update (struct pvr2_hdw *hdw)
drivers/media/video/pvrusb2/pvrusb2-hdw.h +3 -0
@@ -214,6 +214,9 @@ struct pvr2_stream *pvr2_hdw_get_video_stream(struct pvr2_hdw *);int pvr2_hdw_get_stdenum_value (struct pvr2_hdw *hdw,struct v4l2_standard *std,unsigned int idx); +/* Get the detected video standard */ +int pvr2_hdw_get_detected_std (struct pvr2_hdw *hdw,v4l2_std_id *std); +/* Enable / disable retrieval of CPU firmware or prom contents. This must be enabled before pvr2_hdw_cpufw_get() will function. Note that doing this may prevent the device from running (and leaving this mode may
drivers/media/video/pvrusb2/pvrusb2-v4l2.c +7 -0
@@ -227,6 +227,13 @@ static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)break ; } +case VIDIOC_QUERYSTD : + { +v4l2_std_id *std = arg; + ret =pvr2_hdw_get_detected_std (hdw, std); +break ; + } +case VIDIOC_G_STD : {int val =0 ;
Signature · 1 line
1.7.6.4
PATCH v2 3/8 v4l2-ioctl: Fill the default value for VIDIOC_QUERYSTD
According with the V4L2 API spec:
"When detection is not possible or fails, the set must contain
all standards supported by the current video input or output."
The V4L2 core has the mask with all supported standards already. So, apply it. Driver and subdevs can then just remove standards from the mask, as they're able of detecting audio, video and frames frequency.
--- drivers/media/video/v4l2-ioctl.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/media/video/v4l2-ioctl.c +8 -0
@@ -1109,6 +1109,14 @@ static long __video_do_ioctl(struct file *file,if (!ops->vidioc_querystd)break ; +/* +* If nothing detected, it should return all supported +* Drivers just need to mask the std argument, in order +* to remove the standards that don't apply from the mask. +* This means that tuners, audio and video decoders can join +* their efforts to improve the standards detection +*/ + *p = vfd->tvnorms; ret = ops->vidioc_querystd (file, fh, arg);if (!ret) dbgarg(cmd, "detected std=%08Lx\n",
Signature · 1 line
1.7.6.4
PATCH v2 4/8 saa7115: Trust that V4L2 core will fill the mask
Instead of using V4L2_STD_ALL when no standard is detected, trust that the maximum allowed standards are already filled by the V4L2 core. It is better this way, as the bridge and/or the audio decoder may have some extra restrictions to some video standards.
This also allow other devices like audio and tuners to contribute to standards detection, when they support such feature.
--- drivers/media/video/saa7115.c | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-)
drivers/media/video/saa7115.c +12 -7
@@ -1346,17 +1346,23 @@ static int saa711x_querystd(struct v4l2_subdev *sd, v4l2_std_id *std)struct saa711x_state *state =to_state (sd);int reg1f, reg1e; +/* +* The V4L2 core already initializes std with all supported +* Standards. All driver needs to do is to mask it, to remove +* standards that don't apply from the mask +*/ + reg1f =saa711x_read (sd,R_1F_STATUS_BYTE_2_VD_DEC );v4l2_dbg (1 , debug, sd,"Status byte 2 (0x1f)=0x%02x\n" , reg1f); -if (reg1f &0x40 ) { -/* horizontal/vertical not locked */ - *std =V4L2_STD_ALL ; + +/* horizontal/vertical not locked */ +if (reg1f &0x40 ) goto ret; - } +if (reg1f &0x20 ) - *std =V4L2_STD_525_60 ; + *std &=V4L2_STD_525_60 ;else - *std =V4L2_STD_625_50 ; + *std &=V4L2_STD_625_50 ;if (state->ident !=V4L2_IDENT_SAA7115 ) goto ret;
@@ -1381,7 +1387,6 @@ static int saa711x_querystd(struct v4l2_subdev *sd, v4l2_std_id *std)break ;default :/* Can't detect anything */ - *std =V4L2_STD_ALL ;break ; }
Signature · 1 line
1.7.6.4
PATCH v2 6/8 videodev2: Reorganize standard macros and add a few more
In reply to Mauro Carvalho ChehabReorganize the standards macro and add a few more, that will be used on msp3400 in order to allow it to detect the audio standard.
--- include/linux/videodev2.h | 79 +++++++++++++++++++++++++++++++++----------- 1 files changed, 59 insertions(+), 20 deletions(-)
include/linux/videodev2.h +59 -20
@@ -759,10 +759,10 @@ typedef __u64 v4l2_std_id;#define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)#define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800) -#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) -#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) +#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)/* BTSC */ +#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)/* EIA-J */ #define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000) -#define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000) +#define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000)/* FM A2 */ #define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
@@ -786,47 +786,86 @@ typedef __u64 v4l2_std_id;v4l2-common.c should be fixed. */ -/* some merged standards */ -#define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC) -#define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B) -#define V4L2_STD_GH (V4L2_STD_PAL_G|V4L2_STD_PAL_H|V4L2_STD_SECAM_G|V4L2_STD_SECAM_H) -#define V4L2_STD_DK (V4L2_STD_PAL_DK|V4L2_STD_SECAM_DK) +/* +* Some macros to merge video standards in order to make live easier for the +* drivers and V4L2 applications +*/ -/* some common needed stuff */ -#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\ - V4L2_STD_PAL_B1 |\ - V4L2_STD_PAL_G) -#define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\ - V4L2_STD_PAL_D1 |\ - V4L2_STD_PAL_K) -#define V4L2_STD_PAL (V4L2_STD_PAL_BG |\ - V4L2_STD_PAL_DK |\ - V4L2_STD_PAL_H |\ - V4L2_STD_PAL_I) +/* +* "Common" NTSC/M - It should be noticed that V4L2_STD_NTSC_443 is +* Missing here. +*/ #define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\ V4L2_STD_NTSC_M_JP |\ V4L2_STD_NTSC_M_KR) +/* Secam macros */ #define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\ V4L2_STD_SECAM_K |\ V4L2_STD_SECAM_K1) +/* All Secam Standards */ #define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\ V4L2_STD_SECAM_G |\ V4L2_STD_SECAM_H |\ V4L2_STD_SECAM_DK |\ V4L2_STD_SECAM_L |\ V4L2_STD_SECAM_LC) +/* PAL macros */ +#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\ + V4L2_STD_PAL_B1 |\ + V4L2_STD_PAL_G) +#define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\ + V4L2_STD_PAL_D1 |\ + V4L2_STD_PAL_K) +/* +* "Common" PAL - This macro is there to be compatible with the old +* V4L1 concept of "PAL": /BGDKHI. +* Several PAL standards are mising here: /M, /N and /Nc +*/ +#define V4L2_STD_PAL (V4L2_STD_PAL_BG |\ + V4L2_STD_PAL_DK |\ + V4L2_STD_PAL_H |\ + V4L2_STD_PAL_I) +/* Chroma "agnostic" standards */ +#define V4L2_STD_B (V4L2_STD_PAL_B |\ + V4L2_STD_PAL_B1 |\ + V4L2_STD_SECAM_B) +#define V4L2_STD_G (V4L2_STD_PAL_G |\ + V4L2_STD_SECAM_G) +#define V4L2_STD_H (V4L2_STD_PAL_H |\ + V4L2_STD_SECAM_H) +#define V4L2_STD_L (V4L2_STD_SECAM_L |\ + V4L2_STD_SECAM_LC) +#define V4L2_STD_GH (V4L2_STD_G |\ + V4L2_STD_H) +#define V4L2_STD_DK (V4L2_STD_PAL_DK |\ + V4L2_STD_SECAM_DK) +#define V4L2_STD_BG (V4L2_STD_B |\ + V4L2_STD_G) +#define V4L2_STD_MN (V4L2_STD_PAL_M |\ + V4L2_STD_PAL_N |\ + V4L2_STD_PAL_Nc |\ + V4L2_STD_NTSC) +/* Standards where MTS/BTSC stereo could be found */ +#define V4L2_STD_MTS (V4L2_STD_NTSC_M |\ + V4L2_STD_PAL_M |\ + V4L2_STD_PAL_N |\ + V4L2_STD_PAL_Nc) + +/* Standards for Countries with 60Hz Line frequency */ #define V4L2_STD_525_60 (V4L2_STD_PAL_M |\ V4L2_STD_PAL_60 |\ V4L2_STD_NTSC |\ V4L2_STD_NTSC_443) +/* Standards for Countries with 50Hz Line frequency */ #define V4L2_STD_625_50 (V4L2_STD_PAL |\ V4L2_STD_PAL_N |\ V4L2_STD_PAL_Nc |\ V4L2_STD_SECAM) +#define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\ V4L2_STD_ATSC_16_VSB) - +/* Macros with none and all analog standards */ #define V4L2_STD_UNKNOWN 0#define V4L2_STD_ALL (V4L2_STD_525_60 |\ V4L2_STD_625_50)
Signature · 1 line
1.7.6.4
PATCH v2 7/8 msp3400: Add standards detection to the driver
As msp3400 allows standards detection, add support for it. That efectivelly means that devices with msp3400 can now implement VIDIOC_QUERYSTD, and it will provide very good detection for the standard, specially if combined with a video decoder detection.
--- drivers/media/video/msp3400-driver.c | 20 +++++++ drivers/media/video/msp3400-driver.h | 2 +- drivers/media/video/msp3400-kthreads.c | 86 +++++++++++++++++++++++-------- 3 files changed, 85 insertions(+), 23 deletions(-)
drivers/media/video/msp3400-driver.c +20 -0
@@ -426,6 +426,20 @@ static int msp_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *freq)return 0 ; } +static int msp_querystd (struct v4l2_subdev *sd,v4l2_std_id *id) +{ +struct msp_state *state =to_state (sd); +struct i2c_client *client =v4l2_get_subdevdata (sd); + + *id &= state->detected_std; + +v4l_dbg (2 , msp_debug, client, +"detected standard: %s(0x%08Lx)\n" , +msp_standard_std_name (state->std), state->detected_std); + +return 0 ; +} +static int msp_s_std (struct v4l2_subdev *sd,v4l2_std_id id) {struct msp_state *state =to_state (sd);
@@ -616,6 +630,10 @@ static const struct v4l2_subdev_core_ops msp_core_ops = { .s_std = msp_s_std, }; +static const struct v4l2_subdev_video_ops msp_video_ops = { + .querystd = msp_querystd, +}; +static const struct v4l2_subdev_tuner_ops msp_tuner_ops = { .s_frequency = msp_s_frequency, .g_tuner = msp_g_tuner,
@@ -630,6 +648,7 @@ static const struct v4l2_subdev_audio_ops msp_audio_ops = {static const struct v4l2_subdev_ops msp_ops = { .core = &msp_core_ops, + .video = &msp_video_ops, .tuner = &msp_tuner_ops, .audio = &msp_audio_ops, };
@@ -664,6 +683,7 @@ static int msp_probe(struct i2c_client *client, const struct i2c_device_id *id)v4l2_i2c_subdev_init (sd, client, &msp_ops); state->v4l2_std =V4L2_STD_NTSC ; + state->detected_std =V4L2_STD_ALL ; state->audmode =V4L2_TUNER_MODE_STEREO ; state->input =-1 ; state->i2s_mode =0 ;
drivers/media/video/msp3400-driver.h +1 -1
@@ -75,7 +75,7 @@ struct msp_state {int opmode;int std;int mode; -v4l2_std_id v4l2_std; +v4l2_std_id v4l2_std, detected_std;int nicam_on;int acb;int in_scart;
drivers/media/video/msp3400-kthreads.c +64 -22
163 lines not on this page · raw message
Signature · 1 line
1.7.6.4
PATCH v2 8/8 em28xx: Add VIDIOC_QUERYSTD support
Allow subdevs to return the detected standards
--- drivers/media/video/em28xx/em28xx-video.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)
drivers/media/video/em28xx/em28xx-video.c +16 -0
@@ -1156,6 +1156,21 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *norm)return 0 ; } +static int vidioc_querystd (struct file *file,void *priv,v4l2_std_id *norm) +{ +struct em28xx_fh *fh = priv; +struct em28xx *dev = fh->dev; +int rc; + + rc =check_dev (dev); +if (rc <0 ) +return rc; + +v4l2_device_call_all (&dev->v4l2_dev,0 , video, querystd, norm); + +return 0 ; +} +static int vidioc_s_std (struct file *file,void *priv,v4l2_std_id *norm) {struct em28xx_fh *fh = priv;
@@ -2354,6 +2369,7 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = { .vidioc_qbuf = vidioc_qbuf, .vidioc_dqbuf = vidioc_dqbuf, .vidioc_g_std = vidioc_g_std, + .vidioc_querystd = vidioc_querystd, .vidioc_s_std = vidioc_s_std, .vidioc_g_parm = vidioc_g_parm, .vidioc_s_parm = vidioc_s_parm,
Signature · 1 line
1.7.6.4
PATCH v2 5/8 pvrusb2: initialize standards mask before detecting standard
In reply to Mauro Carvalho Chehab--- drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/media/video/pvrusb2/pvrusb2-v4l2.c +1 -0
@@ -230,6 +230,7 @@ static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)case VIDIOC_QUERYSTD : {v4l2_std_id *std = arg; + *std =V4L2_STD_ALL ; ret =pvr2_hdw_get_detected_std (hdw, std);break ; }
Signature · 1 line
1.7.6.4
Re: [PATCHv2 5/8] [media] pvrusb2: initialize standards mask before detecting standard
Mauro:
With the line you've just added, then the " = arg" assignment in the immediate prior line is effectively dead code. Try this instead:
case VIDIOC_QUERYSTD:
{
- v4l2_std_id *std = arg;
+ v4l2_std_id *std = V4L2_STD_ALL;
ret = pvr2_hdw_get_detected_std(hdw, std); break;
}
-Mike
Quoted 18 lines · Mauro Carvalho Chehab
Signed-off-by Mauro Carvalho Chehab <[email protected]>--- drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)drivers/media/video/pvrusb2/pvrusb2-v4l2.c +1
-0@@ -230,6 +230,7 @@ static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)case VIDIOC_QUERYSTD : {v4l2_std_id *std = arg; + *std =V4L2_STD_ALL ; ret =pvr2_hdw_get_detected_std (hdw, std);break ; }
Signature · 3 lines
Mike Isely isely @ isely (dot) net PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8
Re: [PATCHv2 5/8] [media] pvrusb2: initialize standards mask before detecting standard
Em 05-10-2011 11:00, Mike Isely escreveu:
Quoted 5 lines
Mauro:
With the line you've just added, then the " = arg" assignment in the immediate prior line is effectively dead code. Try this instead:
Look better:
Quoted 2 lines
drivers/media/video/pvrusb2/pvrusb2-v4l2.c static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) · line 233
Quoted 2 lines
v4l2_std_id *std = arg;drivers/media/video/pvrusb2/pvrusb2-v4l2.c +1
-0+ *std =V4L2_STD_ALL ;
The above code is creating a pointer 'std' of the type 'v4l2_std_id', and initializing the pointer with the void *arg.
Then, it is doing an indirect reference to the pointer, filling its contents with V4L2_STD_ALL value.
The code above is sane (and, btw, it works). After those patches, the detection code will detect PAL/M or NTSC/M depending on the channel I tune here (my cable operator broadcasts some channels with one format, and others with the other one). Before this patch and the msp3400, it would return a mask with PAL/M and PAL/60 or a mask with all NTSC/M formats.
Regards,
Mauro.
Quoted 33 lines
case VIDIOC_QUERYSTD: {(quoted diff) +1
-1- v4l2_std_id *std = arg; + v4l2_std_id *std = V4L2_STD_ALL; ret = pvr2_hdw_get_detected_std(hdw, std); break; } -MikeQuoted 18 lines · Mauro Carvalho Chehab
Signed-off-by Mauro Carvalho Chehab<[email protected]>--- drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)drivers/media/video/pvrusb2/pvrusb2-v4l2.c +1
-0@@ -230,6 +230,7 @@ static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)case VIDIOC_QUERYSTD : {v4l2_std_id *std = arg; + *std =V4L2_STD_ALL ; ret =pvr2_hdw_get_detected_std (hdw, std);break ; }
Mike Isely
Acked-byRe: [PATCHv2 5/8] [media] pvrusb2: initialize standards mask before detecting standard
Quoted 7 lines · Mauro Carvalho Chehab
Em 05-10-2011 11:00, Mike Isely escreveu:
Quoted 5 lines
Mauro:
With the line you've just added, then the " = arg" assignment in the immediate prior line is effectively dead code. Try this instead:
Quoted 7 lines
Look better:
Quoted 2 lines
drivers/media/video/pvrusb2/pvrusb2-v4l2.c static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) · line 233
Quoted 2 lines
v4l2_std_id *std = arg;drivers/media/video/pvrusb2/pvrusb2-v4l2.c +1
-0+ *std =V4L2_STD_ALL ;The above code is creating a pointer 'std' of the type '
v4l2_std_id', and initializing the pointer with the void *arg.
Oh yeah, you're absolutely right. I got visually tricked by the well known confusing C initialization syntax when dealing with pointers! I've got to not respond to stuff like this in the morning until I've finished waking up. Duh...
Quoted 9 lines
Then, it is doing an indirect reference to the pointer, filling its contents with
V4L2_STD_ALLvalue.The code above is sane (and, btw, it works). After those patches, the detection code will detect PAL/M or NTSC/M depending on the channel I tune here (my cable operator broadcasts some channels with one format, and others with the other one). Before this patch and the msp3400, it would return a mask with PAL/M and PAL/60 or a mask with all NTSC/M formats.
Regarding your first version of the patch:
-Mike
Quoted 41 lines
Regards,
Mauro.Quoted 35 lines
case VIDIOC_QUERYSTD: {(quoted diff) +1
-1- v4l2_std_id *std = arg; + v4l2_std_id *std = V4L2_STD_ALL; ret = pvr2_hdw_get_detected_std(hdw, std); break; } -MikeQuoted 20 lines · Mauro Carvalho Chehab
Signed-off-by Mauro Carvalho Chehab<[email protected]>--- drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)drivers/media/video/pvrusb2/pvrusb2-v4l2.c +1
-0@@ -230,6 +230,7 @@ static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) case VIDIOC_QUERYSTD: { v4l2_std_id *std = arg; + *std =V4L2_STD_ALL ; ret =pvr2_hdw_get_detected_std (hdw, std);break ;}
Signature · 3 lines
Mike Isely isely @ isely (dot) net PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8