Monday, August 07, 2006

Linux Twinview in toshiba 5100

Right after success of enabling Nvidia X in my laptop, I start to modify it for twinview or TV-out.

Over two days of weekend passed, Some achievement was won.
Twinview(dual head) option runs great in my linux, but TV-out is still not..
Xorg does not set proper clock for TV encoder in toshiba 5100.


jjean@satellite:~$ cat /var/log/Xorg.0.log | less

....
(**) NVIDIA(0): TwinView enabled

(**) NVIDIA(0): ConnectedMonitor string: "DFP-0, CRT-0, TV-0"
(WW) NVIDIA(0): Unable to read EDID for display device CRT-0
(EE) NVIDIA(0): Failure reading maximum pixel clock value for display device
(EE) NVIDIA(0): TV-0.
(II) NVIDIA(0): NVIDIA GPU GeForce4 440 Go at PCI:1:0:0
(--) NVIDIA(0): VideoRAM: 32768 kBytes
(--) NVIDIA(0): VideoBIOS: 04.17.00.26.a4
(II) NVIDIA(0): Detected AGP rate: 4X
(--) NVIDIA(0): Interlaced video modes are supported on this GPU
(--) NVIDIA(0): Connected display device(s) on GeForce4 440 Go at PCI:1:0:0:
(--) NVIDIA(0): CRT-0
(--) NVIDIA(0): NVIDIA TV Encoder (TV-0)
(--) NVIDIA(0): NVIDIA Default Flat Panel (DFP-0)
(--) NVIDIA(0): CRT-0: 350.0 MHz maximum pixel clock
(--) NVIDIA(0): NVIDIA TV Encoder (TV-0): 100.0 MHz maximum pixel clock
(--) NVIDIA(0): TV encoder: NVIDIA
(II) NVIDIA(0): Mode Validation Overrides for CRT-0:
(II) NVIDIA(0): NoMaxPClkCheck
(II) NVIDIA(0): NoEdidMaxPClkCheck
(II) NVIDIA(0): Mode Validation Overrides for NVIDIA Default Flat Panel
(II) NVIDIA(0): (DFP-0):
(II) NVIDIA(0): NoMaxPClkCheck
(II) NVIDIA(0): NoEdidMaxPClkCheck
(II) NVIDIA(0): Assigned Display Devices: CRT-0, DFP-0
...

For acheiving, so many trial and error was dedicated.

here's key to the success.

jjean@satellite:~$ cat /etc/modprobe.d/options
# Enable double-buffering so gstreamer et. al. work
options quickcam compatible=2

# Default hostap to managed mode
options hostap_pci iw_mode=2
options hostap_cs iw_mode=2
options nvidia NVreg_SoftEDIDs=0 NVreg_Mobile=1 NVreg_FlatPanelMode=1

NVreg_Mobile=1 is most inportant one in this tip!
Nvidia recommend 2, 4 for this option, but it has resulted an freeze screen.

jjean@satellite:~$ cat /etc/X11/xorg.conf
##########################################################################
# Sample XF86Config file for NVIDIA XFree86 drivers.
#
# Refer to the XF86Config(4/5) man page for details about the format of
# this file.
#
# Be sure to replace the monitor values with correct values for your
# monitor!
##########################################################################


Section "Files"
FontPath "unix/:7100"
FontPath "/usr/lib/X11/fonts/misc"
FontPath "/usr/lib/X11/fonts/cyrillic"
FontPath "/usr/lib/X11/fonts/100dpi/:unscaled"
FontPath "/usr/lib/X11/fonts/75dpi/:unscaled"
FontPath "/usr/lib/X11/fonts/Type1"
FontPath "/usr/lib/X11/fonts/CID"
FontPath "/usr/lib/X11/fonts/100dpi"
FontPath "/usr/lib/X11/fonts/75dpi"
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID"
EndSection


##########################################################################
# Server flags section.
##########################################################################

Section "ServerFlags"

# Uncomment this to cause a core dump at the spot where a signal is
# received. This may leave the console in an unusable state, but may
# provide a better stack trace in the core dump to aid in debugging
#NoTrapSignals

# Uncomment this to disable the server abort sequence
# This allows clients to receive this key event.
#DontZap

# Uncomment this to disable the / mode switching
# sequences. This allows clients to receive these key events.
#DontZoom

# This allows the server to start up even if the
# mouse device can't be opened/initialised.
AllowMouseOpenFail

EndSection


##########################################################################
# Input devices
##########################################################################

#
# Keyboard section
#
Section "InputDevice"

Identifier "Keyboard1"
Driver "keyboard"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc104"
Option "XkbLayout" "us"
EndSection


#
# Pointer section
#
Section "InputDevice"

Identifier "Mouse1"
Driver "mouse"
Option "CorePointer"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "true"
Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
Identifier "Synaptics"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizScrollDelta" "0"
EndSection
##########################################################################
# Module section
##########################################################################

