xpra icon
Bug tracker and wiki

Opened 3 months ago

Closed 3 months ago

#2801 closed defect (fixed)

cannot import native OpenGL module (--with-opengl) when there is no sound module (--without-sound)

Reported by: mehw Owned by: Antoine Martin
Priority: minor Milestone: 4.1
Component: client Version: 4.0.x
Keywords: opengl sound Cc:

Description

Platform

OS: Gentoo
Xpra version: 4.0.2

Bug

Run setup.py with the following options:

--with-opengl --without-sound

Start both server and client on the local machine:

xpra start :7
xpra attach :7

Starting the client gives the following error:

Warning: cannot import native OpenGL module
 No module named 'xpra.sound'

Possible cause

The changeset 25991 introduced the use of the function force_enabled imported from the sound module in gl_check.py. Despite the fact that it requires one argument, it is used without when checking OpenGL. I believe that force_enable is meant to be used instead, which doesn't require to import the sound module. Hence OpenGL can be checked with no sound module.

Possible solution

diff -Nuar a/xpra/client/gl/gl_check.py b/xpra/client/gl/gl_check.py
--- a/xpra/client/gl/gl_check.py	2020-05-10 19:00:53.000000000 +0200
+++ b/xpra/client/gl/gl_check.py	2020-06-07 21:28:48.167122367 +0200
@@ -12,7 +12,6 @@
 from xpra.os_util import POSIX, OSX, bytestostr
 from xpra.log import Logger, CaptureHandler
 from xpra.client.gl.gl_drivers import WHITELIST, GREYLIST, VERSION_REQ, BLACKLIST, OpenGLFatalError
-from xpra.sound.gstreamer_util import force_enabled
 
 log = Logger("opengl")
 
@@ -130,7 +129,7 @@
         from OpenGL.GL import GL_VERSION, GL_EXTENSIONS
         from OpenGL.GL import glGetString, glGetIntegerv
         gl_version_str = glGetString(GL_VERSION)
-        if gl_version_str is None and not force_enabled:
+        if gl_version_str is None and not force_enable:
             raise_fatal_error("OpenGL version is missing - cannot continue")
             return props
         #b'4.6.0 NVIDIA 440.59' -> ['4', '6', '0 NVIDIA...']
@@ -147,7 +146,7 @@
             props["opengl"] = gl_major, gl_minor
             MIN_VERSION = (1,1)
             if (gl_major, gl_minor) < MIN_VERSION:
-                if not force_enabled:
+                if not force_enable:
                     raise_fatal_error("OpenGL output requires version %s or greater, not %s.%s" %
                                   (".".join([str(x) for x in MIN_VERSION]), gl_major, gl_minor))
                     return props

Attachments (1)

xpra-4.0-sound-module.patch (2.1 KB) - added by mehw 3 months ago.
proposed patch

Download all attachments as: .zip

Change History (2)

Changed 3 months ago by mehw

Attachment: xpra-4.0-sound-module.patch added

proposed patch

comment:1 Changed 3 months ago by Antoine Martin

Resolution: fixed
Status: newclosed

Thanks, fixed in r26640.

Note: See TracTickets for help on using tickets.