# RaspberryPi 2 - xorg.conf file HELP



## Greg Quinlan (Jan 28, 2016)

Hi,

I have managed to get 
xorg
mate
mate-desktop
xf86-video-fbdev
and with all the dependencies to compile/install on my RPI2 running FreeBSD11.
(a combination of qemu-arm emulation & native arm compiling with some quick hacks to src code etc)

The last thing remaining is to get a basic /etc/X11/xorg.conf file that will work with the RPI2

I have tried `Xorg -configure` and edited the file manually ... here is the current state. (I don't understand the layout.. I am just guessing)



```
Section "ServerLayout"
  Identifier  "X.org Configured"
  Screen  0  "myfb" 0 0
  InputDevice  "Mouse0" "CorePointer"
  InputDevice  "Keyboard0" "CoreKeyboard"
EndSection

Section "InputDevice"
  Identifier  "Keyboard0"
  Driver  "kbd"
EndSection

Section "InputDevice"
  Identifier  "Mouse0"
  Driver  "mouse"
  Option  "Protocol" "auto"
  Option  "Device" "/dev/sysmouse"
  Option  "ZAxisMapping" "4 5 6 7"
EndSection

Section "Device"
  Identifier "myfb"
  Driver "fbdev"
  Option "fbdev" "/dev/fb0"
EndSection

Section "Monitor"
  Identifier  "Monitor0"
  VendorName  "Asus"
  ModelName  "24inch"
  Option "DPMS"
EndSection
```


Error:

```
# xinit mate-session

X.Org X Server 1.17.4
Release Date: 2015-10-28
X Protocol Version 11, Revision 0
Build Operating System: FreeBSD 11.0-CURRENT arm
Current Operating System: FreeBSD rpi2 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r294539M: Tue Jan 26 13:20:29 AEDT 2016  root@rpi2:/usr/obj/usr/src/sys/RPI2 arm
Build Date: 15 January 2016  10:26:02AM

Current version of pixman: 0.32.8
  Before reporting problems, check [URL]http://wiki.x.org[/URL]
  to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
  (++) from command line, (!!) notice, (II) informational,
  (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Thu Jan 28 18:28:54 2016
(==) Using config file: "/etc/X11/xorg.conf"
Data incomplete in file /etc/X11/xorg.conf
  Undefined Screen "myfb" referenced by ServerLayout "X.org Configured".
(EE)
Fatal server error:
(EE) no screens found(EE)
(EE)
Please consult the The X.Org Foundation support
  at [URL]http://wiki.x.org[/URL]
 for help.
(EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
```

I know there is a newer /usr/local/etc/X11/xorg.conf.d directory but this seems far too complicated for what I need.

As soon as I get the graphical environment working I will clean up the image and share it.

Thanks for you help

GQ


----------



## SirDice (Jan 28, 2016)

https://wiki.freebsd.org/FreeBSD/arm/Raspberry Pi
http://blog.cochard.me/2013/03/xorg-for-freebsd-on-raspberry-pi.html


----------



## Greg Quinlan (Jan 28, 2016)

Thanks for the quick reply!! 

using ... http://blog.cochard.me/2013/03/xorg-for-freebsd-on-raspberry-pi.html

Still gives this error

```
# xinit mate-session

X.Org X Server 1.17.4
Release Date: 2015-10-28
X Protocol Version 11, Revision 0
Build Operating System: FreeBSD 11.0-CURRENT arm
Current Operating System: FreeBSD rpi2 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r294539M: Tue Jan 26 13:20:29 AEDT 2016  root@rpi2:/usr/obj/usr/src/sys/RPI2 arm
Build Date: 15 January 2016  10:26:02AM

Current version of pixman: 0.32.8
  Before reporting problems, check [URL]http://wiki.x.org[/URL]
  to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
  (++) from command line, (!!) notice, (II) informational,
  (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Thu Jan 28 18:43:11 2016
(==) Using config file: "/etc/X11/xorg.conf"
scfb trace: probe start
scfb trace: probe done
scfb: PreInit 0
(EE)
Fatal server error:
(EE) no screens found(EE)
(EE)
Please consult the The X.Org Foundation support
  at [URL]http://wiki.x.org[/URL]
 for help.
(EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
```


----------



## Greg Quinlan (Jan 28, 2016)

/var/log/Xorg.0.log


```
[INDENT]xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
# cat /var/log/Xorg.0.log
[ 12979.041]
X.Org X Server 1.17.4
Release Date: 2015-10-28
[ 12979.042] X Protocol Version 11, Revision 0
[ 12979.042] Build Operating System: FreeBSD 11.0-CURRENT arm
[ 12979.042] Current Operating System: FreeBSD rpi2 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r294539M: Tue Jan 26 13:20:29 AEDT 2016  root@rpi2:/usr/obj/usr/src/sys/RPI2 arm
[ 12979.044] Build Date: 15 January 2016  10:26:02AM
[ 12979.044]
[ 12979.044] Current version of pixman: 0.32.8
[ 12979.044]  Before reporting problems, check http://wiki.x.org
  to make sure that you have the latest version.
[ 12979.044] Markers: (--) probed, (**) from config file, (==) default setting,
  (++) from command line, (!!) notice, (II) informational,
  (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 12979.045] (==) Log file: "/var/log/Xorg.0.log", Time: Thu Jan 28 18:56:24 2016
[ 12979.045] (==) Using config file: "/etc/X11/xorg.conf"
[ 12979.047] (==) ServerLayout "layout"
[ 12979.047] (**) |-->Screen "Screen" (0)
[ 12979.047] (**) |  |-->Monitor "Monitor"
[ 12979.048] (**) |  |-->Device "Generic FB"
[ 12979.048] (**) |-->Input Device "Mouse1"
[ 12979.048] (**) |-->Input Device "Keyboard1"
[ 12979.048] (**) Option "AIGLX" "false"
[ 12979.049] (**) Option "DRI2" "False"
[ 12979.049] (==) Automatically adding devices
[ 12979.049] (==) Automatically enabling devices
[ 12979.049] (==) Not automatically adding GPU devices
[ 12979.050] (==) FontPath set to:
  /usr/local/share/fonts/misc/,
  /usr/local/share/fonts/TTF/,
  /usr/local/share/fonts/OTF/,
  /usr/local/share/fonts/Type1/,
  /usr/local/share/fonts/100dpi/,
  /usr/local/share/fonts/75dpi/
[ 12979.050] (==) ModulePath set to "/usr/local/lib/xorg/modules"
[ 12979.050] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[ 12979.050] (WW) Disabling Mouse1
[ 12979.050] (WW) Disabling Keyboard1
[ 12979.050] (II) Loader magic: 0x22ea4c
[ 12979.050] (II) Module ABI versions:
[ 12979.050]  X.Org ANSI C Emulation: 0.4
[ 12979.050]  X.Org Video Driver: 19.0
[ 12979.050]  X.Org XInput driver : 21.0
[ 12979.050]  X.Org Server Extension : 9.0
[ 12979.051] (WW) "dri" will not be loaded unless you've specified it to be loaded elsewhere.
[ 12979.051] (WW) "dri2" will not be loaded unless you've specified it to be loaded elsewhere.
[ 12979.051] (WW) "glx" will not be loaded unless you've specified it to be loaded elsewhere.
[ 12979.051] (II) "glx" will be loaded even though the default is to disable it.
[ 12979.051] (II) LoadModule: "dbe"
[ 12979.051] (II) Module "dbe" already built-in
[ 12979.051] (II) LoadModule: "extmod"
[ 12979.052] (II) Module "extmod" already built-in
[ 12979.052] (II) LoadModule: "scfb"
[ 12979.053] (II) Loading /usr/local/lib/xorg/modules/drivers/scfb_drv.so
[ 12979.054] (II) Module scfb: vendor="X.Org Foundation"
[ 12979.054]  compiled for 1.17.4, module version = 0.0.4
[ 12979.054]  ABI class: X.Org Video Driver, version 19.0
[ 12979.054] (II) scfb: driver for wsdisplay framebuffer: scfb
[ 12979.054] (--) Using syscons driver with X support (version 2.0)
[ 12979.055] (--) using VT number 9

[ 12979.055] (WW) Falling back to old probe method for scfb
[ 12979.055] scfb trace: probe start
[ 12979.055] (II) scfb(0): using default device
[ 12979.055] scfb trace: probe done
[ 12979.055] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[ 12979.055] scfb: PreInit 0
[ 12979.056] (II) scfb(0): Using: depth (24),  width (1824),  height (984)
[ 12979.056] (EE) scfb(0): specified depth (16) or bpp (16) doesn't match framebuffer depth (24)
[ 12979.056] (II) UnloadModule: "scfb"
[ 12979.056] (EE) Screen(s) found, but none have a usable configuration.
[ 12979.056] (EE)
Fatal server error:
[ 12979.056] (EE) no screens found(EE)
[ 12979.056] (EE)
Please consult the The X.Org Foundation support
  at http://wiki.x.org
for help.
[ 12979.056] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[ 12979.056] (EE)
[ 12979.057] (EE) Server terminated with error (1). Closing log file.[/INDENT]
```


----------



## acheron (Jan 28, 2016)

I think you need to change the depth to 24:

```
(EE) scfb(0): specified depth (16) or bpp (16) doesn't match framebuffer depth (24)
```


----------



## acheron (Jan 28, 2016)

Greg Quinlan said:


> a combination of qemu-arm emulation & native arm compiling with some quick hacks to src code etc


Can you tell me why you need to natively compile some ports and what were your hacks to the src code?


----------



## Greg Quinlan (Jan 28, 2016)

The packages were not available using `pkg install <pkg>`. Which means they did not compile for the ARM platform.

When I tried to compile them myself from the ports, all failed with various issues... i.e. core dumps or other "silly" errors.

For those that would not compile (e.g. core dump) I compiled some using qemu on a amd64 version of FreeBSD, but qemu has issues with scripts, it was ignoring the script directive on the first line (i.e. /usr/local/bin/python27 or setenv python27)... I created a shell script which basically called a renamed version of the original script.... e.g. `/usr/local/bin/python 27 <original script> $*`"

Other ports didn't compile because of path issues.... not patched properly. i.e. one port was calling /nxb-bin/usr/bin/cc which was changed to /usr/bin/cc in all the Makefiles.

I probably should have been making notes... LOL


----------



## Greg Quinlan (Jan 28, 2016)

Changed depth to 24

I have the RPI2 plugged into a 4K 60" Panasonic TV via a HDMI port.

/var/log/Xorg.0.log


```
[INDENT]xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
# cat "/var/log/Xorg.0.log"
[  2030.216]
X.Org X Server 1.17.4
Release Date: 2015-10-28
[  2030.217] X Protocol Version 11, Revision 0
[  2030.217] Build Operating System: FreeBSD 11.0-CURRENT arm
[  2030.217] Current Operating System: FreeBSD rpi2 11.0-CURRENT FreeBSD 11.0-CU  RRENT #1 r294539M: Thu Jan 28 16:42:56 AEDT 2016  root@rpi2:/usr/obj/usr/src/  sys/RPI2 arm
[  2030.219] Build Date: 15 January 2016  10:26:02AM
[  2030.219]
[  2030.219] Current version of pixman: 0.32.8
[  2030.219]  Before reporting problems, check http://wiki.x.org
  to make sure that you have the latest version.
[  2030.219] Markers: (--) probed, (**) from config file, (==) default setting,
  (++) from command line, (!!) notice, (II) informational,
  (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[  2030.220] (==) Log file: "/var/log/Xorg.0.log", Time: Thu Jan 28 20:25:13 201  6
[  2030.220] (==) Using config file: "/etc/X11/xorg.conf"
[  2030.222] (==) ServerLayout "layout"
[  2030.222] (**) |-->Screen "Screen" (0)
[  2030.222] (**) |  |-->Monitor "Monitor"
[  2030.223] (**) |  |-->Device "Generic FB"
[  2030.223] (**) |-->Input Device "Mouse1"
[  2030.223] (**) |-->Input Device "Keyboard1"
[  2030.223] (**) Option "AIGLX" "false"
[  2030.224] (**) Option "DRI2" "False"
[  2030.224] (==) Automatically adding devices
[  2030.224] (==) Automatically enabling devices
[  2030.224] (==) Not automatically adding GPU devices
[  2030.225] (==) FontPath set to:
  /usr/local/share/fonts/misc/,
  /usr/local/share/fonts/TTF/,
  /usr/local/share/fonts/OTF/,
  /usr/local/share/fonts/Type1/,
  /usr/local/share/fonts/100dpi/,
  /usr/local/share/fonts/75dpi/
[  2030.225] (==) ModulePath set to "/usr/local/lib/xorg/modules"
[  2030.225] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vm  mouse' will be disabled.
[  2030.225] (WW) Disabling Mouse1
[  2030.225] (WW) Disabling Keyboard1
[  2030.225] (II) Loader magic: 0x22ea4c
[  2030.225] (II) Module ABI versions:
[  2030.225]  X.Org ANSI C Emulation: 0.4
[  2030.225]  X.Org Video Driver: 19.0
[  2030.225]  X.Org XInput driver : 21.0
[  2030.225]  X.Org Server Extension : 9.0
[  2030.226] (WW) "dri" will not be loaded unless you've specified it to be load  ed elsewhere.
[  2030.226] (WW) "dri2" will not be loaded unless you've specified it to be loa  ded elsewhere.
[  2030.226] (WW) "glx" will not be loaded unless you've specified it to be load  ed elsewhere.
[  2030.226] (II) "glx" will be loaded even though the default is to disable it.
[  2030.226] (II) LoadModule: "dbe"
[  2030.227] (II) Module "dbe" already built-in
[  2030.227] (II) LoadModule: "extmod"
[  2030.227] (II) Module "extmod" already built-in
[  2030.227] (II) LoadModule: "scfb"
[  2030.228] (II) Loading /usr/local/lib/xorg/modules/drivers/scfb_drv.so
[  2030.229] (II) Module scfb: vendor="X.Org Foundation"
[  2030.229]  compiled for 1.17.4, module version = 0.0.4
[  2030.229]  ABI class: X.Org Video Driver, version 19.0
[  2030.229] (II) scfb: driver for wsdisplay framebuffer: scfb
[  2030.230] (--) Using syscons driver with X support (version 2.0)
[  2030.230] (--) using VT number 9

[  2030.230] (WW) Falling back to old probe method for scfb
[  2030.230] scfb trace: probe start
[  2030.230] (II) scfb(0): using default device
[  2030.230] scfb trace: probe done
[  2030.230] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[  2030.230] scfb: PreInit 0
[  2030.231] (II) scfb(0): Using: depth (24),  width (1824),  height (984)
[  2030.231] (EE) scfb(0): specified depth (24) or bpp (32) doesn't match frameb  uffer depth (24)
[  2030.231] (II) UnloadModule: "scfb"
[  2030.231] (EE) Screen(s) found, but none have a usable configuration.
[  2030.231] (EE)
Fatal server error:
[  2030.231] (EE) no screens found(EE)
[  2030.231] (EE)
Please consult the The X.Org Foundation support
  at http://wiki.x.org
for help.
[  2030.231] (EE) Please also check the log file at "/var/log/Xorg.0.log" for ad  ditional information.
[  2030.232] (EE)
[  2030.232] (EE) Server terminated with error (1). Closing log file.[/INDENT]
```

This is where it is unhappy....

/usr/ports/x11-drivers/xf86-video-scfb/work/xf86-video-scfb-bdeb3bf/src/scfb_driver.c

Starts at line 431


```
/* Check consistency. */
  if (pScrn->bitsPerPixel != fPtr->info.vi_depth) {
  xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
  "specified depth (%d) or bpp (%d) doesn't match "
  "framebuffer depth (%d)\n", pScrn->depth,
  pScrn->bitsPerPixel, fPtr->info.vi_depth);
  return FALSE;
  }
```


----------



## Greg Quinlan (Jan 30, 2016)

To got this working by editing (hacked)

/usr/ports/x11-drivers/xf86-video-scfb/work/xf86-video-scfb-bdeb3bf/src/scfb_driver.c

Added


```
/* temporary hack */
pScrn->bitsPerPixel = fPtr->info.vi_depth;

/* Check consistency. */
  if (pScrn->bitsPerPixel != fPtr->info.vi_depth) {
  xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
  "specified depth (%d) or bpp (%d) doesn't match "
  "framebuffer depth (%d)\n", pScrn->depth,
  pScrn->bitsPerPixel, fPtr->info.vi_depth);
  return FALSE;
  }
```

then I rebuilt the driver

`cd /usr/ports/x11-drivers/xf86-video-scfb/work`
`rm .build* .install* .stage* stage*`
`cd ..`
`make deinstall`
`make install`

Then started x11/mate-desktop

`xinit mate-session`

*WORKS!!! (GUI x11/mate-desktop)*

So the /etc/X11/xorg.conf is good... but there appears to be a strange issue...
perhaps around the resolution which seems a bit odd.
from the log file

```
[  2030.231] (II) scfb(0): Using: depth (24),  width (1824),  height (984)
```


----------

