Discussion:
Weird problem with a G400 - shows only junk through mga_vid
Mikko Nahkola
2005-08-27 19:49:14 UTC
Permalink
Hello,

I seem to be having problems with this thing. It just doesn't work
despite claiming to - no errors or even warnings, that is. It's just
that the output is all junk.

For example, running mga_vid_test, I get a multicoloured flickering
rectangle (looks like TV static, sort of) instead of green in 1), and it
doesn't change at all going to 2) and 3). Trying to play real video,
similar results. X and text console work just fine, and come back
properly after trying the video thing too.

Should the mga_vid_base address be the same as something that lspci
reports? If so, how do I make them be same, they aren't now..? I can't
seem to make the module take any arguments (the Linux 2.4 way doesn't
work anymore or something?)...

This is with Linux 2.6.12 (Gentoo, both vanilla and Gentoo's own kernel
sources tried, both with udev and without fbcon). Card is MGA G400
AGP, lspci says:

0000:01:00.0 VGA compatible controller: Matrox Graphics, Inc. MGA G400 AGP (rev 04) (prog-if 00 [VGA])
Subsystem: Matrox Graphics, Inc. Millennium G400 16Mb SDRAM
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 64 (4000ns min, 8000ns max), cache line size 08
Interrupt: pin A routed to IRQ 9
Region 0: Memory at cc000000 (32-bit, prefetchable) [size=cfae0000]
Region 1: Memory at cfafc000 (32-bit, non-prefetchable) [size=16K]
Region 2: Memory at cf000000 (32-bit, non-prefetchable) [size=8M]
Expansion ROM at 00010000 [disabled]
Capabilities: [dc] Power Management version 2
Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [f0] AGP version 2.0
Status: RQ=32 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 64bit- FW- AGP3- Rate=x1,x2
Command: RQ=32 ArqSz=0 Cal=0 SBA+ AGP+ GART64- 64bit- FW- Rate=x1


Any ideas about where to look next? Disabling udev looks a bit hairy on
Gentoo but what about the console framebuffer layer, should I try with
that enabled? I have tried with and without X running already, that
didn't change anything (there's "VideoRam 8192" in the X config.)

I do seem to get sane (and correct) output with SDL, it's just too slow
- this is an AMD K6-2 450MHz ... and there are cache lines for only 128M
of RAM so that's what it has. But I got the impression that it "should"
be just about fast enough (barely) for watching DVDs with mga_vid,
properly optimized..?
--
Mikko Nahkola <***@elisanet.fi>
Mikko Nahkola
2005-08-27 20:12:14 UTC
Permalink
Adding to the previous post (wonder if it got anywhere yet...)

Sorry, I was being unclear - dmesg and lspci do agree about the
framebuffer base address, but should this be the same as what
mga_vid_test finds?

At any rate, this is what dmesg says:
***@localhost ~ $ dmesg |grep -i mga
[drm] Initialized mga 3.1.0 20021029 on minor 0: Matrox Graphics, Inc. MGA G400 AGP
Matrox MGA G200/G400/G450/G550 YUV Video interface v2.01 (c) Aaron Holtzman & A'rpi
mga_vid: Found MGA G400/G450 at 0000:01:00.0
mga_vid: MMIO at 0xc88f8000 framebuffer: 0xCC000000
mga_vid: OPTION word: 0x50040120 mem: 0x00 SDRAM
mga_vid: detected RAMSIZE is 16 MB
mga_vid: 1 supported cards found
mga_vid: using major: 83 (assigned or default!)

And:
$ ./mga_vid_test
Testing MGA G400 Backend Scaler with 16 MB of RAM
mga_vid_base = 0xb7ce8000
..................
--
Mikko Nahkola <***@elisanet.fi>
Attila Kinali
2005-09-18 09:17:02 UTC
Permalink
On Sat, 27 Aug 2005 22:49:14 +0300
Post by Mikko Nahkola
I seem to be having problems with this thing. It just doesn't work
despite claiming to - no errors or even warnings, that is. It's just
that the output is all junk.
Ok, first question, where did you get mga_vid from ?
Post by Mikko Nahkola
For example, running mga_vid_test, I get a multicoloured flickering
rectangle (looks like TV static, sort of) instead of green in 1), and it
doesn't change at all going to 2) and 3). Trying to play real video,
similar results. X and text console work just fine, and come back
properly after trying the video thing too.
Sounds wierd.
Post by Mikko Nahkola
Should the mga_vid_base address be the same as something that lspci
reports? If so, how do I make them be same, they aren't now..? I can't
seem to make the module take any arguments (the Linux 2.4 way doesn't
work anymore or something?)...
No, it should be just within the memory range of the card that
lspci reports.
Post by Mikko Nahkola
Any ideas about where to look next? Disabling udev looks a bit hairy on
Gentoo but what about the console framebuffer layer, should I try with
that enabled? I have tried with and without X running already, that
didn't change anything (there's "VideoRam 8192" in the X config.)
udev would not cause something like this. I rather supect that
the wrong memory range got overwritten.

What i need from you is:
1) mplayer -v log
2) the messages mga_vid writes to klog (see dmesg)
3) what mga_vid version you use and where you got it from


Attila Kinali
--
心をこめて聞け心をこめて話せ
Mikko Nahkola
2005-09-20 23:07:32 UTC
Permalink
Post by Attila Kinali
On Sat, 27 Aug 2005 22:49:14 +0300
Post by Mikko Nahkola
I seem to be having problems with this thing. It just doesn't work
despite claiming to - no errors or even warnings, that is. It's just
that the output is all junk.
Ok, first question, where did you get mga_vid from ?
:r wget-log
--23:53:16-- http://attila.kinali.ch/mga/mga_vid-2.6.12-2005-06-18.tar.gz
=> `mga_vid-2.6.12-2005-06-18.tar.gz'
Resolving attila.kinali.ch... 147.87.98.10
Connecting to attila.kinali.ch[147.87.98.10]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11,364 [application/x-gzip]

0K .......... . 100% 148K

23:53:16 (147.71 KB/s) - `mga_vid-2.6.12-2005-06-18.tar.gz' saved [11,364/11,364]
Post by Attila Kinali
Post by Mikko Nahkola
For example, running mga_vid_test, I get a multicoloured flickering
rectangle (looks like TV static, sort of) instead of green in 1), and it
doesn't change at all going to 2) and 3). Trying to play real video,
similar results. X and text console work just fine, and come back
properly after trying the video thing too.
Sounds wierd.
That's what I thought too.
Post by Attila Kinali
Post by Mikko Nahkola
Should the mga_vid_base address be the same as something that lspci
reports? If so, how do I make them be same, they aren't now..? I can't
seem to make the module take any arguments (the Linux 2.4 way doesn't
work anymore or something?)...
No, it should be just within the memory range of the card that
lspci reports.
But it _isn't_. I mean, the addresses are the _lower_ boundaries, right?
And lspci reports the starting address for the card as 0xcc00000 (and
kernel log and X server agree with it) but it's being used at 0xb7d47000
or some such ... and not the same address every time either.

Of course, the PCI bus stuff _can_ move address ranges around but ...?
Post by Attila Kinali
Post by Mikko Nahkola
Any ideas about where to look next? Disabling udev looks a bit hairy on
Gentoo but what about the console framebuffer layer, should I try with
that enabled? I have tried with and without X running already, that
didn't change anything (there's "VideoRam 8192" in the X config.)
udev would not cause something like this. I rather supect that
the wrong memory range got overwritten.
That's what I think too but how do I control which memory range it uses?
Post by Attila Kinali
1) mplayer -v log
Attached.

The DVD in this example is an advertising thing about use of wood in interior
decorations, BTW. Audio comes out just fine and the video does work
elsewhere.
Post by Attila Kinali
2) the messages mga_vid writes to klog (see dmesg)
Matrox MGA G200/G400/G450/G550 YUV Video interface v2.01 (c) Aaron
Holtzman & A'rpi
mga_vid: Found MGA G400/G450 at 0000:01:00.0
mga_vid: MMIO at 0xc88f8000 framebuffer: 0xCC000000
mga_vid: OPTION word: 0x50040120 mem: 0x00 SDRAM
mga_vid: detected RAMSIZE is 16 MB
mga_vid: 1 supported cards found
mga_vid: using major: 83 (assigned or default!)
Post by Attila Kinali
3) what mga_vid version you use and where you got it from
See above. And:

$ md5sum mga_vid-2.6.12-2005-06-18.tar.gz
fe69879eecb655b32638a1ba96256a54 mga_vid-2.6.12-2005-06-18.tar.gz

Is this checksum correct?


