Link to home
Start Free TrialLog in
Avatar of Mark
Mark

asked on

Get displaylink USB/VGA working in text mode for Slackware 14.1

I have a Sony Vaio VGN-P530H running a newly installed 32bit Slackware 14.1. I have a DisplayLink USB->VGA adapter connected. I get the "Green Screen" on the connected monitor, which it supposedly a good sign that the udlfb driver is working. I've read through /usr/src/linux-3.14.24/Documentation/fb/udlfb.txt, but I can't seem to glean "how to" get stuff onto the monitor. One link, http://comments.gmane.org/gmane.comp.freedesktop.libdlo/653, referencing the aforementioned documentation, suggests:

 modprobe udlfb defio=1 console=1

Open in new window


which I did, but nothing happened. I unplugged and replugged the displaylink, still nothing.

The documentation further states that "The most common client of udlfb is xf86-video-displaylink or a modified xf86-video-fbdev X server." I don't have that, but that appears to be for X. I'm not interested in X (at this point). I really only need the VAIO text console to be cloned to the external monitor.

Seems like this should be simple. What should I do?
Avatar of gheist
gheist
Flag of Belgium image

USB modules are loaded automatically.
You need to add module options into /etc/modprobe.d/whatever_or_local.conf (new file will do just fine and not conflict with system upgrades)
options udlfb console=1
Then rmmod.
Then plug your USB device and check dmesg.
No there will be no clone in console framebuffer, that is luxury of Xorg. Best you can achieve is to disable builtin video card modeset driver and hope that USB console appears.
Avatar of Mark
Mark

ASKER

gheist: I'll need your suggestions fleshed out a bit ...

You need to add module options into /etc/modprobe.d/whatever_or_local.conf

What module options? Does the file name "whatever" not matter? is your "local.conf" a suggested file name? As you can probably tell, I'm not too familiar with using modprobe. The link I referenced said:

Or for permanent option, create file like /etc/modprobe.d/options with text
options udlfb defio=1 console=1
Does this mean that I should create a file /etc/modprobe.d/options with the one line of content:
options udlfb defio=1 console=1

Open in new window

Is that basically what you are saying? Again, the actual name of the file does not matter because modprobe will run 'em all?

Assuming I'm making the correct assumptions, I've created such a file in /etc/modprobe.d/displaylink.conf, containing the one line shown above.

Then rmmod.

You didn't say which module, so I did `rmmod utlfb` (with USB unplugged)

Then plug your USB device and check dmesg.

Did that and nothing happened except that I no longer have a green screen. Dmesg output is below.

Tried rebooting. Got the green screen back, but otherwise nothing.

the /etc/modprobe.d/README file says:
# /etc/modprobe.d/README
#
# The monolithic "blacklist" file (and others) that used to be here in this
# directory have been split into several more fine-grained files and moved
# to the /lib/modprobe.d/ directory.  Any file in /lib/modprobe.d/ will be
# overridden by an identically named file in this directory (/etc/modprobe.d/)
# or /run/modprobe.d/ (but since /run is on a tmpfs, it's not persistent
# across reboots, so you probably don't want to use it).
#
# See "man modprobe.d" for more information.
#

Open in new window

So I move the displaylink.conf to /lib/modprobe.d and rebooted. Still nothing. (green screen, yes). I've put what I believe to be the dmesg output from this last boot at the bottom of this posting.

dmesg after creating displaylink.conf, rmmod and re-plugging USB monitor"
[1236617.939299] usb 1-1.2: USB disconnect, device number 10
[1236617.939597] udlfb: USB disconnect starting
[1236617.939612] udlfb: Freeing all render urbs
[1236617.945505] udlfb: fb_info for /dev/fb1 has been freed
[1236617.945697] udlfb: freeing dlfb_data eff1a800
[1236646.762243] usbcore: deregistering interface driver udlfb
[1236669.792454] gma500 0000:00:02.0: Backlight lvds set brightness 7a127a12
[1236669.792508] gma500 0000:00:02.0: Backlight lvds set brightness 7a127a12
[1236698.235877] usb 1-1.2: new high-speed USB device number 11 using ehci-pci
[1236698.317149] usb 1-1.2: New USB device found, idVendor=17e9, idProduct=02ee
[1236698.317174] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[1236698.317188] usb 1-1.2: Product: VGA Display Adapter
[1236698.317200] usb 1-1.2: Manufacturer: DisplayLink
[1236698.317212] usb 1-1.2: SerialNumber: 111305
[1236698.324154] [drm] vendor descriptor length:1b data:1b 5f 01 00 19 05 00 01 03 00 04
[1236698.522081] udl 1-1.2:1.0: fb1: udldrmfb frame buffer device
[1236698.522106] [drm] Initialized udl 0.0.1 20120220 on minor 1

Open in new window


dmesg after moving displaylink.conf to /lib/modprobe.d and rebooting
[   14.428177] udlfb: 720x400 @ 70 Hz valid mode
[   14.428182] udlfb: 640x480 @ 60 Hz valid mode
[   14.428186] udlfb: 640x480 @ 72 Hz valid mode
[   14.428191] udlfb: 640x480 @ 75 Hz valid mode
[   14.428195] udlfb: 800x600 @ 56 Hz valid mode
[   14.428198] udlfb: 800x600 @ 60 Hz valid mode
[   14.428201] udlfb: 800x600 @ 72 Hz valid mode
[   14.428205] udlfb: 800x600 @ 75 Hz valid mode
[   14.428208] udlfb: 1024x768 @ 60 Hz valid mode
[   14.428211] udlfb: 1024x768 @ 70 Hz valid mode
[   14.428215] udlfb: 1024x768 @ 75 Hz valid mode
[   14.428218] udlfb: Reallocating framebuffer. Addresses will change!
[   14.431530] udlfb: 1024x768 @ 60 Hz valid mode
[   14.431535] udlfb: set_par mode 1024x768
[   14.829320] udlfb: DisplayLink USB device /dev/fb1 attached. 1024x768 resolution. Using 3072K framebuffer memory

Open in new window

So, I suppose my assumptions were wrong?
defio is not a valid parameter according to ubuntu 14.04 I have.
Avatar of Mark

ASKER

Removed defio parameter. No difference. dmesg out put is the same as shown at end of previous message. I have a file in /lib/modprobe.d/displaylink.conf, contents:
options udlfb console=1

Open in new window

Is that correct?
Avatar of Mark

ASKER

Moved displaylink.conf back to /etc/modprobe.d, disabled /etc/rc.d/rc.setfont, rebooted. No difference. Still have green screen though. dmesg from latest boot:
[   15.137881] Bluetooth: HCI device and connection manager initialized
[   15.145087] udlfb: DisplayLink VGA Display Adapter - serial #111305
[   15.145093] udlfb: vid_17e9&pid_02ee&rev_0103 driver's dlfb_data struct at f5e89000
[   15.145095] udlfb: console enable=1
[   15.145097] udlfb: fb_defio enable=1
[   15.145099] udlfb: shadow enable=1
[   15.146858] udlfb: vendor descriptor length:1b data:1b 5f 01 0019 05 00 01 03 00 04
[   15.146862] udlfb: DL chip limited to 2080000 pixel modes
[   15.147091] udlfb: allocated 4 65024 byte urbs
[   15.147673] usbcore: registered new interface driver udlfb
[   15.228442] usbcore: registered new interface driver udl
[   15.237963] udlfb: 1024x768 @ 60 Hz valid mode
[   15.237968] udlfb: 720x400 @ 70 Hz valid mode
[   15.237971] udlfb: 640x480 @ 60 Hz valid mode
[   15.237975] udlfb: 640x480 @ 72 Hz valid mode
[   15.237978] udlfb: 640x480 @ 75 Hz valid mode
[   15.237981] udlfb: 800x600 @ 56 Hz valid mode
[   15.237984] udlfb: 800x600 @ 60 Hz valid mode
[   15.237987] udlfb: 800x600 @ 72 Hz valid mode
[   15.237991] udlfb: 800x600 @ 75 Hz valid mode
[   15.237994] udlfb: 1024x768 @ 60 Hz valid mode
[   15.237997] udlfb: 1024x768 @ 70 Hz valid mode
[   15.238001] udlfb: 1024x768 @ 75 Hz valid mode
[   15.238020] udlfb: Reallocating framebuffer. Addresses will change!
[   15.241233] udlfb: 1024x768 @ 60 Hz valid mode
[   15.241238] udlfb: set_par mode 1024x768

Open in new window

You might need to disable other "Color framebuffer" drivers
Avatar of Mark

ASKER

How would I do that? /etc/lilo.conf is set to vga=788 # 800x600x32K. Should I set to "Normal VGA mode"?

I also have "nomodeset" in lilo.conf, but that doesn't appear to do anything on this particular computer. Should I remove that?

In fact, removing nomodeset and setting vga=normal had no effect. Below is part of my dmesg after boot with above changes. My built-in screen goes from larger, readable font to micro-font and the displaylink monitor goes all-green just before I see the message "Console: switching to colour frame buffer device 200x48". Additional frame-buffer messages are included thereafter.

