Dear Hans,With your patch applied to kernel 4.14.6 on openSUSE I can get the video working, changing channels also works. But I don't have any audio output. Even if I just do:
$ cat /dev/video0 > test.mpg then when I open test.mpg with vlc there is no sound as if it is muted.I tried 'v4l2-ctl -c mute=0', 'v4l2-ctl --set-audio-input=0; v4l2-ctl --set-audio-input=1' so far but nothing changed. Is there something else I could try to get audio output?
Best, OleksandrBTW, on Mint with kernel 4.13.0 regardless of the patch I get a kernel panic as soon as I plug in the device. Something fishy going on there.
On 14.12.17 10:54, Hans Verkuil wrote:
On 14/12/17 10:52, Oleksandr Ostrenko wrote:On Thursday, December 14, 2017 12:44:42 AM CET Hans Verkuil wrote:The pvrusb2 code appears to have a some old workaround code for xawtv that causes a WARN() due to an unrecognized pixelformat 0 in v4l2_ioctl.c. Since all other MPEG drivers fill this in correctly, it is a safe assumption that this particular problem no longer exists. While I'm at it, clean up the code a bit. Signed-off-by: Hans Verkuil <hans.verkuil@xxxxxxxxx> --- I'll try to give this a spin in the morning with xawtv and my ivtv card (that also uses V4L2_PIX_FMT_MPEG), just to make sure xawtv no longer breaks if it sees it. Oleksandr, are you able to test this as well on your pvrusb2?Thanks, Hans, this fixes the original issue on Linux Mint with kernel 4.8.17. Haven't tried it on openSUSE yet. Still, in xawtv I get no TV reception but just a black screen and error messages like: no way to get: 128x96 32 bit TrueColor (LE: bgr-) no way to get: 128x96 32 bit TrueColor (LE: bgr-) no way to get: 128x96 32 bit TrueColor (LE: bgr-) no way to get: 128x96 32 bit TrueColor (LE: bgr-) no way to get: 384x288 32 bit TrueColor (LE: bgr-) Is this another bug?No. xawtv simply doesn't support MPEG formats. So this is what I would expect. Regards, HansBest, OleksandrRegards, Hans --- diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c index 4320bda9352d..cc90be364a30 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c @@ -78,18 +78,6 @@ static int vbi_nr[PVR_NUM] = {[0 ... PVR_NUM-1] = -1}; module_param_array(vbi_nr, int, NULL, 0444); MODULE_PARM_DESC(vbi_nr, "Offset for device's vbi dev minor"); -static struct v4l2_fmtdesc pvr_fmtdesc [] = { - { - .index = 0, - .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, - .flags = V4L2_FMT_FLAG_COMPRESSED, - .description = "MPEG1/2", - // This should really be V4L2_PIX_FMT_MPEG, but xawtv - // breaks when I do that. - .pixelformat = 0, // V4L2_PIX_FMT_MPEG, - } -}; - #define PVR_FORMAT_PIX 0 #define PVR_FORMAT_VBI 1 @@ -99,17 +87,11 @@ static struct v4l2_format pvr_format [] = { .fmt = { .pix = { .width = 720, - .height = 576, - // This should really be V4L2_PIX_FMT_MPEG, - // but xawtv breaks when I do that. - .pixelformat = 0, // V4L2_PIX_FMT_MPEG, + .height = 576, + .pixelformat = V4L2_PIX_FMT_MPEG, .field = V4L2_FIELD_INTERLACED, - .bytesperline = 0, // doesn't make sense - // here - //FIXME : Don't know what to put here... - .sizeimage = (32*1024), - .colorspace = 0, // doesn't make sense here - .priv = 0 + /* FIXME : Don't know what to put here... */ + .sizeimage = 32 * 1024, } } }, @@ -407,11 +389,11 @@ static int pvr2_g_frequency(struct file *file, void *priv, struct v4l2_frequency static int pvr2_enum_fmt_vid_cap(struct file *file, void *priv, struct v4l2_fmtdesc *fd) { - /* Only one format is supported : mpeg.*/ - if (fd->index != 0) + /* Only one format is supported: MPEG. */ + if (fd->index) return -EINVAL; - memcpy(fd, pvr_fmtdesc, sizeof(struct v4l2_fmtdesc)); + fd->pixelformat = V4L2_PIX_FMT_MPEG; return 0; }
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature