Mailing List Archive

Enabling IOMMU seems to have broken my tuners
Hello,

Using a hauppauge four tuner pci card. This system has been working fine,
but about to start using VMs with their own gpu, so had to enable IOMMU.
That's the only thing I''ve done lately, but now recordings and live TV
fail to tune.

When I go to live TV, it shows that the card is getting a strong signal,
but it only says Partial Lock, and it never locks.

I see via dmesg that it shows two tuners (there are four, but maybe each
one does two?) and it has put them each into their own iommu group.

Does anyone know what's going on or how to fix this??

Thanks!

-- George
Re: Enabling IOMMU seems to have broken my tuners [ In reply to ]
On Thu, Jan 26, 2023 at 11:24 PM George Bingham <georgeb1962@gmail.com> wrote:

> Does anyone know what's going on or how to fix this??

Not really, but a couple of random questions that may
lead to better guesses (or additional confusion)

* Is your MythTV BE in a VM too?

* Have you validated it is IOMMU by disabling the enablement?

* What is your distro/version?

* Are you using in-kernel drivers, or the Hauppauge PPA drivers?
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Enabling IOMMU seems to have broken my tuners [ In reply to ]
On Thu, Jan 26, 2023 at 8:48 PM Gary Buhrmaster <gary.buhrmaster@gmail.com>
wrote:

> On Thu, Jan 26, 2023 at 11:24 PM George Bingham <georgeb1962@gmail.com>
> wrote:
>
> > Does anyone know what's going on or how to fix this??
>
> Not really, but a couple of random questions that may
> lead to better guesses (or additional confusion)
>
> * Is your MythTV BE in a VM too?
>
> No, the BE is on the host, which is ubuntu 22.04, and BE is the latest V32.


> * Have you validated it is IOMMU by disabling the enablement?
>
Yes, I backed out of the change last night and the BE worked for all my
prime time recordings.

>
> * What is your distro/version?
>

Ubuntu 22.04, 5.15.0-58-generic

>
> * Are you using in-kernel drivers, or the Hauppauge PPA drivers?
>

Pretty sure I'm just using in-kernel drivers...

I don't know much about iommu groups, but I am wondering if each half of
the tuner is being put into separate iommu groups and hence it breaks the
driver? There was a little script I ran after enabling iommu that shows
what devices are in what iommu groups, and this card looks like two
Conextent devices, and they are put into separate iommu groups. I can't
reproduce that output because I backed out of that change and it's
currently working without iommu being enabled.

Thanks,

George

> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
>
Re: Enabling IOMMU seems to have broken my tuners [ In reply to ]
On Fri, Jan 27, 2023 at 4:58 PM George Bingham <georgeb1962@gmail.com> wrote:

>> * What is your distro/version?
>
>
> Ubuntu 22.04, 5.15.0-58-generic

Are you using an AMD Renior/Cezanne system?
There is a kernel patch that fixes a specific issue
with those systems and IOMMU for some core
media tuners that even calls out MythTV as an
impacted app and first identified on a 5.15 kernel
(other generations of related implementations
might also be impacted). Looks like it might
need a (very) recent kernel to fix (the patch did
not go into mainline until August of 2022, which
would likely mean 6.0.x), although it might have
gotten backported in some distros.

In any case, I suspect that upstream will require
you to test with a recent kernel before accepting
a bug report.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Enabling IOMMU seems to have broken my tuners [ In reply to ]
On Fri, Jan 27, 2023 at 4:06 PM Gary Buhrmaster <gary.buhrmaster@gmail.com>
wrote:

> On Fri, Jan 27, 2023 at 4:58 PM George Bingham <georgeb1962@gmail.com>
> wrote:
>
> >> * What is your distro/version?
> >
> >
> > Ubuntu 22.04, 5.15.0-58-generic
>
> Are you using an AMD Renior/Cezanne system?
> There is a kernel patch that fixes a specific issue
> with those systems and IOMMU for some core
> media tuners that even calls out MythTV as an
> impacted app and first identified on a 5.15 kernel
> (other generations of related implementations
> might also be impacted). Looks like it might
> need a (very) recent kernel to fix (the patch did
> not go into mainline until August of 2022, which
> would likely mean 6.0.x), although it might have
> gotten backported in some distros.
>
> In any case, I suspect that upstream will require
> you to test with a recent kernel before accepting
> a bug report.
>
>
Thanks,

No, I'm running on an older HP Z210 workstation, it has an i7 and 16Gb ram.

I was trying to enable IOMMU so that I could devote an old GPU to running a
windows VM.

I know I can run windows without giving it this gpu, but that'd be useless
for my use case.

