Difference between revisions of "Software projects/OS/Slackware/Advanced usage/USB graphic"

From Pandora Wiki
Jump to: navigation, search
(Step 2: Compile a new kernel with "udl" support)
m (Step 1: Activate DisplayLink-enabled kernel and modules: kernel versino correction)
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Display Link =
 
 
* Check [http://boards.openpandora.org/index.php?/topic/10903-displaylink-external-dvivga-display-works-now-on-to-fine-tuning-it/#entry202334 this thread].
 
* Check [http://boards.openpandora.org/index.php?/topic/10903-displaylink-external-dvivga-display-works-now-on-to-fine-tuning-it/#entry202334 this thread].
  
These instructions are for users of SL4P 14.0 RC4 and RC5.
+
=DisplayLink in SL4P 14.0=
  
If you use an earlier or later version of SL4P, the steps necessary to make DisplayLink work may be different.
+
Release 14.0 of SL4P is prepared for DisplayLink usage. Only a few steps are necessary to enable DisplayLink compatibility:
  
==Step 1: Preconditions==
+
==Step 1: Activate DisplayLink-enabled kernel and modules==
  
* Boot SL4P
+
Open a terminal and activate the DisplayLink-enabled kernel and modules:
* Open a console
 
* Connect the Pandora to the Internet
 
* Connect the Pandora to AC power
 
* Make sure that you don't need to carry away the Pandora for the next 5 hours.
 
 
 
==Step 2: Compile a new kernel with "udl" support==
 
 
 
'''Needs Internet connection!'''
 
 
 
See also: [http://pandorawiki.org/Software_projects/OS/Slackware/Advanced_usage/Kernel Kernel compilation], especially the [http://pandorawiki.org/Software_projects/OS/Slackware/Advanced_usage/Kernel#3D_driver note about the 3D graphics driver], that should be considered when compiling a new kernel.
 
  
 
<pre>
 
<pre>
 
su -
 
su -
sh kernel-sync.sh
 
cd /usr/src/linux
 
make xconfig (or, if that fails due to missing KDE, use "make menuconfig", which uses the text mode menu system)
 
</pre>
 
  
(kernel-sync.sh is the script, that needs the Internet connection. It downloads the kernel sources, and that process will take some time.)
+
cd /boot
 +
cp uImage-3.2.30-dirty-displaylink uImage
  
In xconfig or menuconfig, use the search feature, search for "udl".
+
cd /lib/modules
Check it to be compiled as a module, then save and exit the menu.
+
cp -r 3.2.30-dirty-displaylink/* 3.2.30-dirty
  
Afterwards:
+
reboot
 
 
<pre>
 
cd
 
sh kernel.sh
 
 
</pre>
 
</pre>
  
This compiles a new kernel and all the modules.
+
==Step 2: First Test==
Depending on your CPU speed and RAM, this may take about 2 to 5 hours.
 
Then reboot.
 
 
 
==Step 3: Compile the X driver for DisplayLink (udlfb)==
 
 
 
('''ONLY UNTIL SL4P 14.0 RC4''', in later versions this is already integrated into the default system, so in 14.0 RC5 and later versions you may skip this step!).
 
Fetch sources of, compile, make a package and install the X driver:
 
 
 
'''Needs Internet connection!'''
 
 
 
<pre>
 
rm -rf /tmp/build/*
 
cd
 
git clone http://git.plugable.com/webdav/xf-video-udlfb/
 
cd xf-video-udlfb
 
 
 
export CFLAGS="-DPANDORA -O2 -pipe -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp"
 
export CXXFLAGS="-DPANDORA -O2 -pipe -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp"
 
 
 
./autogen.sh
 
./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc
 
make
 
make install DESTDIR=/tmp/build/
 
cd /tmp/build/
 
makepkg -c y /tmp/xf-video-udlfb-201211-arm-1.tgz
 
installpkg /tmp/xf-video-udlfb-*-arm-1.tgz
 
</pre>
 
 
 
 
 
==Step 4: Find out framebuffer device==
 
 
 
Find out, which framebuffer device is used:
 
 
 
Plug in the DisplayLink adapter, then do a
 
 
 
<pre>
 
dmesg
 
</pre>
 
 
 
The output should show you, what fb device is used. For me, it's /dev/fb3.
 
You should see something like this:
 
 
 
<pre>
 
[ 230.808593] usb 1-2: new high-speed USB device number 2 using ehci-omap
 
[ 235.933532] usb 1-2: device descriptor read/64, error -32
 
[ 236.201080] usb 1-2: New USB device found, idVendor=17e9, idProduct=0198
 
[ 236.201110] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
 
[ 236.201110] usb 1-2: Product: WS Tech USB-DVI
 
[ 236.201141] usb 1-2: Manufacturer: DisplayLink
 
[ 236.201141] usb 1-2: SerialNumber: 305711
 
[ 236.443908] udlfb: DisplayLink WS Tech USB-DVI - serial #305711
 
[ 236.443939] udlfb: vid_17e9&pid_0198&rev_0015 driver's dlfb_data struct at c7890800
 
[ 236.443939] udlfb: console enable=1
 
[ 236.443969] udlfb: fb_defio enable=1
 
[ 236.443969] udlfb: shadow enable=1
 
[ 236.444244] udlfb: vendor descriptor length:1e data:1e 5f 01 001c 05 00 01 03 04 02
 
[ 236.444274] udlfb: DL chip limited to 1500000 pixel modes
 
[ 236.445434] udlfb: allocated 4 65024 byte urbs
 
[ 236.447937] usbcore: registered new interface driver udlfb
 
[ 236.598724] udlfb: Unable to get valid EDID from device/display
 
[ 236.598754] udlfb: 640x350 @ 85 Hz valid mode
 
[ 236.598785] udlfb: 640x400 @ 85 Hz valid mode
 
[ 236.598785] udlfb: 721x400 @ 85 Hz valid mode
 
[ 236.598815] udlfb: 640x480 @ 60 Hz valid mode
 
[ 236.598815] udlfb: 640x480 @ 72 Hz valid mode
 
[ 236.598815] udlfb: 640x480 @ 75 Hz valid mode
 
[ 236.598846] udlfb: 640x480 @ 85 Hz valid mode
 
[ 236.598846] udlfb: 800x600 @ 56 Hz valid mode
 
[ 236.598876] udlfb: 800x600 @ 60 Hz valid mode
 
[ 236.598876] udlfb: 800x600 @ 72 Hz valid mode
 
[ 236.598876] udlfb: 800x600 @ 75 Hz valid mode
 
[ 236.598907] udlfb: 800x600 @ 85 Hz valid mode
 
[ 236.598907] udlfb: 1024x768 @ 43 Hz valid mode
 
[ 236.598937] udlfb: 1024x768 @ 60 Hz valid mode
 
[ 236.598937] udlfb: 1024x768 @ 70 Hz valid mode
 
[ 236.598968] udlfb: 1024x768 @ 75 Hz valid mode
 
[ 236.598968] udlfb: 1024x768 @ 85 Hz valid mode
 
[ 236.598968] udlfb: 1152x864 @ 75 Hz valid mode
 
[ 236.598999] udlfb: 1280x960 @ 60 Hz valid mode
 
[ 236.598999] udlfb: 1280x960 @ 85 Hz valid mode
 
[ 236.599029] udlfb: 1280x1024 @ 60 Hz valid mode
 
[ 236.599060] udlfb: 1280x1024 @ 75 Hz valid mode
 
[ 236.599060] udlfb: 1280x1024 @ 85 Hz valid mode
 
[ 236.599060] udlfb: 1600x1200 beyond chip capabilities
 
[ 236.599090] udlfb: 1600x1200 beyond chip capabilities
 
[ 236.599090] udlfb: 1600x1200 beyond chip capabilities
 
[ 236.599121] udlfb: 1600x1200 beyond chip capabilities
 
[ 236.599121] udlfb: 1600x1200 beyond chip capabilities
 
[ 236.599121] udlfb: 1792x1344 beyond chip capabilities
 
[ 236.599151] udlfb: 1792x1344 beyond chip capabilities
 
[ 236.599151] udlfb: 1856x1392 beyond chip capabilities
 
[ 236.599182] udlfb: 1856x1392 beyond chip capabilities
 
[ 236.599182] udlfb: 1920x1440 beyond chip capabilities
 
[ 236.599182] udlfb: 1920x1440 beyond chip capabilities
 
[ 236.599212] udlfb: Reallocating framebuffer. Addresses will change!
 
[ 236.600250] udlfb: 800x600 @ 60 Hz valid mode
 
[ 236.600250] udlfb: set_par mode 800x600
 
[ 236.642547] udlfb: DisplayLink USB device /dev/fb3 attached. 800x600 resolution. Using 1880K framebuffer memory
 
</pre>
 
 
 
(Note last line mentioning the device /dev/fb3)
 
 
 
 
 
==Step 5: First Test==
 
  
 
Plug in the DisplayLink adapter, connect the display. Make sure that USB Host is enabled on the Pandora.
 
Plug in the DisplayLink adapter, connect the display. Make sure that USB Host is enabled on the Pandora.
Line 151: Line 29:
  
  
==Step 6: Adjust /etc/X11/xorg.conf==
+
==Step 3: Adjust /etc/X11/xorg.conf==
 +
 
 +
Add this block to /etc/X11/xorg.conf
  
Add this block to /etc/X11/xorg.conf (and replace "/dev/fb3" with the framebuffer device you discovered in Step 4 above):
+
(you should make sure that /dev/fb3 is the correct framebuffer device to use, by reading the dmesg output directly after plugging in the DisplayLink adapter)
  
 
<pre>
 
<pre>
Line 194: Line 74:
 
==Optional: Further tweaking of the setup==
 
==Optional: Further tweaking of the setup==
  
If you want to change xorg.conf and test the changes without waiting for X with XFCE to start up each time, you may
+
If you want to change xorg.conf and test the changes without waiting for X with XFCE to start up each time, you may do
As a user:
+
as a user:
 
<pre>
 
<pre>
 
xwmconfig
 
xwmconfig
Line 201: Line 81:
 
choose fvwm2
 
choose fvwm2
  
As root, edit /etc/inittab, and change:
+
Then as root, edit /etc/inittab, and change:
 
<pre>
 
<pre>
 
id:4:initdefault:
 
id:4:initdefault:
Line 212: Line 92:
 
Then SL4P boots into text mode, and you can log in and type startx to start X with the much quicker loading fwwm2 window manager.
 
Then SL4P boots into text mode, and you can log in and type startx to start X with the much quicker loading fwwm2 window manager.
 
Once you have found a setup you want to use, you may revert the last steps to boot directly into XFCE again.
 
Once you have found a setup you want to use, you may revert the last steps to boot directly into XFCE again.
 
 
  
 
==To Do: Hotplug==
 
==To Do: Hotplug==
  
We still need to find a satisfactory hotplug solution. Currently, the X server needs to be restarted, in order to make a newly plugged in DisplayLink adapter work, or to revert the desktop to 800x480 Pandora screen size, when the adapter has been disconnected.
+
We still need to find a satisfactory hotplug solution. Currently, the X server needs to be restarted or a second instance of the X server needs to be launched, in order to make a newly plugged in DisplayLink adapter work.
  
 
It seems that real hotplug is not possible with the versions of X and udlfb (kernel): [http://superuser.com/questions/502359/is-it-possible-to-have-displaylink-usb-display-hotplugging-with-xorg-1-13-on-ker]
 
It seems that real hotplug is not possible with the versions of X and udlfb (kernel): [http://superuser.com/questions/502359/is-it-possible-to-have-displaylink-usb-display-hotplugging-with-xorg-1-13-on-ker]
Line 227: Line 105:
  
 
Work in progress...
 
Work in progress...
 +
  
 
==Usage hint: Use two instances of the X server==
 
==Usage hint: Use two instances of the X server==
Line 255: Line 134:
  
 
They should work in general, using the sisusbvga / sisusb kernel module and X driver.
 
They should work in general, using the sisusbvga / sisusb kernel module and X driver.
However, I have not succeeded to make one work in SL4P yet.
+
However, I have not succeeded to make one work in SL4P.
  
Work in progress...
+
See the proof that it works in theory:
 +
http://forum.gp2x.de/viewtopic.php?p=177636#p177636

Latest revision as of 22:40, 26 February 2013

DisplayLink in SL4P 14.0

Release 14.0 of SL4P is prepared for DisplayLink usage. Only a few steps are necessary to enable DisplayLink compatibility:

Step 1: Activate DisplayLink-enabled kernel and modules

Open a terminal and activate the DisplayLink-enabled kernel and modules:

su -

cd /boot
cp uImage-3.2.30-dirty-displaylink uImage

cd /lib/modules
cp -r 3.2.30-dirty-displaylink/* 3.2.30-dirty

reboot

Step 2: First Test

Plug in the DisplayLink adapter, connect the display. Make sure that USB Host is enabled on the Pandora. Then reboot the Pandora. After the reboot, the external display should turn green, as the sign that the DisplayLink driver is active and talking to the DisplayLink adapter. If it does, the first test was successful.


Step 3: Adjust /etc/X11/xorg.conf

Add this block to /etc/X11/xorg.conf

(you should make sure that /dev/fb3 is the correct framebuffer device to use, by reading the dmesg output directly after plugging in the DisplayLink adapter)

################ DisplayLink Stuff ###################
Section "Device"
Identifier "DisplayLinkDevice"
Driver "fbdev"
BusID "USB" # needed to use multiple DisplayLink devices
Option "fbdev" "/dev/fb3" # change to whatever device you want to use
# Option "rotate" "CCW" # uncomment for rotation
EndSection

Section "Monitor"
Identifier "DisplayLinkMonitor"
EndSection

Section "Screen"
Identifier "DisplayLinkScreen"
Device "DisplayLinkDevice"
Monitor "DisplayLinkMonitor"
DefaultDepth 16
EndSection

Then find the Section "ServerLayout" and add a reference to the new screen, e.g. like this:

Screen 0 "DisplayLinkScreen"
Screen 1 "Screen0" LeftOf "DisplayLinkScreen"
Option "Xinerama" "on"


Hints:

  • "Screen0" is the reference to the Pandora screen. I think that's the default identified in SL4P and SuperZaxxon. You may check to make sure it's correct.
  • You may replace "LeftOf" by "RightOf", "Above" or "Below".
  • For cloning, you may experiment with
    Option "Clone" "on"
    . However, this will need adjustment of the DisplayLink display's resolution and probably more, in order to produce a satisfying result. Please document it here, if you find a good solution for cloning.


Optional: Further tweaking of the setup

If you want to change xorg.conf and test the changes without waiting for X with XFCE to start up each time, you may do as a user:

xwmconfig

choose fvwm2

Then as root, edit /etc/inittab, and change:

id:4:initdefault:

into

id:3:initdefault:

Then SL4P boots into text mode, and you can log in and type startx to start X with the much quicker loading fwwm2 window manager. Once you have found a setup you want to use, you may revert the last steps to boot directly into XFCE again.

To Do: Hotplug

We still need to find a satisfactory hotplug solution. Currently, the X server needs to be restarted or a second instance of the X server needs to be launched, in order to make a newly plugged in DisplayLink adapter work.

It seems that real hotplug is not possible with the versions of X and udlfb (kernel): [1]

What would in theory be possible using the hotplug mechanism of Linux, as I understand it, would be, to kill and restart X automatically on every plug / unplug of a DisplayLink device. Of course, this is a really bad hack. Open applications would lose any unsaved data. But I could think of a semi-automatic solution: Whenever hot(un)plug of a DisplayLink adapter is detected, prompt the user to save any unsaved data, and to then hit the "Restart X" button of the prompting dialog.

Work in progress...


Usage hint: Use two instances of the X server

If you modified your xorg.conf as mentioned here in Step 6, it is possible to either start the X server with or without the DisplayLink adapter connected. Either method will work and give a good displaying result.

If you want to plug or unplug the DisplayLink adapter and then adapt the display (e.g.: You worked at home with DisplayLink, then unplug DisplayLink and want to continue our work on the way using just the Pandora screen), there is currently no way around closing the application(s) you worked with, saving your files, restarting the X server and reopening your applications and files.

However, there is at least a method, that makes it a bit easier by avoiding the need to leave X entirely:

Use two instances of the X server:

  • Let the Pandora boot, without DisplayLink connected, into the X environment (i.e. the /etc/inittab modification is not necessary for that method)
  • (work on the Pandora as usual)
  • (then close all applications, that you plan to use with DisplayLink later)
  • Plug in the DisplayLink adapter with the connected display. The display will be green
  • Open a console and type "startx"

--> Another instance of the X server will be started, that uses the DisplayLink-enabled setup and is shown on the external screen. The first X instance won't be visible and usable during the second instance runs.

  • (open your applications again and continue your work on the large screen)
  • (close your applications on the large screen)
  • Click the "exit" icon in the lower right corner and choose "Log out"

--> The 2nd instance of the X server will quit and you are back on the Pandora screen in the first instance of the X server

  • Now you can disconnect the DisplayLink adapter

However, please take care to really quit and restart your applications. Otherwise you may start a second instance of your application on the other screen, maybe load the same file and end up in a big mess with your data files.

SiS USB2VGA adapters

They should work in general, using the sisusbvga / sisusb kernel module and X driver. However, I have not succeeded to make one work in SL4P.

See the proof that it works in theory: http://forum.gp2x.de/viewtopic.php?p=177636#p177636