[mythtv-users] [SOLVED!!!} Re: Epia-M10K (Nehemiah) software mpeg2 decoder

Mikhail D'Vane mikhaildvane at hotmail.com
Sat Feb 28 11:20:54 EST 2004


That thread over at viaarena.com was indeed worth another
look (Thanks Andrew!).

After 3 months of grueling trial and error work, the poor mpeg
software decoding playback issue on my via Epia-M 10K is
solved!

For those of you that have Nehemiah-based Epias, I urge you
to check the following.  You might not have to use hardware
decoding in order to have smooth playback.

The problem is CPU stepping.  My Nehemiah is a stepping 3 and
it seems that this revision of the processor does not return the
correct "edx" field when a cpuid instruction is issued.  Unfortunately,
libavcodec uses the edx field to determine which multi-media
extensions the processor supports (Nehemiah is MMX, in this case).
Since edx is not returned correctly, the software doesn't detect
*any* MMX capability.

Here's the steps to the fix:

1.  Check your cpu stepping in /proc/cpuinfo.  If it's 3, then you
     have this issue.

2.  Find the file cputest.c in the mythtv source code.  (For me it
     was under .../libs/libavcodec/i386/.

3.  Edit the cputest.c file as follows:

     Before:

        ...
        /* VIA C3 */
        cpuid(0x80000000, eax, ebx, ecx, edx);
        if ((unsigned)eax < 0x80000001)
            goto inteltest;
        cpuid(0x80000001, eax, ebx, ecx, edx);
        rval = 0;
        if( edx & ( 1 << 31) )
          rval |= MM_3DNOW;
        if( edx & ( 1 << 23) )
          rval |= MM_MMX;
        if( edx & ( 1 << 24) )
          rval |= MM_MMXEXT;
        return rval;
        ...

    After:

       ...
        /* VIA C3 */
        cpuid(0x80000000, eax, ebx, ecx, edx);
        if ((unsigned)eax < 0x80000001)
            goto inteltest;
        cpuid(0x80000001, eax, ebx, ecx, edx);
        edx = 0x1380b035;       // XXX *** broken C3-2 CPUID 693 *** XXX
        rval = 0;
        if( edx & ( 1 << 31) )
          rval |= MM_3DNOW;
        if( edx & ( 1 << 23) )
          rval |= MM_MMX;
        if( edx & ( 1 << 24) )
          rval |= MM_MMXEXT;
        return rval;

4.  Re-compile mythtv (be sure to do a make clean prior to
     recompiling to ensure the old .o files are removed).

After re-compiling, my sofware playback is down to ~50% CPU
for a 480x480 resolution at 4500/6000 bps.  Before, the CPU
was pegged (100%).

Thanks to Andrew Wilson (for helping point me to the fix) and
Geoffery Espin (for coming up with the fix)!

Mik

>From: "Andrew G. Wilson" <agwilson at rhetorical.com>
>Reply-To: Discussion about mythtv <mythtv-users at mythtv.org>
>To: mythtv-users at mythtv.org
>Subject: [mythtv-users] Re: Epia-M10K (Nehemiah) software mpeg2 decoder
>Date: Wed, 25 Feb 2004 10:35:05 +0000
>
>There's a thread over at the viaarena.com forums talking about different 
>revisions of the M10k producing different CPU usage, and it's something to 
>do with MMX/SSE capability not being detected on the newer ones. I can't 
>remember the details, but that's where I'd start looking.
>
>
>>
>>Yup ticking along hapilly at about 40% here on an M9000.
>>
>>The only think that springs to mind about your two machines is are they
>>truly identical? same hard drive? same RAM? same BIOS settings? are the
>>memory timings set the same in the BIOS?
>>
>>However, I'd recommend you try and get the hardware decoding working. If
>>people don't use it and don't report problems then it will never get 
>>fixed!
>>
>>Cheers,
>
>
>_______________________________________________
>mythtv-users mailing list
>mythtv-users at mythtv.org
>http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

_________________________________________________________________
Stay informed on Election 2004 and the race to Super Tuesday. 
http://special.msn.com/msn/election2004.armx



More information about the mythtv-users mailing list