[prev in list] [next in list] [prev in thread] [next in thread] 

List:       qubes-devel
Subject:    Re: [qubes-devel] Audio broken in archlinux template
From:       Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek () invisiblethingslab ! com>
Date:       2015-11-06 17:08:40
Message-ID: 20151106170840.GG877 () mail-itl
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Fri, Nov 06, 2015 at 05:28:12PM +0100, Olivier Médoc wrote:
> On 11/06/2015 05:16 PM, Marek Marczykowski-Górecki wrote:
> > On Fri, Nov 06, 2015 at 04:56:07PM +0100, 'Olivier Médoc' via
> > qubes-devel wrote:
> > > On 11/05/2015 11:58 AM, Marek Marczykowski-Górecki wrote:
> > > > On Thu, Nov 05, 2015 at 10:12:38AM +0100, 'Olivier Médoc' via
> > > > qubes-devel wrote:
> > > > > Hello,
> > > > 
> > > > > Audio is broken in my last update of the template agents. Do you have
> > > > > some tips to debug this ?
> > > > 
> > > > > qubes-vm-gui is version 3.1.1, compiled with pulseaudio 7.0.
> > > > 
> > > > > I have the following logs:
> > > > > E: [pulseaudio] main.c: Daemon startup failed.
> > > > 
> > > > > As shown in the following trace, pulseaudio respawn automatically:
> > > > 
> > > > > [user@personal ~]$ ps -aeux | grep pulse
> > > > > user      1062  0.1  0.2 336904  7876 ?        S<sl 10:03   0:00
> > > > > /usr/bin/pulseaudio --daemonize=no
> > > > > DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus DISPLAY=:0
> > > > > HOME=/home/user LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 LOGNAME=user
> > > > > MAIL=/var/spool/mail/user
> > > > > PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin SHELL=/bin/zsh
> > > > > USER=user XDG_RUNTIME_DIR=/run/user/1000 MANAGERPID=420
> > LISTEN_PID=1062
> > > > > LISTEN_FDS=1 LISTEN_FDNAMES=pulseaudio.socket LD_BIND_NOW=1
> > > > > [user@personal ~]$ pulseaudio -k
> > > > > [user@personal ~]$ ps -aeux | grep pulse
> > > > > user      1072  2.0  0.2 336780  7860 ?        S<sl 10:04   0:00
> > > > > /usr/bin/pulseaudio --daemonize=no
> > > > > DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus DISPLAY=:0
> > > > > HOME=/home/user LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 LOGNAME=user
> > > > > MAIL=/var/spool/mail/user
> > > > > PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin SHELL=/bin/zsh
> > > > > USER=user XDG_RUNTIME_DIR=/run/user/1000 MANAGERPID=420
> > LISTEN_PID=1072
> > > > > LISTEN_FDS=1 LISTEN_FDNAMES=pulseaudio.socket LD_BIND_NOW=1
> > > > 
> > > > > It does not look as the qubes pulseaudio daemon because the qubes
> > > > > specific config file is not present in the parameters.
> > > > 
> > > > > If I check /etc/xdg/autostart/pulseaudio.desktop, I see:
> > > > > Exec=start-pulseaudio-x11
> > > > > Terminal=false
> > > > > Type=Application
> > > > > Categories=
> > > > > GenericName=
> > > > > X-GNOME-Autostart-Phase=Initialization
> > > > > X-KDE-autostart-phase=1
> > > > > NotShowIn=QUBES;
> > > > 
> > > > > Shouldn't it be NotShownIn=X-QUBES; instead ? Is there a problem
> > in the
> > > > > install script of the new agent that use X-QUBES ?
> > > > 
> > > > It shouldn't matter, because this option will be overridden by:
> > > > /etc/qubes/autostart/pulseaudio.desktop.d/30_qubes.conf
> > 
> > > Hello,
> > 
> > > I found that several services are now using socket activation on
> > > archlinux, including pulseaudio. This makes finding who starts which
> > > service very hard. For instance for pulseaudio, there is two files:
> > > $ cat /usr/lib/systemd/user/pulseaudio.service
> > > [Unit]
> > > Description=Sound Service
> > 
> > > [Service]
> > > ExecStart=/usr/bin/pulseaudio --daemonize=no
> > > Restart=on-failure
> > 
> > > [Install]
> > > Also=pulseaudio.socket
> > > WantedBy=default.target
> > 
> > > $ cat /usr/lib/systemd/user/pulseaudio.socket
> > > [Unit]
> > > Description=Sound System
> > 
> > > [Socket]
> > > Priority=6
> > > Backlog=5
> > > ListenStream=%t/pulse/native
> > 
> > > [Install]
> > > WantedBy=sockets.target
> > 
> > > Note that the files are in /usr/lib/systemd/user/, so I cannot see it
> > > when running systemctl status pulseaudio.service. The configuration of
> > > pulseaudio.service also explains why pulseaudio autorespawn.
> > 
> > > Here are the notes coming from archlinux wiki:
> > > To disable pulseaudio.socket, make sure that
> > > $XDG_CONFIG_HOME/systemd/user/ exists and run systemctl --user mask
> > > pulseaudio.socket.
> > > Many desktop environments autostart programs based on desktop files
> > > in the /etc/xdg/autostart/ directory. In this case, PulseAudio will be
> > > launched automatically regardless of the socket activation status.
> > 
> > > It should be noted that socket activation completely bypass xdg
> > > autostart system as the services will be started very early when using
> > > socket activation (xdg autostart will then probably fail if the service
> > > is already running).
> > 
> > Ok, so I think we should simply disable that pulseaudio.socket on Qubes.
> > Either by adding "disable pulseaudio.socket" to some preset file (is
> > there something like this for systemd user instance?), or add a dropin
> > in /usr/lib/systemd/user/pulseaudio.socket.d/30_qubes.conf with
> > something like:
> > [Unit]
> > ConditionNull=false
> > 
> > Personally I like the second approach.
> > 
> Same here, masking, manipulating configuration files, or using package
> installation scripts for that is too error prone, less effective, and
> less clear than using the droppins.
> 
> Now, the .socket concept should probably be used in Qubes as it
> apparently speedup greatly starting time and also makes things more
> reliable by restarting services that crashes, without actually loosing
> messages.
> 
> http://0pointer.de/blog/projects/socket-activation.html
> 
> For instance, pulseaudio support this since version 7.0.

Yes, this may be an option. As for restarting - in case of pulseaudio it
would require also restarting pacat (dom0 counterpart), which currently
exits when the connection is terminated. But something doable of course.
If you want, create github issue for that ;)

> 
> P.S. I try dropins in /usr/lib/systemd/user/ and push my changes if it
> works (I hope that is the only problem I have).

- -- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBCAAGBQJWPN6ZAAoJENuP0xzK19csH4YH/3AYaJfecaTkXSdsi3+UMWL4
p27miZcEw/BKhnn3CYnSHbE1XAJjtAo5YOC9VVIpgY6462s+LaW6rHQvJEx2UMNR
ljJv/ZKrI6Rzb6B8SOe0zxq0D+bRi2si92vE5ewDa+fhEesYC1pZzImDI65zxnUk
4RRpWHjn0H4qhMulFscCzHUDngXX0oaTEVLPZ8K0LO58J9Aw2hB+gfaKUPRh/A2k
d5ikgNNxCmFmMcCmmc7RzLenltKhAdw5pT9hnyFC4bDNqtLdOvkvR6vYKr4LeEA8
vlXYipX+EFL/w4gfKKhWbtT8K+lZFBcSwbW0KM+PTaBIoQyHn9kRAbak45FUzcs=
=IabL
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups \
"qubes-devel" group. To unsubscribe from this group and stop receiving emails from \
it, send an email to qubes-devel+unsubscribe@googlegroups.com. To post to this group, \
send email to qubes-devel@googlegroups.com. To view this discussion on the web visit \
https://groups.google.com/d/msgid/qubes-devel/20151106170840.GG877%40mail-itl. For \
more options, visit https://groups.google.com/d/optout.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic