Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRM method: "open: No such file or directory" #72

Closed
johnhamelink opened this issue Apr 21, 2014 · 15 comments
Closed

DRM method: "open: No such file or directory" #72

johnhamelink opened this issue Apr 21, 2014 · 15 comments

Comments

@johnhamelink
Copy link

Hi there,

I'm trying to get redshift to work on my desktop running AMD catalyst drivers, but it's not working:

λ ruby-2.1.0 →  orion app_playbooks → λ git master* → redshift -m drm -l 55.84:-4.25 
open: No such file or directory
Failed to start adjustment method drm.
Section "ServerLayout"
    Identifier     "aticonfig Layout"
    Screen      0  "aticonfig-Screen[0]-0" 1920 0
    Screen         "aticonfig-Screen[0]-1" 0 0
EndSection

Section "Module"
EndSection

Section "ServerFlags"
    Option      "Xinerama" "on"
EndSection

Section "Monitor"
    Identifier   "aticonfig-Monitor[0]-0"
    Option      "VendorName" "ATI Proprietary Driver"
    Option      "ModelName" "Generic Autodetecting Monitor"
    Option      "DPMS" "true"
EndSection

Section "Monitor"
    Identifier   "aticonfig-Monitor[0]-1"
    Option      "VendorName" "ATI Proprietary Driver"
    Option      "ModelName" "Generic Autodetecting Monitor"
    Option      "DPMS" "true"
EndSection

Section "Monitor"
    Identifier   "0-DFP1"
    Option      "VendorName" "ATI Proprietary Driver"
    Option      "ModelName" "Generic Autodetecting Monitor"
    Option      "DPMS" "true"
    Option      "PreferredMode" "1920x1200"
    Option      "TargetRefresh" "60"
    Option      "Position" "0 0"
    Option      "Rotate" "normal"
    Option      "Disable" "false"
EndSection

Section "Monitor"
    Identifier   "0-DFP5"
    Option      "VendorName" "ATI Proprietary Driver"
    Option      "ModelName" "Generic Autodetecting Monitor"
    Option      "DPMS" "true"
    Option      "PreferredMode" "1920x1200"
    Option      "TargetRefresh" "60"
    Option      "Position" "0 0"
    Option      "Rotate" "normal"
    Option      "Disable" "false"
EndSection

Section "Device"
    Identifier  "aticonfig-Device[0]-0"
    Driver      "fglrx"
    Option      "Monitor-DFP1" "0-DFP1"
    BusID       "PCI:1:0:0"
EndSection

Section "Device"
    Identifier  "aticonfig-Device[0]-1"
    Driver      "fglrx"
    Option      "Monitor-DFP5" "0-DFP5"
    BusID       "PCI:1:0:0"
    Screen      1
EndSection

Section "Screen"
    Identifier "aticonfig-Screen[0]-0"
    Device     "aticonfig-Device[0]-0"
    DefaultDepth     24
    SubSection "Display"
        Viewport   0 0
        Depth     24
    EndSubSection
EndSection

Section "Screen"
    Identifier "aticonfig-Screen[0]-1"
    Device     "aticonfig-Device[0]-1"
    DefaultDepth     24
    SubSection "Display"
        Viewport   0 0
        Depth     24
    EndSubSection
EndSection

As you can probably tell from the xorg.conf file, I've got two monitors. I'm running from a Radeon HD 7950. Running redshift with the default mode works for the first screen, but not for the second.

@maandree
Copy link
Contributor

If I am understanding this correctly. You have one graphics card.
Two X screens each one monitor.

I have one screen with two monitors and have not tested one two
screens with one monitor each so for all I know there could be
and error in how screens are handled. But if everything is corrent
either of these should work in X:

redshift -l 55.84:-4.25 -m vidmode:screen=0
# Adjusts the first monitor.
redshift -l 55.84:-4.25 -m vidmode
# Does the same thing as the one above.
redshift -l 55.84:-4.25 -m vidmode:screen=1
# Adjusts the second monitor.

Replacing vidmode with randr or optionally randr:crtc=0
should have the same effect.

To adjust two monitors concurrently you will need to use
pull request #61.

