xpra icon
Bug tracker and wiki

Opened 12 days ago

Last modified 5 days ago

#2142 new defect

AvCodec Error -22

Reported by: Devyn Collier Johnson Owned by: Devyn Collier Johnson
Priority: major Milestone: 2.5
Component: server Version: 2.4.x
Keywords: avcodec, h264 Cc:

Description (last modified by Antoine Martin)

I have built Xpra from the Subversion repository source (tag v2.4.x) since the package in default Ubuntu repository and the WinSwitch? repository ( https://winswitch.org/downloads/debian-repository.html?dist_select=cosmic ) both appear to have a "tjcompress2 error -2" during the initial start-up of the server.

In the attached file, I include the error message, the build commands I used, and the output of xpra showconfig.

When running an Xpra server using the below command, an avcodec error -22 message is given when I try to launch the Xpra GUI-client. Prior to launching the client, the HTML5 interface would never load (I just get "Unable to connect" in Firefox). I am needing to use the HTML5 interface as seen here - https://www.xpra.org/trac/wiki/Clients/HTML5). I have installed all of the dependencies available in Ubuntu for both building and running Xpra.

xpra start :37 --start=gnome-mines --html=on --systemd-run=no --start-via-proxy=no --tcp-auth=file:filename=/home/collier/xpra_pswd.txt --bind-tcp=0.0.0.0:13700 --encoding=x264 --csc-modules=swscale --compress=1 --uid=1000 −−mmap−group=auto

I have also used the below environment variables as suggested in other bug reports relating to the h264 codec.

export XPRA_B_FRAMES=0
export XPRA_X264_THREADS=4
export XPRA_X264_SLICED_THREADS=0

Attachments (4)

Xpra_Error_Log.txt (19.1 KB) - added by Devyn Collier Johnson 12 days ago.
Xpra Error Log and Info
Xpra_Error_Log.2.txt (32.4 KB) - added by Devyn Collier Johnson 11 days ago.
Xpra Error Log 2
xpra.log (354.4 KB) - added by Devyn Collier Johnson 11 days ago.
Xpra X11 Log
Xpra_Log_Fresh_Install.txt (13.4 KB) - added by Devyn Collier Johnson 6 days ago.
Fresh Installation Log

Download all attachments as: .zip

Change History (12)

Changed 12 days ago by Devyn Collier Johnson

Attachment: Xpra_Error_Log.txt added

Xpra Error Log and Info

comment:1 Changed 12 days ago by Antoine Martin

Description: modified (diff)
Owner: changed from Antoine Martin to Devyn Collier Johnson

FYI:

  • --html=on the html5 client should be enabled by default if everything is installed correctly
  • systemd-run=no should default to no on versions of Ubuntu that are known to be broken
  • start-via-proxy=no already defaults to no
  • --encoding=x264 - don't do that
  • csc-modules=swscale - since you're not building other csc modules, this doesn't do anything
  • compress=1 - should already be the default, strangely enough your xpra showconfig shows a different value..
  • uid=1000 unless you are running as root, this doesn't do anything
  • mmap−group=auto - should already be the default

So AFAICT, your command line should just be:

xpra start :37 --start=gnome-mines \
   --tcp-auth=file:filename=/home/collier/xpra_pswd.txt --bind-tcp=0.0.0.0:13700

There are separate issues in this ticket.
(from the log, you seem to be running Ubuntu 18.10)

tjcompress2 error -2 during the initial start-up of the server.

Please post the full error message.
This is from the turbo jpeg encoder. and this is not normal, and it does not occur on a standard installation of Ubuntu 18.10.
Maybe start again with a clean installation?

avcodec error -22 message is given when I try to launch the Xpra GUI client

What command? Just xpra?
Please post the output of ./xpra/codecs/loader.py -v.
Please post: dpkg --list | egrep -i "ffmepg|xpra|dummy".

Prior to launching the client, the HTML5 interface would never load

I'm not sure I understand what that means: does launching the client somehow fix the HTML5 client?
Make sure your firewall isn't blocking that port. Make sure websockify is installed.
If that doesn't help, run your server with -d websockify,http and post the log file.
Or you may want to try the beta channel, which has big improvements to the websocket layer, which also makes it easier to deploy (#2121).

I have also used the below environment variables as suggested in other bug reports relating to the h264 codec.
(..)

You should not be fiddling with those settings, if the html5 client is not connecting, they won't make any difference at all.

comment:2 Changed 11 days ago by Devyn Collier Johnson

I attached two log files. The one contains the output of the requested commands appended to the bottom the the initial file that I uploaded.

You are correct, I am running Ubuntu 18.10 (Cosmic).

The purpose of running the command "xpra" is to try to connect to the running session via the GUI since the web-interface did not appear to be working. This was a way of checking if it is just the web-interface that was down or all of the Xpra server. As for the results, the GUI client would report "No sessions found".

The error that appears when installing from the repositories is seen below.

Error: failed to compress jpeg image, code -2:
tjCompress2(): Invalid argument
 width=32, stride=128, height=32
 format=BGRA, quality=0
Error: failed to compress jpeg image, code -2:
tjCompress2(): Invalid argument
 width=32, stride=128, height=32
 format=BGRA, quality=50
Error: failed to compress jpeg image, code -2:
tjCompress2(): Invalid argument
 width=32, stride=128, height=32
 format=BGRA, quality=100

I also got the version information concerning libTurbo.

collier@Nacho-Computer:~$ dpkg --list | egrep -i 'turbo'
ii  libjpeg-turbo-progs                        2.0.0-0ubuntu2                                amd64        Programs for manipulating JPEG files
ii  libjpeg-turbo8:amd64                       2.0.0-0ubuntu2                                amd64        IJG JPEG compliant runtime library.
ii  libjpeg-turbo8-dev:amd64                   2.0.0-0ubuntu2                                amd64        Development files for the IJG JPEG library
ii  libturbojpeg:amd64                         2.0.0-0ubuntu2                                amd64        IJG JPEG compliant runtime library.
ii  libturbojpeg0-dev:amd64                    2.0.0-0ubuntu2                                amd64        Development files for the TurboJPEG library

As for your comment regarding the environment variables. True, you have a good point. The only reason I tried that was due to trying as many possibilities since with many bug reports I have filed in the past (with other projects), the developers would often times have me try solutions to slightly off-topic issues. Since I have never filed a report with Xpra, I wanted to be sure and get any off-topic solutions out of the way (yes, it sounds illogical, but I have often times dealt with illogical people).

After looking at the output of running Xpra with -d websockify,http, I noticed the line 2019-02-10 18:39:02,042 init_html_proxy(..) options: tcp_proxy=, html='yes' with the empty tcp_proxy parameter. Does the Xpra HTML5 interface require a proxy?

As for trying the beta channel, how stable is the beta version of Xpra? I am needing something stable and reliable (although, an unstable version of Xpra would be better than a non-working version of Xpra, right? 😉)

Changed 11 days ago by Devyn Collier Johnson

Attachment: Xpra_Error_Log.2.txt added

Xpra Error Log 2

Changed 11 days ago by Devyn Collier Johnson

Attachment: xpra.log added

Xpra X11 Log

comment:3 Changed 11 days ago by Antoine Martin

TILs:

xpra start :37 -d websockify,http --start=gnome-mines --tcp-auth=file:filename=/home/collier/xpra_pswd.txt --bind-tcp=0.0.0.0:13700
(..)	serving html content from: /usr/local/share/xpra/www

All you need to do at this point is to run: xdg-open http://localhost:13700/connect.html.
Keep an eye on the server log, just in case.
If the browser does not connect, you have a firewall problem.

As for the codec issues, this does not happen with a clean installation of xpra on a standard Ubuntu system, so either re-install both or at least remove the xpra package before installing from source.

As for trying the beta channel, how stable is the beta version of Xpra?

It should be stable, but being a beta channel, things do break occasionally.

Last edited 11 days ago by Antoine Martin (previous) (diff)

comment:4 Changed 6 days ago by Devyn Collier Johnson

I tried running Xpra on a fresh installation of the codecs and Xpra itself (all from the default Ubuntu repos). I also explicitly allowed the port 13700 to both TCP and UDP. The HTML5 interface still fails to work. If I run xpra list to see the list of running sessions, the session is listed as "UNKNOWN" and is cleaned-up.

I attached the logs.

Changed 6 days ago by Devyn Collier Johnson

Attachment: Xpra_Log_Fresh_Install.txt added

Fresh Installation Log

comment:5 Changed 6 days ago by Antoine Martin

Your session must be taking forever to launch - could be caused by #2091. Is this an underpowered CPU?
You ran "xpra list" before the server had finished starting up, so "xpra list" ended up cleaning up the sockets.
Try to run the server with "--no-daemon" and wait until the server output prints "xpra is ready".

Last edited 6 days ago by Antoine Martin (previous) (diff)

comment:6 Changed 6 days ago by Antoine Martin

Also note that there are no codec errors in the logs.
You can check that manually by running ./xpra/codecs/loader.py -v.

comment:7 Changed 5 days ago by Devyn Collier Johnson

The CPU is not under-powered. My system has an 8700K Intel processor (Coffeelake) with six physical cores + six virtual cores and an Nvidia 1080 GPU. My system has 32GB of RAM.

By using the --no-daemon parameter, I was able to see that Xpra is having a segmentation fault on a clean installation from the default Ubuntu repositories.

collier@Nacho-Computer:~$ xpra start :35 --no-daemon --start=gnome-mines --tcp-auth=file:filename=/home/collier/xpra_pswd.txt --bind-tcp=0.0.0.0:13700 --html=on
2019-02-16 09:00:55,915 cannot use uinput for virtual devices:
2019-02-16 09:00:55,915  [Errno 13] Failed to open the uinput device: Permission denied
[mi] Extension "Composite" is not recognized
[mi] Only the following extensions can be run-time enabled:
[mi]    Generic Event Extension
[mi]    MIT-SHM
[mi]    XTEST
[mi]    SECURITY
[mi]    XINERAMA
[mi]    XFIXES
[mi]    RENDER
[mi]    RANDR
[mi]    COMPOSITE
[mi]    DAMAGE
[mi]    MIT-SCREEN-SAVER
[mi]    DOUBLE-BUFFER
[mi]    RECORD
[mi]    DPMS
[mi]    X-Resource
[mi]    XVideo
[mi]    XVideo-MotionCompensation
[mi]    SELinux
[mi]    GLX
2019-02-16 09:00:56,022 created unix domain socket: /run/user/1000/xpra/Nacho-Computer-35
2019-02-16 09:00:56,022 created unix domain socket: /run/xpra/Nacho-Computer-35
2019-02-16 09:00:56,120 pointer device emulation using XTest
2019-02-16 09:00:56,993  OpenGL is supported on this display
WARNING: no 'numpy' module, HyBi protocol will be slower
2019-02-16 09:00:57,030 serving html content from: /usr/local/share/xpra/www
2019-02-16 09:00:57,111 D-Bus notification forwarding is available
2019-02-16 09:00:57,246 found 1 virtual video device for webcam forwarding
2019-02-16 09:00:57,256 pulseaudio server started with pid 10644
2019-02-16 09:00:57,256  private server socket path:
2019-02-16 09:00:57,256  '/run/user/1000/xpra/pulse-35/pulse/native'
2019-02-16 09:00:58,147 GStreamer version 1.14.4 for Python 2.7.15 64-bit
Segmentation fault

comment:8 Changed 5 days ago by Antoine Martin

By using the --no-daemon parameter, I was able to see that Xpra is having a segmentation fault on a clean installation from the default Ubuntu repositories.

I find that a little bit hard to believe seeing that I did a clean install test as part of testing for comment:3.
To diagnose those types of crashes:

  • run the server with -d all
  • run xpra in gdb to get a backtrace
Note: See TracTickets for help on using tickets.