More fun with MythTV and the HVR-950q

Spent tonight continuing to debug the 950q under MythTV. I temporarily disabled the au8522’s power management, and the MythTV channel scanner started to see the channels, but it was otherwise behaving quite erratically. MythTV seemed to be trying to do a scan of both the ATSC side and the analog side at the same time, even though both were in the same device group. Also, the “scan for channels” button was disabled in analog mode, which I couldn’t understand why. I assumed my device was announcing its capabilities improperly to MythTV, until I realized that the same behavior was occuring with the older HVR-950 and the PCTV 800i as well. Then I found the following ticket:

Doh! I had upgraded my Ubuntu system to Karmic so I would be confident I had a relatively recent MythTV build. However, it turns up the snapshot they took has known issues with the channel scanner, and they actually disabled it entirely (except I seem to have found a way around it accidentally).

Moving on, I switched to a SchedulesDirect verison of the analog channels definitions, and was up and running with my 800i. This allowed me to then switch it out for the 950q, and I now reproduce what users are complaining about – when you try to “Watch TV”, the GUI pauses for 30 seconds, and returns. Adding some debug code to the driver revealed that MythTV always asks for YU12 format, and then falls back to YUYV format. If neither are supported, MythTV fails in a rather obscure manner, giving the user no indication what went wrong.

To confirm this was the issue, I hacked the au0828 driver to *claim* to be in YUYV mode instead of UYVY, and like magic, MythTV started to show a picture (although with the chroma and luma inverted as would be expected).

Now, the 950Q only supports UYVY. While this is a fairly popular pixel format, most devices that support it *also* support YUYV, which is why I suspect nobody else is hitting this issue. To my knowledge, the au8522 doesn’t support any other formats, but since I have never seen the datasheet, I cannot know for sure. I did use the Windows GraphEdit tool and UYVY was the only format the Windows driver claims to support.

So the good news is I seem to know what the problem is, and I believe MythTV can be extended to also support UYVY format. Since it uses libswscale borrrowed from ffmpeg, which already supports the format, I think in the end we are looking at a fairly straightforward 30 line patch to MythTV.

The bad news is that the 950q isn’t going to work with today’s existing binary packages that come with your distro, meaning users will either have to build from svn (after my patch goes in), or they will have to wait for your distro to adopt a version that includes the fix.

6 thoughts on “More fun with MythTV and the HVR-950q

  1. I’m trying to get my HVR-950Q working using the latest Mythbuntu distro and I’m running into this issue. Have you put the aforementioned patch in? If so, how can I tell (or not tell) if my current config contains the patch?

    • Specifically which issue are you running into? The UYVY changes were committed and already in 0.22. There is still an issue switching back and forth between analog and digital mode.


      • I’m experiencing the “when you try to “Watch TV”, the GUI pauses for 30 seconds, and returns.” issue. My distro chose au0828 as the driver for the HVR-950Q, which from what I can tell from the cardlist is correct. The excerpt from my mythbackend.log shows a failure in an “obscure manner” and it appears color-related, so I figured it’s the same issue:

        2010-01-21 19:48:02.349 TVRec(1): Changing from None to Watching WatchingLiveTV
        2010-01-21 19:48:02.406 TVRec(1): HW Tuner: 1->1
        2010-01-21 19:48:11.364 Channel(/dev/video1) Error: InitPictureAttribute( colour): failed to query controls.
        eno: Invalid argument (22)
        2010-01-21 19:48:11.524 SampleRate: Attempted to add a rate 32000 Hz, which is not in the list of allowed rates.
        2010-01-21 19:48:11.702 Channel(/dev/video1) Error: InitPictureAttribute( colour): failed to query controls.
        eno: Invalid argument (22)
        2010-01-21 19:48:11.791 AutoExpire: CalcParams(): Max required Free Space: 2.0 GB w/freq: 15 min
        2010-01-21 19:48:12.025 TVRec(1): Changing from Watching WatchingLiveTV to None
        2010-01-21 19:48:12.074 Unknown type, recording width was 0
        2010-01-21 19:48:12.373 Finished recording College Basketball "Louisville at Seton Hall": channel 1031
        2010-01-21 19:48:12.476 MainServer, Warning: Unknown socket closing MythSocket(0x902340)
        2010-01-21 19:48:12.518 MythSocket(902340:-1): writeStringList: Error, socket went unconnected.
        We wrote 0 of 10 bytes with 1 errors

        • Hi Joel,

          Ah, ok. If you update to the latest v4l-dvb code, the errors about “InitPictureAttribute” will go away. But that’s not critical.

          Did you add the “no_poweroff=1” option to the modprobe configuration for the xc5000 driver? If not, that is why you will see the frontend timeout and return to the menu when attempting to watch LiveTV.

          Also, make sure that you set the capture resolution to 720×480 (480×480 is the default), or else the picture will appear stretched. This is actually a bug in MythTV which I haven’t had a chance to fix yet.


          • Fantastic! Adding the “no_poweroff=1” option to the modprobe configuration for the xc5000 driver worked like a charm! I had seen that in several posts throughout the internet but hadn’t given it a shot yet. Many thanks Devin! I will keep an eye on the blog for future updates.

Leave a Reply