Subject: Bug#1155: Volume levels are not saved with TCE

From: Walid MOGHRABI <[email-masked]>
Date: Mon, 13 Mar 2017 11:43:38 +0100 (CET)

Package: x2gothinclient 
Version: 1.5.0.0

When my TCE users logs in their session, they have to set their audio volume levels everytime.
Their settings are not saved when they log off their session.

Here are the components versions on the TCE side :

root@tce-netboot-01:/# dpkg -l | grep x2go
ii  libssh-4:i386                        0.5.4-2~deb7+x2go2                           i386         tiny C SSH library
ii  libxcomp3:i386                       2:3.5.0.33-0x2go1~git20160710.753+7.heuler.1 i386         nx-X11 compression library
ii  nxproxy                              2:3.5.0.33-0x2go1~git20160710.753+7.heuler.1 i386         NX proxy
ii  pinentry-x2go                        0.7.5.10-0x2go1~git20161116.106+7.heuler.1   i386         Qt4-based PIN or pass-phrase entry dialog for x2goclient
ii  x2go-keyring                         2012.07.23+wheezy~main~17~build1             all          GnuPG keys of all X2Go developers and the X2Go archive
ii  x2goclient                           4.0.5.3-0x2go1~git20161225.1231+7.heuler.1   i386         X2Go Client application (Qt4)
ii  x2gothinclient                       1.5.0.0-0x2go1~git20161013.618+7.heuler.1    all          temporary dependency package for migration to x2gothinclient-displaymanager
ii  x2gothinclient-chroot                1.5.0.0-0x2go1~git20161013.618+7.heuler.1    all          Install X2Go Thin Client chroot (metapackage)
ii  x2gothinclient-common                1.5.0.0-0x2go1~git20161013.618+7.heuler.1    all          X2Go thin client environment (common files)
ii  x2gothinclient-displaymanager        1.5.0.0-0x2go1~git20161013.618+7.heuler.1    all          login daemon starting x2goclient in displaymanager mode
ii  x2gothinclient-smartcardrules        1.5.0.0-0x2go1~git20161013.618+7.heuler.1    all          UDEV rules for smartcard readers

And on the server side :

root@tce-server-01 [~] # dpkg -l | grep x2go                                                                                                                                                                   11:40
ii  libx2go-log-perl                      4.1.0.0-0~1407~ubuntu16.04.1               all          Perl X2Go::Log package
ii  libx2go-server-db-perl                4.1.0.0-0~1407~ubuntu16.04.1               amd64        Perl X2Go::Server:DB package
ii  libx2go-server-perl                   4.1.0.0-0~1407~ubuntu16.04.1               all          Perl X2Go::Server package
ii  x2gobroker-agent                      0.0.3.3-0~944~ubuntu16.04.1                amd64        X2Go Session Broker (remote agent)
ii  x2gomatebindings                      0.0.1.5-0~199~ubuntu16.04.1                amd64        X2Go MATE bindings and MIME types
ii  x2goserver                            4.1.0.0-0~1407~ubuntu16.04.1               amd64        X2Go server daemon scripts
ii  x2goserver-common                     4.1.0.0-0~1407~ubuntu16.04.1               amd64        X2Go Server (common files)
ii  x2goserver-extensions                 4.1.0.0-0~1407~ubuntu16.04.1               all          X2Go Server (extension support)
ii  x2goserver-fmbindings                 4.1.0.0-0~1407~ubuntu16.04.1               all          X2Go Server (file manager bindings)
ii  x2goserver-printing                   4.1.0.0-0~1407~ubuntu16.04.1               all          X2Go server (printing support)
ii  x2goserver-x2goagent                  4.1.0.0-0~1407~ubuntu16.04.1               all          X2Go Server's X2Go Agent
ii  x2goserver-xsession                   4.1.0.0-0~1407~ubuntu16.04.1               all          X2Go Server (Xsession runner)

Regards,
Walid Moghrabi

TRAVAUX.COM
BAT I - PARC CEZANNE 2 290 AVENUE GALILEE - CS 80403
13591 AIX EN PROVENCE CEDEX 3
---
DISCLAIMER: This e-mail is private and confidential and may contain proprietary or legally privileged information. It is for the intended recipient only. If you have received this email in error, please notify the author by replying to it and then destroy it. If you are not the intended recipient you must not use, disclose, distribute, copy, print or rely on this e-mail or any attachment. Thank you

---

From: Stefan Baur <[email-masked]>
Date: Mon, 27 Mar 2017 23:21:10 +0200

> Their settings are not saved when they log off their session.

Where would you expect the setting to be saved?
The Client is a RAM disk, so once you reboot, all settings are reset to
their default values.
If you want to adjust client-side audio volume, you'd have to adjust the
volume on each startup using, say, amixer in a startup script that you
splice into the thinclient boot process.  If anything, I would use that
to set the audio volume to maximum for all ThinClients.

The only volume controls available to the user come from the server,
once the session is running.  Saving those settings SHOULD be the task
of the selected Desktop Environment.
It would be interesting to know if you're also losing the settings when
you log in using a non-ThinClient computer that has X2GoClient installed.

-Stefan

-- 
BAUR-ITCS UG (haftungsbeschränkt)
Geschäftsführer: Stefan Baur
Eichenäckerweg 10, 89081 Ulm | Registergericht Ulm, HRB 724364
Fon/Fax 0731 40 34 66-36/-35 | USt-IdNr.: DE268653243

---

From: Walid MOGHRABI <[email-masked]>
Date: Tue, 28 Mar 2017 09:41:15 +0200 (CEST)

Well, I would like the settings to be saved inside the X2Go session then restored from there.
I know TCEs are read only (or volatile) so you can't save the client settings there and then get them back from there.
>From a local client with X2Go client installed, it works of course since it relies on the local settings that can be saved in this situation.
But thinclient mode is a bit different and I suppose there should be a way to :

    1) save the volume levels at the X2Go session level when closing the session (maybe something that can be done through a logout script or the x2gocleansession process)
    2) retrieve the volume levels from the X2Go session and use it to set the local pulseaudio settings (probably through geting values from saved settings through SSH at connection time)

This could be activated only in --thinclient mode so that, normal X2Goclient behaviour could keep on using the local pulseaudio settings and not geting the ones from the X2Go session.

Regards,
Walid Moghrabi

TRAVAUX.COM

----- Mail original ----- 

De: "Stefan Baur" <[email-masked]> 
À: "Walid MOGHRABI" <[email-masked]>, [email-masked] 
Envoyé: Lundi 27 Mars 2017 23:21:10 
Objet: Re: [X2Go-Dev] Bug#1155: Volume levels are not saved with TCE 

-Stefan

---

From: Stefan Baur <[email-masked]>
Date: Tue, 28 Mar 2017 12:45:49 +0200

Walid,

something seems to be wrong with your DE setup.

I must admit, I was confused as well - I believed local and remote
volume controls are totally independent; they are not.

The way I tested things was:
- Boot TC.
- Log in on TC console as user, become root
- apt-get update && apt-get install alsa-utils on TC
- run alsamixer on TC -> Notice how both Master and PCM are at 0.
- chvt 7
- Log in to an X2Go session -> Notice how startup sound plays
- switch back to console where alsamixer runs
  -> Notice Master is now at 100
  -> Notice PCM is at the same value as set inside X2Go session
- Move the volume slider in the X2Go session up and down
  -> Notice PCM volume in alsamixer move along
- Disconnect and reconnect session
  -> Notice volume slider in X2Go session is at the value that was
     last set
  -> same goes for terminating the session and starting a new one
  -> same goes for rebooting the TC before reconnecting

So, whatever volume setting I choose in the X2Go session *is* saved and
restored upon reconnect, because the DE I chose (Trinity) is behaving
correctly.

Seems to be a bug with your particular DE, not with X2Go.

-Stefan

---

From: Walid MOGHRABI <[email-masked]>
Date: Tue, 28 Mar 2017 13:06:19 +0200 (CEST)

My DE is MATE 1.12.1 (Ubuntu 16.04 based).
This is not the default ubuntu-mate-desktop meta package but a custom lightweight MATE install with individuals packages selected.
Maybe I missed a needed package but which one ?

Regards,
Walid Moghrabi

TRAVAUX.COM

----- Mail original ----- 

De: "Stefan Baur" <[email-masked]> 
À: "Walid MOGHRABI" <[email-masked]> 
Cc: [email-masked] 
Envoyé: Mardi 28 Mars 2017 12:45:49 
Objet: Re: [X2Go-Dev] Bug#1155: Volume levels are not saved with TCE 

Walid, 

-Stefan

---

From: Stefan Baur <[email-masked]>
Date: Tue, 28 Mar 2017 13:45:47 +0200

> Maybe I missed a needed package but which one ?

I'm anything but a MATE or PulseAudio expert, but googling for

mate pulseaudio save and restore volume level

returned this link:

<https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#index3h2>

and a pointer to look at the output of the command:
pacmd list-modules

- maybe you can track down the issue with your MATE installation like that?

Kind Regards,
Stefan Baur

---

From: Mihai Moldovan <[email-masked]>
Date: Tue, 28 Mar 2017 14:19:12 +0200

> This could be activated only in --thinclient mode so that, normal X2Goclient behaviour could keep on using the local pulseaudio settings and not geting the ones from the X2Go session.

That's not really something we want to do, because the volume we talk about here
is a client-side setting.

In a simple setup where only one client machine ever connects to one session,
and that client machine never changes, that might work, but in any more
complicated setup it's a recipe for doom.

Further, given that I know your setup a little bit, saving or restoring settings
would not work as expected when for instance additional headsets are *not*
plugged in while the session is established but later on.

x2ogcleansessions is a totally wrong approach for stuff like that, because
saving the settings must be done while the client is still connected (since we
need to access the client-side PA daemon.)

If anything, you could use x2goserver's hooks infrastructure, but I'm not sure
in what context these scripts are executed. If it's any context that doesn't
inherit environment variables from the client, that's not going to work. The
pre-suspend/pre-terminate and post-resume/post-scripts hooks (check
/usr/lib/x2go/extensions) might be promising places for something like that.

Again, as a general feature that's probably causing more trouble than it's
worth, especially when using multiple sessions at a time or when changing
client-side stuff.

Mihai