Section "Module"
Load "dbe"
Load "GLcore"
Load "ddc"
Load "vbe"
# Load the glx module.
Load "glx"
Load "extmod"
Load "type1"
Load "freetype"
Load "i2c"
Load "bitmap"
EndSection


##########################################################################
# Monitor section
##########################################################################

Section "Monitor"

Identifier "MyMonitor"
VendorName "Toshiba"
ModelName "Satellite 5100 laptop display"

# be sure to replace these values with values appropriate for your
# monitor!
HorizSync 30-90
VertRefresh 50-75

Modeline "1600x1200" 160.96 1600 1704 1880 2160 1200 1201 1204 1242 -HSync -Vsync


# Below line is copied from Nvidia's example.
#HorizSync 31-82
#VertRefresh 55-120

# 3840x2400 @ 12Hz for IBM's T221 FlatPanel
#Modeline "3840x2400" 148.0 3840 3944 4328 4816 2400 2401 2404 2418

EndSection


##########################################################################
# Graphics device section(s)
##########################################################################

Section "Device"
Identifier "NV AGP"
VendorName "nvidia"
Driver "nvidia"
# update this with the PCI id of your card. Consult the output
# of the 'lspci' command. The BusID is usually optional when
# only using one graphics card.
BusID "PCI:1:0:0"
Option "NvAGP" "1"
Option "RenderAccel" "true"
Option "ModeValidation" "NoMaxPClkCheck"
EndSection

Section "Device"
Identifier "NV AGP TwinView"
VendorName "nvidia"
Driver "nvidia"
# update this with the PCI id of your card. Consult the output
# of the 'lspci' command. The BusID is usually optional when
# only using one graphics card.
BusID "PCI:1:0:0"

OPtion "RenderAccel" "true"
Option "AllowGLXWithComposite" "true"
# sample twinview setup
Option "TwinView"
# be sure to replace the HorizSync and VertRefresh with correct values
# for your monitor!
Option "UseEdidDpi" "False"
# Option "ModeValidation" "CRT-0: NoEdidModes, NoMaxPClkCheck, NoMaxPClkCheck ; DFP-0: NoEdidModes"
Option "SecondMonitorHorizSync" "30-90"
Option "SecondMonitorVertRefresh" "50-75"
Option "TwinViewOrientation" "Clone"
Option "MetaModes" "1600x1200, 1600x1200, 1024x768; 1280x1024,1280x1024,1024x768; 1024x768,1024x768,1024x768"
Option "ConnectedMonitor" "DFP-0, CRT-0, TV-0"
Option "ModeValidation" "NoMaxPClkCheck, NoEdidMaxPClkCheck, NoMaxPClkCheck"# Option "TVStandard" "NTSC-M"
# Option "TVOutFormat" "Composite"
#HorizSync 30-50
#VertRefresh 60
EndSection


##########################################################################
# Screen sections
##########################################################################

#
# screen section for an nvidia AGP card
#
Section "Screen"
Identifier "Screen AGP"
Device "NV AGP"
Monitor "MyMonitor"
DefaultColorDepth 24
Subsection "Display"
Depth 8
Modes "1600x1200" "1280x1024" "1024x768" "800x600" "640x400"
EndSubsection
Subsection "Display"
Depth 16
Modes "1600x1200" "1280x1024" "1024x768" "800x600" "640x480"
EndSubsection
Subsection "Display"
Depth 24
Modes "1600x1200" "1280x1024" "1024x768" "800x600" "640x480"
EndSubsection

EndSection
#
# screen section for an nvidia AGP TwinView card
# (look at the appropriate Device section)
#
Section "Screen"
Identifier "Screen AGP TwinView"
Device "NV AGP TwinView"
Monitor "MyMonitor"
DefaultColorDepth 16
Subsection "Display"
Depth 8
Modes "1600x1200" "1280x1024" "1024x768" "800x600" "640x400"
EndSubsection
Subsection "Display"
Depth 16
Modes "1600x1200" "1280x1024" "1024x768" "800x600" "640x400"
EndSubsection
Subsection "Display"
Depth 24
Modes "1600x1200" "1280x1024" "1024x768" "800x600" "640x400"
EndSubsection
EndSection


##########################################################################
# ServerLayout sections
# (invoke using the '-layout' option of 'startx'.
##########################################################################

#
# just one agp card
#
#Section "ServerLayout"
# Identifier "AGP"
# Screen "Screen AGP"
# InputDevice "Mouse1" "CorePointer"
# InputDevice "Keyboard1" "CoreKeyboard"
# InputDevice "Synaptics"
#EndSection


# just one agp twinview card
#
Section "ServerLayout"
Identifier "AGPTwinView"
Screen "Screen AGP TwinView"
InputDevice "Mouse1" "CorePointer"
InputDevice "Keyboard1" "CoreKeyboard"
InputDevice "Synaptics"
EndSection


Most of option in this file was adopted from Nvidia's example which was included in 1.0.8762. driver.

No comments: