View Full Version : [LINUX] How many Modelines are required?
marcusfischer
2009-06-21, 12:12
Hey hoo,
I'd like to raise this question regarding required/recommended number of modelines to fill my knowledge gaps and get a better understanding of the principles how XBMC is designed. I have a plain 9.04 version here, btw.
I created one single "weird" modeline with "1824x1020 px @ 50 Hz" according to [1]:
modeline "no_overscan" 74.25 1824 2400 2444 2640 1020 1054 1064 1124 +hsync +vsync Interlace
This one fits perfect on my 1366x768px (HD ready type) LCD TV, and I forced my X Server to this modeline (no EDID probing etc), and I have a full-screen XBMC now.
Now, I have some frame drops with this killa sample at the start, but this runs smooth after that.
Yesterday, I found another thread with some more samples in the Nvidia forum [2], and there are quite a bunch of different samples linked.
I have now:
1) 1280x720px H.264/AVC @ 29.97 FPS (progressive)
2) 1280x720px mpg2 @ 59.94 FPS (interlaced)
3) 1920x1080px H264/AVC @ 23.976 FPS (progressive)
And not all samples play fine. Especially with the second one, I notice (pressing "o" and watching the details) a rapidly increasing a/v number in the last row of the output, and audio is choppy.
(I feel this is some number which quantifies audio-video sync (delay in seconds??)).
My question is:
- Do I have to have more modelines for several types of output?
- Do I take away some degrees of freedom from XBMC with my single modeline?
- Is it possible to run all typical videos with one single modeline or are several ones required and XBMC changes them automatically depending on the video?
Regards,
Marcus
[1]: http://ubuntuforums.org/showthread.php?t=1003099&page=2
[2]: http://www.nvnews.net/vbulletin/showpost.php?p=2020589&postcount=56
marcusfischer
2009-06-23, 22:30
Some ideas on that question?
- I appreciate any help. :nod:
sparkyhall
2009-06-24, 00:27
As far as I know xbmc does not automatically change the screen resolution. It can select the correct frame rate though.
I have to ask why you have generated a mode line for near 1080p (1824x1020) for a screen that only natively supports 1366x768. Surely this means that you're having to scale up and then back down so not getting the best possible quality from your set-up?
Chris
marcusfischer
2009-06-24, 09:26
This is one of the things that I really don't understand.
The "HD ready" 1366x768px resolution is what I read in the manual.
I did everything exactly according to my link [1] in my initial posting above.
When I checked the Xorg.0.log file when starting, I can see the EDID information of that screen.
And here, the LCD TV is talking about a "virtual screen resolution" of 1920x1080px.
I do not know what virtual means in this context.
Anyway. I created several images (1366x768 pixel, 1920x768 pixel) and used them as a background image for GDM. Then, I started to tweak the modeline until the result is what I see above.
With the 1366x768 pixel background image, the screen area was not filled. I had a huge black bar at the right and the bottom, the image was too small.
The 1920x1080 pixel image was too big (I guess overscan, because I could not see colored lines that I created along the borders).
So, first I reduced the image size until suited perfectly on my screen. And then, I had to tweak the modeline that the upper left corner is correctly located.
This is one of the things that I really don't understand.
The "HD ready" 1366x768px resolution is what I read in the manual.
1366x768px really is a weird resolution. But if your manual states that this is the native resolution of your display, then you should really use a modeline which generates this resolution.
When I checked the Xorg.0.log file when starting, I can see the EDID information of that screen.
I'd really like to see the EDID information. Can you post your Xorg.0.log.
And here, the LCD TV is talking about a "virtual screen resolution" of 1920x1080px.
I do not know what virtual means in this context.
"Virtual" does not mean anything in your context. This is just an Xorg thing. You might have a multi-monitor setup so your screen resolution is the sum of all resolutions. Xorg always uses "virtual" resolutions even if you only have one monitor.
Anyway. I created several images (1366x768 pixel, 1920x768 pixel) and used them as a background image for GDM. Then, I started to tweak the modeline until the result is what I see above.
This really is the wrong aproach. You should create a modeline which reflects the native resolution of your display. Then you can use a background picture with that resolution.
With the 1366x768 pixel background image, the screen area was not filled. I had a huge black bar at the right and the bottom, the image was too small.
Of course, since your modeline generates a 1824x1020px resolution the picture is too small to fill the screen.
So, first I reduced the image size until suited perfectly on my screen. And then, I had to tweak the modeline that the upper left corner is correctly located.
This shouldn't be necessary. A correct modeline should fill your screen and get you the best picture possible.
You might want to post your Xorg.0.log so we can see the EDID information of your display and work out your problems.
sparkyhall
2009-06-24, 21:57
1366x768px really is a weird resolution. But if your manual states that this is the native resolution of your display, then you should really use a modeline which generates this resolution.
@Temar 1366x768 is a common native resolution here in the UK and I guess other parts of Europe too. These TVs are usually marked as "HD Ready" exactly as marcusfischer has indicated.
@marcusfischer are you sure you haven't got a line in your xorg.conf that generates a virtual screen size of 1920x1080. It would look something like "virtual 1920 1080".
Chris
marcusfischer
2009-06-25, 09:19
You might want to post your Xorg.0.log so we can see the EDID information of your display and work out your problems.
Here's the information: http://pastebin.ca/1473898
Probably, we had miscommunication::
1) Of course, I created an image size which matched the resolution of the modeline that I tried. I did not try every image size with the same modeline.
2) it was only, that this 1824x1020 resolution does fit my screen perfectly. Why that is, I don't understand.
Oh, by the way: My XBMC GUI is crystal clear, I cannot imagine how this could be improved. For Videos, I have a little less material to judge right now, and some are stuttering. (which may be due to progressive, interlaced or cinema material)
Ok, so any help would be apreciated. Thanks a lot to both of you!
marcusfischer
2009-06-25, 09:30
@marcusfischer are you sure you haven't got a line in your xorg.conf that generates a virtual screen size of 1920x1080. It would look something like "virtual 1920 1080".
(==) NVIDIA(0): No modes were requested; the default mode "nvidia-auto-select"
(==) NVIDIA(0): will be used as the requested mode.
(==) NVIDIA(0):
(II) NVIDIA(0): Requested modes:
(II) NVIDIA(0): "nvidia-auto-select"
(II) NVIDIA(0): Validated modes:
(II) NVIDIA(0): MetaMode "nvidia-auto-select":
(II) NVIDIA(0): Bounding Box: [0, 0, 1920, 1080]
(II) NVIDIA(0): TSB TOSHIBA-TV (DFP-0): "nvidia-auto-select"
(II) NVIDIA(0): Size : 1920 x 1080
(II) NVIDIA(0): Offset : +0 +0
(II) NVIDIA(0): Panning Domain: @ 1920 x 1080
(II) NVIDIA(0): Position : [0, 0, 1920, 1080]
(II) NVIDIA(0): Virtual screen size determined to be 1920 x 1080
(II) NVIDIA(0):
Chris, I think that I missed one important thing before.
I took that "virtual screen size" thing out of its context. When I now read the above part of the log, it is clear to me:
1) the log is from a Xserver startup without any xorg.conf file, so the Xserver and the driver do things based on assumptions and their defaults.
2) since no modeline is available, the driver decides that "nvidia-auto-select" is the best choice.
3) From all the EDID information, the driver decides that 1920x1080 pixel is the maximum screen resolution, so this is derived.
Oh, one more question:
1) Let's assume that my manual is true and the resolution IS 1366x768 pixel
2) When I create a 1920 pixel wide image with one vertical one pixel wide line, isn't there a high chance that this "detail" get's lost when the TV scales the 1920 down to 1366?
I think I'll create a "moire" like test image with alternating black&white lines.
Would be interesting to see how this is mapped onto my 1366 wide screen.
Cheers :D
3) From all the EDID information, the driver decides that 1920x1080 pixel is the maximum screen resolution, so this is derived.
Yep, the X server always tries to use the maximum resolution possible. But this may not always be the best choice.
Oh, one more question:
1) Let's assume that my manual is true and the resolution IS 1366x768 pixel
2) When I create a 1920 pixel wide image with one vertical one pixel wide line, isn't there a high chance that this "detail" get's lost when the TV scales the 1920 down to 1366?
Exactly - and it even gets worse. If you play non 1920px material, like a DVD, then the picture gets scaled twice. First XBMC scales it up to 1920px and then your TV scales it back down to 1366px.
As sparkyhall seems to know that there are many 1366x768 TVs out there, you should really trust your manual. "HD ready" in your case seems to indicate that the TV is capable of processing 1920x1080px images but it doesn't display them at this size - your TV is just HD ready but it's not a HD TV. Sounds to me like marketing bullshit at its best.
If I were you, I would create a 1366x768 modeline and force X to use that resolution. Then you get the best image quality your TV is capable of.
Temar
As sparkyhall seems to know that there are many 1366x768 TVs out there, you should really trust your manual. "HD ready" in your case seems to indicate that the TV is capable of processing 1920x1080px images but it doesn't display them at this size - your TV is just HD ready but it's not a HD TV. Sounds to me like marketing bullshit at its best.
Yeah, over here in the UK, at least, "HD Ready" tends to mean 720p, as opposed to 1080p. I'm not sure where 1080i falls - probably under the same umbrella.
marcusfischer
2009-06-25, 23:11
Yeah, over here in the UK, at least, "HD Ready" tends to mean 720p, as opposed to 1080p. I'm not sure where 1080i falls - probably under the same umbrella.
According to the definition of "HD ready", a display has to meet the following criteria to carry that label:
- 720 lines minimum
- capable to receive 720p content
- capable to receive 1080i content
- ...
On Saturday, I'll try to come up with a new modeline for the native resolution. I'm curios whether I can see a improvement in quality, since I have a crystal clear GUI already right now.
On Saturday, I'll try to come up with a new modeline for the native resolution.
You may want to use a modeline generator this time, instead of creating the modlines manually. Xorg has a tool which allows you to create modelines. It's called "gtf" and should be already installed - it's part of the base Xorg distribution. Just enter:
gtf <x-resolution> <y-resolution> <refresh-rate>
However this tool does not respect the capabilities of your graphics card and therefore the generated mode may not work. If this is the case for you, you can use:
http://xtiming.sourceforge.net/cgi-bin/xtiming.pl
This tool lets you enter settings from your graphics card like pixel clock, too.
I'm curios whether I can see a improvement in quality, since I have a crystal clear GUI already right now.
You probably won't see much difference for the main gui. Better try it with a DVD or any movie which would be scaled twice.
marcusfischer
2009-06-27, 12:05
Ok, I spent now 3 hours testing a whole bunch of different modelines, but the TV simply does not show anything. I used a bunch of different modeline generators, and amazingly, they all give different modelines. Anyway...
I've read that these HD ready LCDs may not accept all resolutions via HDMI, which is the root cause that they just cannot be driven with their real resolution.
Now I'm wondering why the hell this TV accepted my 1824x1020 pixel modeline at all, because this is by no means something regular ???
I will now go back to the tutorial that I found first and try to get 1366x768 pixel directly.
If that doesn't work, I'll probably just stay with my working modeline.
marcusfischer
2009-06-27, 19:51
Argh, I screwed it up, and I don't understand what's going on right now.
I did not manage to compile a proper modeline for the native resolution.
BUT I now cannot even run my own modeline, that worked since two weeks.
The Xserver now tells me that it cannot be validated and that it now defaults to "nvidia-auto-select", and this is a poor 640x480px modeline. *grrr*
sparkyhall
2009-06-28, 14:59
Argh, I screwed it up, and I don't understand what's going on right now.
I did not manage to compile a proper modeline for the native resolution.
BUT I now cannot even run my own modeline, that worked since two weeks.
The Xserver now tells me that it cannot be validated and that it now defaults to "nvidia-auto-select", and this is a poor 640x480px modeline. *grrr*
Sounds like a something wrong with your xorg.conf file to me. Pastebin it here and maybe a fresh pair of eyes will spot the error.
marcusfischer
2009-06-29, 01:09
http://pastebin.ca/1477725
Things are getting strange.
I really don't know what went wrong. The xorg.conf seems correct, but I have it uploaded as you asked for it.
The latests findings:
- I cannot start the Xserver with 1920x1080_50i modeline when the TV is already waiting on the HDMI entry. (this definitely worked some days ago when I started/stopped close to infinite times to get my modeline composed.)
- When the TV is on another channel while the HTPC boots, it will boot into 1920x1080_50i. :confused2:
- The same does not work for my own 1824x1020_50i modeline at all, regardless of what the TV is doing when starting the Xserver. (and this f*ckin' modeline worked well. :sniffle:
- When the modeline does not work, the "nvidia-auto-select" modeline is chosen, which means 640x480px.
- Now, when the Xserver is started while TV waits on HDMI entry, the 640x480 is shown in 4/3 aspect ratio, with black bars left & right.
- And when the TV is on another channel while Xserver starts, the 640x480 is stretched to the full LCD area.
Why the hell are things now not working, when everything was perfect earlier?
Any hint is apreaciated....
Thanks, Marcus
sparkyhall
2009-06-29, 15:01
I can't see anything wrong on first glance. One observation is that you don't have the option to disable twinview, without this the screen display options in xbmc will be wrong. Might be worth a try:
Option "TwinView" "false"
Just in case you havn't found this here's a link to the available options:
http://http.download.nvidia.com/XFree86/Linux-x86/1.0-9629/README/appendix-d.html
Why the hell are things now not working, when everything was perfect earlier?
Any hint is apreaciated....
Usually the Xserver logs why it can't use a specific modeline. Can you post your Xorg.log again please.
marcusfischer
2009-07-02, 10:23
Usually the Xserver logs why it can't use a specific modeline. Can you post your Xorg.log again please.
Sorry that it took some time, but here we go.
Oh, btw: now, my 1920x1080_50i modelines does not work as well. It's becoming strange...
Case 1: 1824x1020_50i (fails, TV was already on, but on a different channel)
http://pastebin.ca/1481595
Case 2: 1920x1080_50i (fails, TV was already on, but on a different channel)
http://pastebin.ca/1481597
Case 3: 1920x1080_50i (fails, TV was off (standby, soft-off))
http://pastebin.ca/1481598
Again, switching modelines while TV stays on HDMI3 (init 3, <edit xorg.conf, init 5) worked all the time.
Now, I see a 2-3 seconds delay for GDM to come up (Xserver is probing modeline and calculating a 640x480px fallback).
Regards,
Marcus