could not get scaling for screen

Asked by Hypnotic

Suggested solution in bug #908856 unfortunately did not solve my problem under Ubuntu 12.04 64-Bit system.

RELATED ERROR :

$ disper --version
disper 0.3.0

$ disper -p
could not get scaling for screen CRT-0, reverting to "default"
could not get scaling for screen DFP-0, reverting to "default"
unpack requires a string argument of length 4

I have got no idea how to solve this but I have tried the previously suggested solution, as here :

$ sudo gedit /usr/share/disper/src/nvidia/minx.py

def decode( binary, *arguments ):
    '''decode takes a byte stream and a variable argument list of XData
    types and returns a dict containing the decoded byte stream.
    the XData args are X type, number of elements, and the key name to
    be associated with the value. the order of arguments determines
    what order the fields will be decoded in'''

    data = binary
    rdict = {}

    for arg in arguments:
        structcode = __XFORMATS[arg.format]
        fsz = __XFORMATBYTES[arg.format]

        if not isinstance(arg.size,str):
            asz = arg.size
        else:
            asz = rdict[arg.size]

        sz = asz * fsz

# BEGIN # I ADDED THESE 2 LINES BELOW AS SUGGESTED IN BUG #908856

if sz < struct.calcsize(structcode):
sz = struct.calcsize(structcode)

# END #

        if asz == 1:
            rdict[arg.value] = struct.unpack( structcode, data[:sz] )[0]
        else:
            structcode = str(asz) + structcode
            sz = struct.calcsize(structcode)
            if arg.format.startswith('STRING8'):
                rdict[arg.value] = struct.unpack( structcode, data[:sz] )[0]
            else:
                rdict[arg.value] = struct.unpack( structcode, data[:sz] )

        data = data[sz:]

    return rdict, data

However this time I get another error here :

$ disper -p
expected an indented block (minx.py, line 129)

Lets edit it again.

$ sudo gedit /usr/share/disper/src/nvidia/minx.py

def decode( binary, *arguments ):
    '''decode takes a byte stream and a variable argument list of XData
    types and returns a dict containing the decoded byte stream.
    the XData args are X type, number of elements, and the key name to
    be associated with the value. the order of arguments determines
    what order the fields will be decoded in'''

    data = binary
    rdict = {}

    for arg in arguments:
        structcode = __XFORMATS[arg.format]
        fsz = __XFORMATBYTES[arg.format]

        if not isinstance(arg.size,str):
            asz = arg.size
        else:
            asz = rdict[arg.size]

        sz = asz * fsz

# BEGIN # I JUST ADDED SPACING PREFIX FOR EACH LINE, I DID NOT KNOW THIS WOULD BE IMPORTANT IN PYTHON

        if sz < struct.calcsize(structcode):
            sz = struct.calcsize(structcode)

# END # AND IT WORKS NOW BUT LETS CONTINUE

        if asz == 1:
            rdict[arg.value] = struct.unpack( structcode, data[:sz] )[0]
        else:
            structcode = str(asz) + structcode
            sz = struct.calcsize(structcode)
            if arg.format.startswith('STRING8'):
                rdict[arg.value] = struct.unpack( structcode, data[:sz] )[0]
            else:
                rdict[arg.value] = struct.unpack( structcode, data[:sz] )

        data = data[sz:]

    return rdict, data

Lets try again :

$ disper -p
could not get scaling for screen CRT-0, reverting to "default"
could not get scaling for screen DFP-0, reverting to "default"
backend: nvidia
associated displays: CRT-0, DFP-0
metamode: CRT-0: 1920x1080_60 @1920x1080 +0+0
scaling: default, default
xinerama info order:

$ auto-disper --save monitor
Assuming disper defaults...
Saving current configuration as profile 'monitor'
could not get scaling for screen CRT-0, reverting to "default"
could not get scaling for screen DFP-0, reverting to "default"

As you see I could solve one of the problem mentioned in bug #908856. However I am still getting error about could not get scaling for screen.

I am looking for your solutions to try.

Thanks.

Question information

Language:
English Edit question
Status:
Answered
For:
disper Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was originally filed as bug #1005627.

Revision history for this message
Hypnotic (ckubat) said :
#1

Suggested solution in bug #908856 unfortunately did not solve my problem under Ubuntu 12.04 64-Bit system.
ref : https://bugs.launchpad.net/disper/+bug/908856

RELATED ERROR :

$ disper --version
disper 0.3.0

$ disper -p
could not get scaling for screen CRT-0, reverting to "default"
could not get scaling for screen DFP-0, reverting to "default"
unpack requires a string argument of length 4

I have got no idea how to solve this but I have tried the previously suggested solution, as here :

$ sudo gedit /usr/share/disper/src/nvidia/minx.py

def decode( binary, *arguments ):
    '''decode takes a byte stream and a variable argument list of XData
    types and returns a dict containing the decoded byte stream.
    the XData args are X type, number of elements, and the key name to
    be associated with the value. the order of arguments determines
    what order the fields will be decoded in'''

    data = binary
    rdict = {}

    for arg in arguments:
        structcode = __XFORMATS[arg.format]
        fsz = __XFORMATBYTES[arg.format]

        if not isinstance(arg.size,str):
            asz = arg.size
        else:
            asz = rdict[arg.size]

        sz = asz * fsz

# BEGIN # I ADDED THESE 2 LINES BELOW AS SUGGESTED IN BUG #908856

if sz < struct.calcsize(structcode):
sz = struct.calcsize(structcode)

# END #

        if asz == 1:
            rdict[arg.value] = struct.unpack( structcode, data[:sz] )[0]
        else:
            structcode = str(asz) + structcode
            sz = struct.calcsize(structcode)
            if arg.format.startswith('STRING8'):
                rdict[arg.value] = struct.unpack( structcode, data[:sz] )[0]
            else:
                rdict[arg.value] = struct.unpack( structcode, data[:sz] )

        data = data[sz:]

    return rdict, data

However this time I get another error here :

$ disper -p
expected an indented block (minx.py, line 129)

I would really appreciate if you could help me with this ?
All I wanted to switch between my monitors automatically.

Thanks.

Revision history for this message
wvengen (wvengen) said :
#2

Hi, this message is just a warning. It means that it could not understand nvidia-settings's configuration file properly, but that has no effect on cloning or extending displays.

Revision history for this message
jugglefish (pniederlag) said :
#3

The warning is irritating though and something that just appeared with recent kernels/nvidia-drivers.
It would be nice if this warning could be suppressed or just shown in some --verbose mode.

Can you help with this problem?

Provide an answer of your own, or ask Hypnotic for more information if necessary.

To post a message you must log in.