The last several lines listed are tantalizing. It appears a frame buffer is attached to /dev/fb1, It lists a 1024x768 resolution ... now if I could just *see* something on that screen!
[   17.917195] fbcon: psbdrmfb (fb0) is primary device
[   18.248902] Console: switching to colour frame buffer device 200x48
[   18.272174] gma500 0000:00:02.0: fb0: psbdrmfb frame buffer device
[   18.272352] gma500 0000:00:02.0: registered panic notifier
[   18.272658] gma500 0000:00:02.0: Backlight lvds set brightness 7a127a12
:
:
[   18.582952] udlfb: DisplayLink VGA Display Adapter - serial #111305
[   18.583215] udlfb: vid_17e9&pid_02ee&rev_0103 driver's dlfb_data struct at f4549000
[   18.583485] udlfb: console enable=1
[   18.583621] udlfb: fb_defio enable=1
[   18.583758] udlfb: shadow enable=1
[   18.584150] udlfb: vendor descriptor length:1b data:1b 5f 01 0019 05 00 01 03 00 04
[   18.589294] udlfb: DL chip limited to 2080000 pixel modes
[   18.594348] udlfb: allocated 4 65024 byte urbs
[   18.599514] usbcore: registered new interface driver udlfb
[   18.646707] uvcvideo: Found UVC 1.00 device <unnamed> (05ca:18b2)
[   18.654162] input: UVC Camera (05ca:18b2) as /devices/pci0000:00/0000:00:1d.7/usb4/4-8/4-8:1.0/input/input14
[   18.660204] usbcore: registered new interface driver uvcvideo
[   18.666150] USB Video Class driver (1.1.1)
[   18.710275] udlfb: 1024x768 @ 60 Hz valid mode
[   18.716177] udlfb: 720x400 @ 70 Hz valid mode
[   18.722166] udlfb: 640x480 @ 60 Hz valid mode
[   18.728196] udlfb: 640x480 @ 72 Hz valid mode
[   18.734095] udlfb: 640x480 @ 75 Hz valid mode
[   18.739999] udlfb: 800x600 @ 56 Hz valid mode
[   18.745913] udlfb: 800x600 @ 60 Hz valid mode
[   18.751971] udlfb: 800x600 @ 72 Hz valid mode
[   18.758089] udlfb: 800x600 @ 75 Hz valid mode
[   18.764069] udlfb: 1024x768 @ 60 Hz valid mode
[   18.770105] udlfb: 1024x768 @ 70 Hz valid mode
[   18.776165] udlfb: 1024x768 @ 75 Hz valid mode
[   18.782779] udlfb: Reallocating framebuffer. Addresses will change!
[   18.792289] udlfb: 1024x768 @ 60 Hz valid mode
[   18.792690] usbcore: registered new interface driver udl
[   18.806769] udlfb: set_par mode 1024x768
[   18.825659] udlfb: DisplayLink USB device /dev/fb1 attached. 1024x768 resolution. Using 3072K framebuffer me
mory

Open in new window

I think i saw this machine already before on E-E
To get text console on other adapter you must disable poulsbo driver loading at boot, then let kernel initialize text console on usb adapter and let Xorg load poulsbo driver later.
by disabling i mean not making it via modprobe.d, most likely you need to remove poulsbo module from initrd, and add usb extender there. (just make sure to make a copy of current initrd and boot entry)
Avatar of Mark

ASKER

> I think i saw this machine already before on E-E

Yes you did. I had it loaded with Ubuntu and we did successfully get the X display onto the display adapter. Now I'm looking to forget about X and just want the text console. I rarely use X on Linux, well, never in fact. Therefore, using the Xorg setup is not really where I want to go. Just plain 'ole text console. Seems like this should be easier than an X display, but I guess not. I have no idea what poulsbo is, but I'll investigate. I'm sure I'll be back with question.
Text console is on one framebuffer. You need to get rid of GMA500 kernel module for boot stage, then USB framebuffer will be used.
Avatar of Mark

ASKER

I find the following:
$ lsmod | grep -i gma500
gma500_gfx            149957  1
drm_kms_helper         31444  2 udl,gma500_gfx
drm                   192016  4 udl,drm_usb,drm_kms_helper,gma500_gfx
i2c_algo_bit            4575  1 gma500_gfx
i2c_core               18166  7 drm,i2c_isch,i2c_dev,drm_kms_helper,i2c_algo_bit,gma500_gfx,videodev
video                  10319  1 gma500_gfx

Open in new window


So, would blacklisting "gma500_gfx" do the trick?
It turns out easy to blacklist on slackware:
http://docs.slackware.com/howtos:hardware:proprietary_graphics_drivers
(would be muuucchhh loongerr jooourneey on your old friend ubuntu)