Darn, because until about a month ago I was still using this old GPU, and I
had to keep my older ubuntu kernel because newer ones didn't support it. I
was happy to update to the latest of everything when I got the new GPU...
(well, latest ubuntu and latest release of MythTV).

Maybe I could run the backend in a VM? I've heard of folks doing that,
but don't know what the pros and cons would be.

If anyone has run the backend in a VM I would be interested in their setup
and any problems they encountered.

Will look into updating the kernel.... Not glued to ubuntu either, maybe
it's time to look at arch or rh or something that'll give me more bleeding
edge.

George
Re: Enabling IOMMU seems to have broken my tuners [ In reply to ]
On Fri, Jan 27, 2023 at 11:48 PM George Bingham <georgeb1962@gmail.com> wrote:

> Will look into updating the kernel....

You could also try the Hauppauge PPA, which
supposedly has the latest/greatest drivers for
their cards.

The Z210 uses the C206 chipset, which might
need its own quirk settings for the Hauppauge
cards.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Enabling IOMMU seems to have broken my tuners [ In reply to ]
On Sat, Jan 28, 2023 at 2:24 AM Gary Buhrmaster
<gary.buhrmaster@gmail.com> wrote:

> The Z210 uses the C206 chipset, which might
> need its own quirk settings for the Hauppauge
> cards.

The C206 chipset is a Xeon targeted chipset, and
the code in one of the possibly related drivers
mention some Xeon chipsets can be impacted,
with a likely error in the logs of the form:
mpeg risc op code error

If your card uses the cx23885 driver, try adding a

options cx23885 dma_reset_workaround=2

to an appropriate modprobe.conf.d file (if it does
not help, remove it).
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Enabling IOMMU seems to have broken my tuners [ In reply to ]
On Sun, Jan 29, 2023 at 2:12 PM Gary Buhrmaster <gary.buhrmaster@gmail.com>
wrote:

> On Sat, Jan 28, 2023 at 2:24 AM Gary Buhrmaster
> <gary.buhrmaster@gmail.com> wrote:
>
> > The Z210 uses the C206 chipset, which might
> > need its own quirk settings for the Hauppauge
> > cards.
>
> The C206 chipset is a Xeon targeted chipset, and
> the code in one of the possibly related drivers
> mention some Xeon chipsets can be impacted,
> with a likely error in the logs of the form:
> mpeg risc op code error
>
> If your card uses the cx23885 driver, try adding a
>
> options cx23885 dma_reset_workaround=2
>
> to an appropriate modprobe.conf.d file (if it does
> not help, remove it).
>
> Hi Gary,

Hey, that worked! Thank You, how in the heck did you figure that out??

Anyway, glad you did, thank you!
Re: Enabling IOMMU seems to have broken my tuners [ In reply to ]
On Mon, Jan 30, 2023 at 2:14 PM George Bingham <georgeb1962@gmail.com>
wrote:

> On Sun, Jan 29, 2023 at 2:12 PM Gary Buhrmaster <gary.buhrmaster@gmail.com>
> wrote:
>
>> On Sat, Jan 28, 2023 at 2:24 AM Gary Buhrmaster
>> <gary.buhrmaster@gmail.com> wrote:
>>
>> The C206 chipset is a Xeon targeted chipset, and
>> the code in one of the possibly related drivers
>> mention some Xeon chipsets can be impacted,
>> with a likely error in the logs of the form:
>> mpeg risc op code error
>>
>> If your card uses the cx23885 driver, try adding a
>>
>> options cx23885 dma_reset_workaround=2
>>
>> to an appropriate modprobe.conf.d file (if it does
>> not help, remove it).
>>
>> Hi Gary,
>
> Hey, that worked! Thank You, how in the heck did you figure that out??
>
> Anyway, glad you did, thank you!
>
>
Interesting results come back searching the dma_reset_workaround=2 flag for
cx23885, inclusive of this one older issue, that seems spot on.
https://github.com/b-rad-NDi/Ubuntu-media-tree-kernel-builder/issues/69#issuecomment-482776122
Also the original patch seems to be
https://github.com/b-rad-NDi/Ubuntu-media-tree-kernel-builder/issues/51

Mike
Re: Enabling IOMMU seems to have broken my tuners [ In reply to ]
On Mon, Jan 30, 2023 at 9:13 PM George Bingham <georgeb1962@gmail.com> wrote:

> Hey, that worked!

Glad it worked (it was not assured to do so).

> Thank You, how in the heck did you figure that out??

Well, knowing it was IOMMU related for a tuner card,
I read the kernel driver code where it mentioned
certain xeon and amd chipsets were sometimes
impacted (i.e.easy peasy). There are probably
other ways to figure it out, but I like to go to the
source (pun unintentional, but acknowledged).
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org