As for DRM, I will have to look into that.

@johnhamelink
Copy link
Author

@maandree first of all, I found out that RandR was somehow disabled in my config, so I've enabled it with:

sudo aticonfig --set-pcs-str="DDX,EnableRandR12,TRUE"

But still:

λ ruby-2.1.0 →  orion badgemaker → λ git develop* → redshift -l 55.84:4.2 -m randr
`RANDR Query Version' returned error -1
Initialization of randr failed.
λ ruby-2.1.0 →  orion badgemaker → λ git develop* → sudo redshift -l 55.84:4.25 -m drm
open: No such file or directory
Failed to start adjustment method drm.

Using the repo from both the latest version and the version in the PR, I get the following message when I try to run on the second screen:

λ ruby-2.1.0 →  orion src → λ git ac2103c → ./redshift -m vidmode,screen=1  
Screen 1 does not exist. Only screen 0 exists, did you mean CRTC 1?
If so, you need to use `randr' instead of `vidmode'.
Failed to start adjustment method vidmode.

Running with the all flag just seems to enable it on the primary screen:

λ ruby-2.1.0 →  orion src → λ git ac2103c → ./redshift -m vidmode,screen=all
^C%                                                             

PS: Running your version (redshift on the arch repositories and redshift-git on AUR) works with screen=1

@maandree
Copy link
Contributor

What is the output of xrandr.
I have tried to get two screens working using Radeon (I have not yet tested your setup),
but I could not manage to get it working, either the monitors were blank with one screen
and one output. And often RandR was disabled. You might actuall have one screen with
two monitors inside it. In this case VidMode would only be able to adjust the primary monitor.

If you cannot get output from xrandr you can still test of you actually have two screens:
very few programs can be moved between screens (GIMP and Emacs are the only ones
I know that can be moved between screens.).

@johnhamelink
Copy link
Author

λ ruby-2.1.0 →  orion ~ → xrandr
RandR extension missing

I'm using xinerama, and awesomewm handles my monitors correctly:
my desktop

Yes, I can move programs between screens

@maandree
Copy link
Contributor

I thought you disabled Xinerama in xorg.conf.
You can probably do without xorg.conf, try
removing it and start another X display.

@johnhamelink
Copy link
Author

No I didn't it's enabled in Amd's catalyst control center:

amdcccle

@johnhamelink
Copy link
Author

Wait, sorry, there's a conf.d in /etc/X11 now:

#
# Catch-all evdev loader for udev-based systems
# We don't simply match on any device since that also adds accelerometers
# and other devices that we don't really want to use. The list below
# matches everything but joysticks.

Section "InputClass"
        Identifier "evdev pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Section "InputClass"
        Identifier "evdev keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Section "InputClass"
    Identifier "Keyboard Defaults"
    MatchIsKeyboard "on"
    Option "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection

Section "InputClass"
        Identifier "evdev touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Section "InputClass"
        Identifier "evdev tablet catchall"
        MatchIsTablet "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Section "InputClass"
        Identifier "evdev touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection
# Collection of quirks and blacklist/whitelists for specific devices.


# Accelerometer device, posts data through ABS_X/ABS_Y, making X unusable
# http://bugs.freedesktop.org/show_bug.cgi?id=22442⎵
Section "InputClass"
        Identifier "ThinkPad HDAPS accelerometer blacklist"
        MatchProduct "ThinkPad HDAPS accelerometer data"
        Option "Ignore" "on"
EndSection
Section "InputClass"
Identifier "Saitek Cyborg R.A.T.9 Mouse"
MatchIsPointer "on"
MatchProduct "R.A.T.9|Saitek Cyborg R.A.T.9 Mouse"
MatchVendor "Saitek|SAITEK"
MatchDevicePath "/dev/input/event*"
Option "Protocol" "auto"
Option "Buttons" "17"
Option "ButtonMapping" "1 2 3 4 5 6 7 8 9 10 11 12 0 0 0 16 17"
Option "ZAxisMapping" "4 5 10 11"
Option "AutoReleaseButtons" "13 14 15"
EndSection

