Opened 15 years ago

Closed 15 years ago

#2504 closed defect (fixed)

Allow myth to compile against upstream ivtv.h

Reported by: mrsam@… Owned by: danielk
Priority: trivial Milestone: 0.21
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no


This patch gets mythtv compiled against the current upstream ivtv.h header, the --enable-ivtv-sys-header option to configure will actually work now.

All that's necessary here is to comment out an ioctl that's no longer implemented and defined in the current ivtv.h, and fallback to an existing "plan B" used by mpegrecoder.cpp if this ioctl fails.

I suppose that the relevant code section can be "#ifndef USING_IVTV_HEADER", instead...

Attachments (1)

mythtv-0.20.vbipatch.txt (986 bytes) - added by mrsam@… 15 years ago.

Download all attachments as: .zip

Change History (7)

Changed 15 years ago by mrsam@…

Attachment: mythtv-0.20.vbipatch.txt added

comment:1 Changed 15 years ago by danielk

Milestone: unknown0.21
Owner: changed from Isaac Richards to danielk
Priority: minortrivial
Severity: mediumlow
Version: 0.20head

comment:2 Changed 15 years ago by danielk

Resolution: fixed
Status: newclosed

(In [11378]) Fixes #2504. Makes mpegrecorder.cpp compatible with the current and past ivtv system headers.

This just adds a few ifdefs so you can use ivtv system headers in place of the MythTV ones for the last few versions of ivtv. The old VBI embedding ioctls have been removed from the latest ivtv headers.

comment:3 Changed 15 years ago by miwer at miwers dot dk

Resolution: fixed
Status: closedreopened
Type: patchdefect

FYI, this changeset breaks VBI recording for me. I used to have teletext, but not anymore since this change. I get these messages in the backend log:

--- snip ---
2006-10-12 23:42:49.433 TVRec(1): Changing from None to WatchingLiveTV
2006-10-12 23:42:49.435 TVRec(1): HW Tuner: 1->1
2006-10-12 23:42:49.592 Can't enable VBI recording
                        eno: Invalid argument (22)
--- snip ---

If I reverse the patch, VBI recording is working fine, and I have teletext again.

I'm on Gentoo, amd64, latest stable kernel (2.6.17-r8), latest compatible ivtv (0.7.1), PVR-500mce

comment:4 Changed 15 years ago by danielk

miwers, what configure options are you using? Does using (or not using) "--enable-ivtv-sys-header" change anything?

If you are using the MythTV headers, MythTV is complaining that neither IVTV_IOC_S_VBI_MODE, nor V4L2_BUF_TYPE_SLICED_VBI_CAPTURE works. The IVTV ioctl is works for 0.4 and older drivers, and V4L2 ioctl is intended for 0.8+ drivers. I don't know which ioctls work with the 0.7.1 drivers off the top of my head, but one of them should work.

comment:5 Changed 15 years ago by miwer

thanks daniel, using that option makes VBI recording work again for me - it isn't defined in my SVN ebuild. Shouldn't it be the default behavior for mythtv to use the upstream ivtv headers in the future? Default atm is ivtv_header=no

I tried inserting some code to reveal which ioctls are defined or not, and tested this with mythtv headers and ivtv upstream headers. Here's the result:

myth_ivtv headers

2006-10-27 01:35:41.477 IVTV_IOC_S_VBI_MODE defined
2006-10-27 01:35:41.478 V4L2_BUF_TYPE_SLICED_VBI_CAPTURE _not_ defined
2006-10-27 01:35:41.479 Can't enable VBI recording
                        eno: Invalid argument (22)
2006-10-27 01:35:41.480 IVTV_IOC_S_VBI_EMBED defined
2006-10-27 01:35:41.481 IVTV_IOC_G_VBI_MODE defined

ivtv headers

2006-10-27 01:11:07.991 IVTV_IOC_S_VBI_MODE _not_ defined
2006-10-27 01:11:07.992 V4L2_BUF_TYPE_SLICED_VBI_CAPTURE _not_ defined
2006-10-27 01:11:07.993 Can't enable VBI recording
                        eno: Success (0)
2006-10-27 01:11:07.995 IVTV_IOC_S_VBI_EMBED defined
2006-10-27 01:11:07.996 IVTV_IOC_G_VBI_MODE _not_ defined

There's one little quirk here, the ifdefs you've defined result in the following code compiled, which of course will always generate the above "error" message, which - despite the look of it - does not indicate the success of enabling VBI recording. /me thinks that happens in the 3rd ifdef. Correct me if I'm wrong.

    if (vbimode)
                VERBOSE(VB_IMPORTANT, "Can't enable VBI recording" + ENO);

... maybe some moving it around a bit will fix this. It's a minor glitch, I know, but still... :)

comment:6 Changed 15 years ago by danielk

Resolution: fixed
Status: reopenedclosed

(In [11664]) Fixes #2504. Allows mpegrecorder to enable captioning with some of the newer ivtv drivers again by fixing a bug introduced in [11378].

The problem was that we ifdef'ed on something that has become an enum. This switches over to using a define that was introduced in the same ivtv version as the enum value we need.

Note: See TracTickets for help on using tickets.