yes, you blacklist gma500_gfx, default display comes up as 80x25 and boot should continue on framebuffer over USB (well in a perfect world at least)
Avatar of Mark

ASKER

At last some progress! Blacklisting gma500_gfx did send the console output to the VGA, Yeah! Two problems though:

1. `setfont -C /dev/console` no longer works, so I can't change the console font.

2. Bigger problem: I must *always* have the displayLink VGA attached because the built-in display no longer shows console output after "Entering runlevel 3".

In fact, I did some more research and found this link: https://www.kernel.org/doc/Documentation/fb/fbcon.txt and tried the following setting in /etc/lilo.conf:

 append="nomodeset fbcon=map:1 vt.default_utf8=0"

... not blacklisting anything. That actually worked too AND I could set the console fonts.

Problem #2 still remains. Is there a way to:

a) set this boot parameter at boot time from the lilo boot menu? I've tried entering "Linux fbcon=map:1" at the "boot: " prompt, but no luck.

b) even better, can this be set *after* booting from the command line? That way I could choose whether or not to use the external VGA, or I could even put commands in rc.local to detect the presence of the displayLink and automatically use it if present, or not change the fbcon setting if not connected.

Ideas?
ASKER CERTIFIED SOLUTION
Avatar of gheist
gheist
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mark

ASKER

Hmmm, excellent idea. Before I totally mess up lilo.conf and have to boot from CD, please review my settings. Current lilo.conf is:
boot = /dev/sda
message = /boot/boot_message.txt
append="nomodeset fbcon=map:1 vt.default_utf8=0"
prompt
timeout = 600
vga = normal

image = /boot/vmlinuz
  root = /dev/sda1
  label = Linux
  read-only  # Partitions should be mounted read-only for checking

other = /dev/sda2
  label = Windows
  table = /dev/sda

Open in new window

Would I alter it as follows?
boot = /dev/sda
message = /boot/boot_message.txt
prompt
timeout = 600
vga = normal

image = /boot/vmlinuz
  append="nomodeset vt.default_utf8=0"
  root = /dev/sda1
  label = Linux
  read-only  # Partitions should be mounted read-only for checking

image = /boot/vmlinuz
  append="nomodeset fbcon=map:1 vt.default_utf8=0"
  root = /dev/sda1
  label = "Linux displayLink VGA"
  read-only  # Partitions should be mounted read-only for checking

other = /dev/sda2
  label = Windows
  table = /dev/sda

Open in new window

Avatar of Mark

ASKER

OK, I couldn't wait for your response so I went ahead and tried my suggested lilo.conf and thanfully, it worked! I can switch back and forth between built-in monitor and external VGA by selecting different boot "images".

One last question - is there a way after booting (e.g. from rc.local) to determine which frame buffer was selected at boot? I've looked for clues in /sys/class/vtconsole/, /sys/dev/char/29:*/, /usr/src/linux-3.14.24/Documentation/fb/framebuffer.txt, and /usr/src/linux-3.14.24/Documentation/console/console.txt, but no luck.
ls /sys/dev/ices/virtual/graphics ?
Avatar of Mark

ASKER

Nope, that doesn't really tell me anything.

I've worked out a crude solution, but surely there must be something that tells me which frame buffer I'm using!!

Here's what I'm doing. In /etc/rc.d/rc.font I have the script shown below. Basically, I've determined that the VAIO built-in screen comes up in 200 column mode with boot parameters "nomodeset" and "vga = normal". When I boot the displayLink VGA "image" the console is 128 columns. I'd prefer a more technically robust method like examining something in /sys or /proc, but this seems to work.
#!/bin/sh

cols=`/usr/bin/stty -a | grep columns | awk 'BEGIN{RS=";"}{print $0}' | grep columns | awk '{print $2}'`

if [ "$cols" -eq 200 ]          # vaio default with nomodeset, vga = normal
then
    echo setting console font ter-132b.psf.gz
    setfont -C /dev/console ter-132b.psf.gz             # when using viao screen
else
    echo setting console font ter-122b.psf.gz
    setfont -C /dev/console ter-122b.psf.gz             # when using DisplayLink USB attached VGA
fi

Open in new window

I'll leave this open a bit longer in case you have a "Eureka!" moment and suddenly think of /proc or /sys file to examine or some command to run to really tell me which frambuffer.

Otherwise, I think we can stick a fork in this one!

As the E-E resident low-level Linux guru, you are invited to check out my next conundrum with this little time-consuming VAIO device: https://www.experts-exchange.com/questions/28586311/linux-prevent-lid-close-suspend.html - closing the lid!