BTW, I got it to display the right image too - once. With -vo xmga while
rebuilding gcc from source in another window ;-) slight problems getting
enough CPU cycles but ... and mga_vid_test worked right _that_ time too.

So can't reproduce the problem _every_ time (just 9 times out of 10 or
so, this far, with the exact same kernel and the module too.) Isn't that fun?


Oh well. Got a newer system for the wife, guess that one _might_ be
easier to tweak ... it's an IBM Thinkpad with more than a GHz on the
clock, and an ATI Mobility Radeon ... how was the radeon_vid on 2.6.x
kernels again?
--
Mikko Nahkola <***@elisanet.fi>
Attila Kinali
2005-10-10 09:38:25 UTC
Permalink
Moin,

Just a guess, (as i'm still not able to reproduce your problem)
could it be that your X server is interfering with mga_vid ?

Ie, could you try to run -vo mga from the console without
X running ?

BTW: which X server are you using ? are you running gnome?
do you run any applications that load large images (like
background images, Eterm,...) ?

BTW2: Michael, please do not send mails to developers in private
if there is a mailinglist. Developers do not like it when
their inbox gets filled.



Attila Kinali
Mikko Nahkola
2005-10-10 18:31:16 UTC
Permalink
Post by Attila Kinali
Moin,
Just a guess, (as i'm still not able to reproduce your problem)
could it be that your X server is interfering with mga_vid ?
That's what I thought too, right at the start ...
Post by Attila Kinali
Ie, could you try to run -vo mga from the console without
X running ?
I did. Didn't I send the screenshot already? I took one from that too.
No luck. ... Hm. Ok, seems I didn't send this yet. Attaching now.

Could be that this is from the very run from which I took the log too.
Post by Attila Kinali
BTW: which X server are you using ?
X.org 6.8.2, I think the thing has some Gentoo-specific patches.

The funny thing is that it occasionally does draw the right image, but
only when running X and at least _starting_ with some additional load.
("nice emerge -update -deep world & mplayer", heh...)
Post by Attila Kinali
are you running gnome?
No way on _this_ hardware... I run WindowMaker mostly but did try with
twm too.
Post by Attila Kinali
do you run any applications that load large images (like
background images, Eterm,...) ?
No. I stopped loading background images in about 1994 ;-) after I
did a bit of measuring with and without... and haven't
used them since. Well, on some newish systems (more than a GHz, and at
least half a G of RAM) I haven't bothered to remove the system default
background. But this isn't one of those.



Oh well. This isn't much of a priority any more, after I got the wife a
Thinkpad T30. That one proved easier to tweak into working right. (The
fact that it has several times the CPU and memory _does_ help...)

I guess I'll rebuild the old thing as a Windows games box for the kids.
Got a nice old "Pippi Långstrump" CD that needs something between
Windows 3.0 and 98SE, for example. (Wine doesn't do _that_ old APIs anyway.)
--
Mikko Nahkola <***@elisanet.fi>
Attila Kinali
2005-10-11 07:49:39 UTC
Permalink
On Mon, 10 Oct 2005 21:31:16 +0300
Post by Mikko Nahkola
Post by Attila Kinali
Ie, could you try to run -vo mga from the console without
X running ?
I did. Didn't I send the screenshot already? I took one from that too.
No luck. ... Hm. Ok, seems I didn't send this yet. Attaching now.
Ok,.. now that's getting strange.
Post by Mikko Nahkola
Post by Attila Kinali
BTW: which X server are you using ?
X.org 6.8.2, I think the thing has some Gentoo-specific patches.
I run here a xfree86 4.3 from debian, but i slowly start to doubt
that this is the problem.
Post by Mikko Nahkola
The funny thing is that it occasionally does draw the right image, but
only when running X and at least _starting_ with some additional load.
("nice emerge -update -deep world & mplayer", heh...)
Ok, this is now really getting strange. I cannot think of a
problem, beside memory management that would cause a behaviour like
this.

Hmm.. maybe, the card you have is not able to cope with the full
memory range of the pc. But that would be very strange too,
as the time of 16MB limited devices is long over.

I have to think about a system to test that.
But that will take a while as i'm quite busy these days :(

At least the screenshot you send suggest that the memory
region coppied to the card is something generated as it
shows a very regular pattern. And if the log matches this
screenshot, then the bars would be at a spacing of about 32 pixels
(64bytes) which would also suggest that it's some datastructure.

BTW: does Xv work for you?
It uses a very similar method to mga_vid thus should show
the same behaviour.
Post by Mikko Nahkola
I guess I'll rebuild the old thing as a Windows games box for the kids.
Got a nice old "Pippi Långstrump" CD that needs something between
Windows 3.0 and 98SE, for example. (Wine doesn't do _that_ old APIs anyway.)
NO! WAIT! I want that bug nailed down :)


Attila Kinali
Mikko Nahkola
2005-10-11 21:18:45 UTC
Permalink
Post by Attila Kinali
On Mon, 10 Oct 2005 21:31:16 +0300
Post by Mikko Nahkola
Post by Attila Kinali
Ie, could you try to run -vo mga from the console without
X running ?
I did. Didn't I send the screenshot already? I took one from that too.
No luck. ... Hm. Ok, seems I didn't send this yet. Attaching now.
Ok,.. now that's getting strange.
Post by Mikko Nahkola
Post by Attila Kinali
BTW: which X server are you using ?
X.org 6.8.2, I think the thing has some Gentoo-specific patches.
I run here a xfree86 4.3 from debian, but i slowly start to doubt
that this is the problem.
Especially as it refuses to work (and more consistently too) without
running X as well.
Post by Attila Kinali
Post by Mikko Nahkola
The funny thing is that it occasionally does draw the right image, but
only when running X and at least _starting_ with some additional load.
("nice emerge -update -deep world & mplayer", heh...)
Ok, this is now really getting strange. I cannot think of a
problem, beside memory management that would cause a behaviour like
this.
I've gotten it to display the right image since then with less load.
After upgrading to a more-patched version of X server.
Post by Attila Kinali
Hmm.. maybe, the card you have is not able to cope with the full
memory range of the pc. But that would be very strange too,
as the time of 16MB limited devices is long over.
Is the AGP aperture definition in any way relevant? The motherboard is a
bit weird there. Oh, and it _does_ have some memory limits.

Oh, and matroxfb works about half the time, the other half it does the
same as mga_vid ... nasty. Wonder why X works every time (so far...)
Post by Attila Kinali
I have to think about a system to test that.
But that will take a while as i'm quite busy these days :(
At least the screenshot you send suggest that the memory
region coppied to the card is something generated as it
shows a very regular pattern. And if the log matches this
screenshot, then the bars would be at a spacing of about 32 pixels
(64bytes) which would also suggest that it's some datastructure.
BTW: does Xv work for you?
It uses a very similar method to mga_vid thus should show
the same behaviour.
I think I haven't gotten Xv to fail yet. I did get it to show badly
distorted colors once, though.
Post by Attila Kinali
Post by Mikko Nahkola
I guess I'll rebuild the old thing as a Windows games box for the kids.
Got a nice old "Pippi Långstrump" CD that needs something between
Windows 3.0 and 98SE, for example. (Wine doesn't do _that_ old APIs anyway.)
NO! WAIT! I want that bug nailed down :)
I'd not be all that surprised if it were just a hardware quirk. I
mean, this thing has more than its share of those already... back when I
bought the system the vendor was having real problems with graphics card
compatibility on these. And for a long time I had to hand-tweak the
kernel sources to get anything like reasonable I/O performance...

Also, the graphics card is a second-hand find from a local PC shop's
back room.
--
Mikko Nahkola <***@elisanet.fi>
Mikko Nahkola
2005-10-11 21:30:55 UTC
Permalink
Post by Mikko Nahkola
Post by Attila Kinali
On Mon, 10 Oct 2005 21:31:16 +0300
Post by Mikko Nahkola
Post by Attila Kinali
Ie, could you try to run -vo mga from the console without
X running ?
I did. Didn't I send the screenshot already? I took one from that too.
No luck. ... Hm. Ok, seems I didn't send this yet. Attaching now.
Ok,.. now that's getting strange.
Oh, and matroxfb works about half the time, the other half it does the
same as mga_vid ... nasty. Wonder why X works every time (so far...)
Hey, I got a picture without running X! But it still isn't fun, I have
to type blind ... or from something other than the graphical console.

That is, matroxfb on and jumbled (and a bad refresh rate too), and
blind-typing my way to mga_vid_test ... which produces the right
picture. Attaching a screenshot of that.

(No, the background isn't gray, it's a tighter pattern than the camera
can cope with.)
--
Mikko Nahkola <***@elisanet.fi>
Michael Späth
2005-10-11 21:45:50 UTC
Permalink
Hello!

When I did see Mikko having the same problems and also having Gentoo, I
tried a vanilla 2.6.12.5 kernel this evening with a very conservative
.config file (remade from scratch, only with network card and sound card
in it).

And... it didn't work... Same memory addresses, same garbage

I guess it must be somehow the chipset (which I will test next with
another board from VIA). I have an Irongate chipset, lspci follows:

0000:00:00.0 Host bridge: Advanced Micro Devices [AMD] AMD-751
[Irongate] System Controller (rev 25)
0000:00:01.0 PCI bridge: Advanced Micro Devices [AMD] AMD-751 [Irongate]
AGP Bridge (rev 01)
0000:00:07.0 ISA bridge: Advanced Micro Devices [AMD] AMD-756 [Viper]
ISA (rev 01)
0000:00:07.1 IDE interface: Advanced Micro Devices [AMD] AMD-756 [Viper]
IDE (rev 07)
0000:00:07.3 Bridge: Advanced Micro Devices [AMD] AMD-756 [Viper] ACPI
(rev 03)
0000:01:05.0 VGA compatible controller: Matrox Graphics, Inc. G400/G450
(rev 04)

Mikko - what chipset do you have on your board? Maybe its the Irongate
chipset not able to do those things?
--
Sincerly
Michael
Mikko Nahkola
2005-10-11 22:46:54 UTC
Permalink
Post by Michael Späth
Hello!
When I did see Mikko having the same problems and also having Gentoo, I
tried a vanilla 2.6.12.5 kernel this evening with a very conservative
.config file (remade from scratch, only with network card and sound card
in it).
And... it didn't work... Same memory addresses, same garbage
I guess it must be somehow the chipset (which I will test next with
0000:00:00.0 Host bridge: Advanced Micro Devices [AMD] AMD-751
[Irongate] System Controller (rev 25)
0000:00:01.0 PCI bridge: Advanced Micro Devices [AMD] AMD-751 [Irongate]
AGP Bridge (rev 01)
0000:00:07.0 ISA bridge: Advanced Micro Devices [AMD] AMD-756 [Viper]
ISA (rev 01)
0000:00:07.1 IDE interface: Advanced Micro Devices [AMD] AMD-756 [Viper]
IDE (rev 07)
0000:00:07.3 Bridge: Advanced Micro Devices [AMD] AMD-756 [Viper] ACPI
(rev 03)
0000:01:05.0 VGA compatible controller: Matrox Graphics, Inc. G400/G450
(rev 04)
Mikko - what chipset do you have on your board? Maybe its the Irongate
chipset not able to do those things?
Nothing as new as that - Ali Aladdin V (M1541 rev 04), heh ... with
M1533 rev c3 ISA bridge and M5229 rev c1 IDE.

The CPU is a K6-2 450MHz, and is about the latest the motherboard's
manual has jumper settings for.

I've had this box since 1999 and it was cheapish already back then. No
parts with dates later than 2000, except maybe the SCSI CD-RW ... even
the DVD-ROM drive is an early-generation SCSI one recycled from a HP-UX
server.
--
Mikko Nahkola <***@elisanet.fi>
Attila Kinali
2005-11-06 09:34:29 UTC
Permalink
Moin,

I went again trough the discussion here and still have no clue what it
Post by Mikko Nahkola
0000:01:00.0 VGA compatible controller: Matrox Graphics, Inc. MGA G400 AGP (rev 04) (prog-if 00 [VGA])
Subsystem: Matrox Graphics, Inc. Millennium G400 16Mb SDRAM
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 64 (4000ns min, 8000ns max), cache line size 08
Interrupt: pin A routed to IRQ 9
Region 0: Memory at cc000000 (32-bit, prefetchable) [size=cfae0000]
This size value is very bougus, it should be in your case 16MB

Michael, do you have something similar in your lspci -vv output ?
And could you please also send (to this list) a full bugreport
including lspci -vv, dmesg and mplayer -v output? I couldnt found
the one you send me.

BTW: the mga_vid_base that mga_vid_test reports is the memory
address in which the card memory gets mmapped, thus has nothing
to do with anything else lspci or dmesg reports.

BTW2: are there other people here with a G400 who could try to reproduce
this bug ? If so please report here. Please tell us too, even if you
did not succeede as this might help to narrow down the problem.

Attila Kinali
--
egp ist vergleichbar mit einem ikea bausatz fuer flugzeugtraeger
-- reeler in +kaosu
Loading...