Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 18511 - emerge mplayer doesn't detect/use altivec on benh kernels
Summary: emerge mplayer doesn't detect/use altivec on benh kernels
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: PPC Linux
: High normal (vote)
Assignee: PPC Porters
Depends on:
Reported: 2003-03-30 20:44 UTC by Stephan van Maris
Modified: 2004-04-03 15:19 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---

Patch to mplayer to enable altivec on benh kernels (configure-altivec.patch,1.39 KB, patch)
2003-03-30 20:45 UTC, Stephan van Maris
Details | Diff
mplayer-ppc.patch (mplayer-ppc.patch,1.98 KB, patch)
2003-04-06 23:36 UTC, Lars Weiler (RETIRED)
Details | Diff
mplayer-ppc.patch (mplayer-ppc.patch,1.98 KB, patch)
2003-04-06 23:37 UTC, Lars Weiler (RETIRED)
Details | Diff
mplayer-0.90_rc5.ebuild (mplayer-0.90_rc5.ebuild,10.12 KB, text/plain)
2003-04-06 23:38 UTC, Lars Weiler (RETIRED)
my configure patched, yet to be merged with Pylon's one (configure,149.17 KB, text/plain)
2003-04-07 18:16 UTC, Luca Barbato
auxtable parser, just shows if the altivec is present. (auxtable.c,507 bytes, text/plain)
2003-04-07 18:18 UTC, Luca Barbato
mplayer-0.90-ppc-benh.patch (mplayer-0.90-ppc-benh.patch,1.98 KB, patch)
2003-04-12 08:38 UTC, Lars Weiler (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan van Maris 2003-03-30 20:44:39 UTC
Because of incompatibilities between /proc/cpuinfo on 'normal' kernels and the one 
by benh, the mplayer configure script does not detect altivec, so it will build 
without altivec-optimizations. 
I added a small fix, which is by all means not a very beautiful patch, but it works 
for me.
Comment 1 Stephan van Maris 2003-03-30 20:45:40 UTC
Created attachment 10050 [details, diff]
Patch to mplayer to enable altivec on benh kernels
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2003-04-06 05:47:20 UTC
Did you submit this to yet ?
Comment 3 Luca Barbato gentoo-dev 2003-04-06 13:18:11 UTC
svmaris actually we get a little cpufeature checker application from the people at #mklinux and Pylon is completing the cpuparser script, once finished we'll send everything to upstream, please wait
Comment 4 Lars Weiler (RETIRED) gentoo-dev 2003-04-06 23:35:26 UTC
I added some ability to the configuration file to set the right mcpu and mtunes settins in case of the info that /proc/cpuinfo results.  The patch is built upon the one of svmarvis.

Maybe somebody with a G4 can test it?  And somebody with a non-benh-kernel?

During the configure-process there should be a line similar to
Checking for Using ppc (745/755) optimizations ... -mtune=750 and -mcpu=750
with the right options for G4s.  Furthermore altivec should be detected.

If this will fail on non-benh-kernels we have to scan, which kernel is used (uname will help here) and do the changes only for benh-kernels.  Or can somebody paste here a /proc/cpuinfo for the "official" gentoo-ppc-kernel?
Comment 5 Lars Weiler (RETIRED) gentoo-dev 2003-04-06 23:36:51 UTC
Created attachment 10308 [details, diff]

The patch for locating in the files-directory
Comment 6 Lars Weiler (RETIRED) gentoo-dev 2003-04-06 23:37:07 UTC
Created attachment 10309 [details, diff]

The patch for locating in the files-directory
Comment 7 Lars Weiler (RETIRED) gentoo-dev 2003-04-06 23:38:49 UTC
Created attachment 10310 [details]

ebuild that will inherit the mplayer-ppc.patch
Comment 8 Lars Weiler (RETIRED) gentoo-dev 2003-04-06 23:39:32 UTC
Comment on attachment 10308 [details, diff]

dubble clicked ;)  one is enough
Comment 9 Lars Weiler (RETIRED) gentoo-dev 2003-04-06 23:56:19 UTC
The patch will also work on the new stable mplayer-0.90!

Just rename the ebuild mplayer-0.90.ebuild and everything will run without problems.
Comment 10 Martin Schlemmer (RETIRED) gentoo-dev 2003-04-07 00:12:17 UTC
Ok, get it tested, and if fine, Ill commit 0.90.
Comment 11 Luca Barbato gentoo-dev 2003-04-07 18:16:33 UTC
Created attachment 10347 [details]
my configure patched, yet to be merged with Pylon's one
Comment 12 Luca Barbato gentoo-dev 2003-04-07 18:18:35 UTC
Created attachment 10348 [details]
auxtable parser, just shows if the altivec is present.
Comment 13 Martin Schlemmer (RETIRED) gentoo-dev 2003-04-09 16:00:39 UTC
Ok, I need to get 0.90 out.  Ill commit with attachment 10308 [details, diff].  If you guys
are good to go, let me know.  Also, please submit as patches against the mplayer
Comment 14 Lars Weiler (RETIRED) gentoo-dev 2003-04-09 18:47:48 UTC
I discussed with lu_zero about releasing the new mplayer.

He tells that he has problems with altivec and playing mpegs.  We can apply my patches to it, but should leave it ~ppc for a while and watch for users who also receive only mpeg-salad.

During this phase we do some more tests.

Get it out that baby ;-)
Comment 15 Stephan van Maris 2003-04-12 07:51:44 UTC
I'm running a rev-III Powerbook G4 (667mhz) with benh's sources (2.4.20-ben10) 
the ./configure on media-video/mplayer-0.90 now says: 
Checking for CPU vendor ...  (::) 
Checking for CPU type ... 7455, 
Checking for Using ppc (7455,) optimizations ... -mtune=750 and -mcpu=750 -maltivec 
So, apart from some cosmetical issues, this looks fine to me. 
Compiling shows the altivec-cflags, so that's good too. 
There are some minor audio/video-sync problems while playing an mpeg, but this has 
nothing to do with the altivec-stuff (I had the same problem before).. so: it works! 
Good job guys. 
Comment 16 Lars Weiler (RETIRED) gentoo-dev 2003-04-12 08:25:20 UTC
Hell, I forgot that the switch-line 7[45][50]*) will also choose a 7455-CPU :-(  So we should change the order of the switches and place the 745[570]*) before the one for the 740/745/750/755*-G3-CPUs.

That there's a ',' in the 'Checking for CPU type' line comes from the cut-command.  But that doesn't harm anything because this string is only used for the switch and the mtune and mcpu will be set right (yes, it is only cosmetical).
Comment 17 Lars Weiler (RETIRED) gentoo-dev 2003-04-12 08:38:38 UTC
Created attachment 10550 [details, diff]

The patch with the switches in (hopefully) right order.
Comment 18 Stephan van Maris 2003-04-15 12:49:16 UTC
Sorry I didn't notice this before. But since the last emerge of mplayer (0.90 with the 
altivec-stuff), I'm having weird problems playing DiVX4/5 files. 
MPlayer switches to fullscreen and it stays black. It does not respond to any input, until I 
switch out of X to a virtual console and then go back. Then the DiVX is playing, but it looks 
awful; mainly green garbage. On x86, the files play fine. 
Anyone else having this problem? 
Comment 19 Luca Barbato gentoo-dev 2003-04-15 16:58:25 UTC
I think that is the "salade problem"
seems that applies to libmpeg altivec and to ffmpeg altivec

(mplayer doesn't use libmpeg altivec)

the issues has already reported upstream, seems that their code is working fine on gcc3.1apple on osx/darwin.

still investigating
Comment 20 Luca Barbato gentoo-dev 2003-04-27 23:48:02 UTC
The culprit is gcc that doesn't handle correctly the mergel instructions,
gcc, libmpeg2 and ffmpeg authors are already informed.
Michel Lespinasse, who discovered the issue has already found a workaround.
hopefully the issue will be fixed in the next gcc release.
Comment 21 Luca Barbato gentoo-dev 2004-04-03 15:19:52 UTC
mplayer now supports very well ppc and my workaround works good enough for now, the gcc-3.3.3 fixes the problem on the root but has other issue that prevent me to  push it on ~ppc before some fix on some core application.