@maandree
Copy link
Contributor

You probably have one screen with two outputs.
Try temporarily removing the configurations and start a new X display.
(The files included above can be left as is, there only affect input devices.)

To clarify incase there is confusion about the nomenclature,
here is a list of relevent words throughout redshift:

display: what you start when you run startx. (synonym for CRTC in Windows and Mac.)
screen: a logical collection of outputs, or actually connectors.
output: what a monitor is attached to, active CRTC.
CRTC: what controls a monitor, an online connector, not necessarily active.
connector: an output, even if not physically available, on the graphics card.

@maandree
Copy link
Contributor

In src/gamma-drm.c, between the lines.

state->fd = open(pathname, O_RDWR | O_CLOEXEC);
if (state->fd < 0) {

insert

printf("Using DRM file: %s\n", pathname);

What is its output, and what does ls /dev/dri print?

Edit: Use the branch ‘master’. The lines are no. 67 and 68.

@johnhamelink
Copy link
Author

Very interesting results:

I moved my config outside of /etc/X11, ran sudo aticonfig --initial=dual-head and started X. The primary monitor showed the screen as usual, but the secondary monitor was blank and I couldn't move any windows on to it.

Looking at amdcccle, the second monitor is listed as "single display desktop". Xinerama is not enabled.

However, xrandr now works:

λ ruby-2.1.0 →  orion ~ → xrandr
Screen 0: minimum 320 x 200, current 1920 x 1200, maximum 1920 x 1920
DFP1 connected 1920x1200+0+0 (normal left inverted right x axis y axis) 518mm x 324mm
   1920x1200     59.95*+
   1920x1080     60.00  
   1600x1200     60.00  
   1680x1050     59.95  
   1400x1050     60.00  
   1280x1024     60.02  
   1440x900      60.00  
   1280x960      60.00  
   1280x800      60.00  
   1280x768      60.00  
   1280x720      60.00  
   1024x768      60.00  
   800x600       60.32  
   640x480       59.94  
DFP2 disconnected (normal left inverted right x axis y axis)
DFP3 disconnected (normal left inverted right x axis y axis)
DFP4 disconnected (normal left inverted right x axis y axis)
DFP5 disconnected (normal left inverted right x axis y axis)
DFP6 disconnected (normal left inverted right x axis y axis)
DFP7 disconnected (normal left inverted right x axis y axis)
DFP8 disconnected (normal left inverted right x axis y axis)
DFP9 disconnected (normal left inverted right x axis y axis)
DFP10 disconnected (normal left inverted right x axis y axis)
CRT1 disconnected (normal left inverted right x axis y axis)

and redshift uses randr to dim the screen by default. Running with -m drm gives us the following:

λ ruby-2.1.0 →  orion src → λ git master* → ./redshift -m drm
Using DRM file: /dev/dri/card0
open: No such file or directory
Failed to start adjustment method drm.

Obviously I can't test if using screen=all or screen=1 works now because my secondary monitor isn't "on". I'll turn it back on and see what happens.

@johnhamelink
Copy link
Author

I've managed to get it to work!

I discovered that by using the "Multi-display desktop with display(s)2" setting, I have the exact same setup as before, but I don't need xinerama. This allows me to run xrandr, which sees both monitors as the same screen. Therefore, running redshift -m randr:screen=0 with redshift-git (the AUR package) fixes it for me.

drm still isn't working though, happy to help you debug that further

@maandree
Copy link
Contributor

Your system does have a file named /dev/dri/card0 right?
Parhaps its the graphics driver that is blocking it for some
reason. Could you try booting the Arch installation image
and test if Redshift works without any graphics drivers installed?

@johnhamelink
Copy link
Author

My system doesn't have a /dev/dri directory at all. I can't do that today but I'll have a look for you when I get some spare time 😄

@maandree
Copy link
Contributor

That is weird. That directory is taken directly from the libdrm headers.
Then it is probably because of drivers.

@jonls
Copy link
Owner

jonls commented Dec 16, 2014

I'm closing this for now. Please reopen with more information if the issue persists.

@jonls jonls closed this as completed Dec 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants