Opened 18 years ago
Closed 17 years ago
#2439 closed patch (fixed)
Add support for ivtv-generated bilingual dual audio MPEG
Reported by: | anonymous | Owned by: | Janne Grunau |
---|---|---|---|
Priority: | minor | Milestone: | 0.21 |
Component: | mythtv | Version: | head |
Severity: | medium | Keywords: | |
Cc: | szermatt@… | Ticket locked: | no |
Description
The Hauppauge PVR250+ cards can record bilingual broadcasts and flag them properly as containing a DUAL audio stream (= a stereo stream with left for one language and right for another language)
This patch adds support for this feature to mythtv:
- switch the flag on in the recording profile
- play MPEG files with dual streams properly, as if they contained two independent streams
This only works with PRV250/350 cards when using the X output (not the PVR 350 output)
background, history and usage information: http://us.geocities.com/szermatt/bilingual.html#step2
The patch attached is meant both for the 0.20 branch and the head.
Attachments (6)
Change History (29)
Changed 18 years ago by
Attachment: | language_04_myth_0_20_patch.txt added |
---|
comment:1 Changed 18 years ago by
Cc: | szermatt@… added |
---|
comment:2 Changed 18 years ago by
The same thing is present in dvb streams in Norway/Finland?... They broadcast multiple stereo streams which have different languages in each channel.
Whether they are identified in the dvb tables in a way we can make use of them is a different question...
comment:3 Changed 18 years ago by
Milestone: | unknown → 0.21 |
---|---|
Owner: | changed from Isaac Richards to danielk |
comment:4 Changed 18 years ago by
(In [11377]) Refs #2439. Record side of PVR-x50 SAP support patch from szermatt at gmx dt net.
This allows you to record either the main audio, SAP audio, or both (with recent ivtv drivers).
There is another part of the patch which makes it easier to select the streams, but it's not quite ready yet.
comment:5 Changed 18 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
The avformatdecoder portion of the patch as is does not work correctly when there are multiple streams some of which have the dual flag set. I've sent a more detailed problem report to Stephane via e-mail.
comment:6 Changed 18 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
I fixed the patch so that it accepts several stereo/dual streams. It would work, but since I don't have mpeg files configured like that, I couldn't test it...
comment:7 Changed 18 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:8 Changed 18 years ago by
I hate to break this to you guys, but attachment:2439-v2.patch (and the subsequent revision [11493]) breaks SAP for me: the dual audio track is detected properly when available on a channel, but regardless of which one I choose (from the menu or hitting "+") I still hear both languages simultaneously. Reverting [11493] and applying attachment:2439-v1.patch fixes the problem.
Also, probably due to the fact that I'm running the head revision of video4linux and ivtv, in addition to reverting [11493] I had to hack a one-liner based on [11377] to prompt ivtv to mark the mpeg stream as dual when appropriate. It seems the new version of ivtv wants V4L2_TUNER_MODE_LANG1_LANG2 (as opposed to V4L2_TUNER_MODE_STEREO) in order to properly detect bilingual transmissions.
Should I try to open a new bug for these issues, or reopen this one?
Pertinent info on my setup:
- Hauppauge PVR150
- standard US-type cable (no multiple dual streams per channel, just the usual stereo/mono/sap).
- Ubuntu Edgy 6.10 (2.6.17 kernel family)
- video4linux head
- ivtv head
- mythtv head
comment:9 Changed 18 years ago by
V4L2_TUNER_MODE_LANG1_LANG2 is indeed what the newest versions of the driver want, yet the currently released versions will work only with MODE_STEREO (the meaning of both flags must have been switched at some point). http://v4l2spec.bytesex.org/spec/r9122.htm To fix that, myth will need to check the driver version... I'll have a look and see what can be done, but it's definitely going to be a pain.
For the other issue, it's really strange that you're having problems with an area that I would have said is common in v1 and v2, especially since we're practically using the same system. Which version of gcc/libstdc++ are you using ? Would you be willing to try out some alternative patches if I send you some ?
comment:10 Changed 18 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I could reproduce the problem. It is present in subversion, but not in the patch (that's why I hadn't seen it).
I'll attach another patch (one line, really) that should fix it.
You might also want to do: (>=, not <)
if (channel >= (uint)audioInfo->channels)
return
but since we're dealing with two channels here, by design, I prefer checking for 0 or 1.
comment:11 Changed 18 years ago by
Cool, I'll test the new patch tonight (that's in a couple of hours; GMT-3).
(BTW, thank you for doing such an excellent job on the whole SAP deal. Regardless of these little tweaks at the end of the road, your work made my WAF increase at least an order of magnitude!)
comment:12 Changed 18 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:13 Changed 17 years ago by
Just as a general FYI, this feature is now broken in [14915] in conjunction with ivtv 1.0.0 (as included in kernel 2.6.22, or Ubuntu Gutsy). I'm not sure what is at fault, will investigate further.
comment:14 Changed 17 years ago by
Ok, the dual flag of the mp2 stream is being set, so I'm guessing ivtv is not at fault. If I setup TV recording for "Dual", I hear both languages simultaneously. "Main" and "SAP" work as advertized. The problem is that I can't choose between languages using the "Next audio track" action when playing back or in Live TV.
comment:15 Changed 17 years ago by
The ivtv flags mythtv relies on for this feature has changed when itvt has been integrated into the kernel. The current implementation will definitely only work with ivtv version < 1.0.0
It's just a matter of setting different values... Unfortunately because of that this feature can work either with ivtv version >= 1.0.0 or with ivtv version < 1.0.0 (this could be chosen at compilation time, I guess), not both.
I still have an old kernel and I can't upgrade it because of other issues (with itvt tv out), so I can't really upgrade the patch to support ivtv 1.0
comment:16 Changed 17 years ago by
Ok, that makes sense. As I noted in the comments about a year ago, I had to hack into mpegrecorder.cpp and replace V4L2_TUNER_MODE_STEREO with V4L2_TUNER_MODE_LANG1_LANG2 to make it work with the head revisions of ivtv. That one-liner is still in my checkout, but it is no longer sufficient. Any tips on where I should look?
comment:17 Changed 17 years ago by
Any tips on where I should look?
linux-2.6.23/include/media/v4l2-common.h http://www.linuxtv.org/downloads/video4linux/API/V4L2_API/spec-single/v4l2.html#VIDIOC-G-TUNER
Changed 17 years ago by
Attachment: | 2439-v4.patch added |
---|
Changed 17 years ago by
Attachment: | 2439-ivtv-1.0.0.patch added |
---|
To make SAP work with ivtv 1.0.0 or greater.
comment:18 follow-up: 21 Changed 17 years ago by
What happened was that [14800] resynced most of ffmpeg with upstream, and the initialization of avtcx->avcodec_dual_language got overlooked (the calling function, mpa_decode_header(), doesn't exist anymore as such). See attachment:2439-v4.patch, I tested it against [14915] and it works.
I also added attachment:2439-ivtv-1.0.0.patch, which is need if one wants this feature to work with the ivtv driver included in kernels 2.6.21 and up (a.k.a ivtv 1.0.0). It is not meant to be included in trunk, as what would be needed is a proper check for the current version of ivtv; it's more of a pointer in the right direction.
Should this ticket be reopened? After all, the SAP feature is undoubtedly broken after [14800], regardless of ivtv version.
comment:19 Changed 17 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
janne, can you look at this?
comment:20 Changed 17 years ago by
Owner: | changed from danielk to Janne Grunau |
---|---|
Status: | reopened → new |
comment:21 Changed 17 years ago by
Replying to Adolfo R. Brandes <arbrandes@gmail.com>: The patch works flawlessly. Thank you very much.
comment:22 Changed 17 years ago by
comment:23 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
language4_0.20.patch