You are not logged in.

#1 2012-12-30 15:46:03

NougatRillettes
Member
From: Paris/France
Registered: 2012-12-30
Posts: 3

[SOLVED] X-Autostart, Auto-log-in and DBus : a non-pulseaudio issue

Hello,

besides the not-so-clear title, I've been investigating for what first looked like a pulseaudio problem for a while, and I'm now sharing what I found with you :

Pre-existing conditions

An Arch system with systemd, auto-loggin on a TTY and auto-start of X

Symptoms

Pulseaudio wouldn't start anymore at boot, but everything worked fine if it was started a while after, provided one would have sudo killall -9 pulseaudio before, and there was no major upgrade that could be related to this change.

Journalctl showed dbus related messages, saying that pulse wasn't able to find it, and a general failure in main.c start.

Solution

Actually, a part of the boot process was the following :

            |-----> lots of things, and at a point dbus
Init --> |
            |-----> auto-logging service (getty stuff) -----> .xinitrc ------> pulseaudio

and there was no guarantee that dbus was already started when pulse audio was.

To add this guarantee, edit your autologging service and add the following

[Unit]
... your stuff ...

#lines to add :
Requires=dbus.Service #I'm not sure this one is needed, if anyone here can confirm it
After=dbus.Service
##

..rest of the file..

reboot, and enjoy smile

Last edited by NougatRillettes (2012-12-30 16:05:02)

Offline

#2 2013-01-04 02:52:35

geekmiki
Member
Registered: 2011-10-10
Posts: 72

Re: [SOLVED] X-Autostart, Auto-log-in and DBus : a non-pulseaudio issue

Hi,

Pulseaudio is not starting on my machine since I removed Slim and started lauching X after login with startx.
With any DM, Pulseaudio works fine and is started automatically.

If I start Pulseaudio manually after X is launched everything's fine.

I tried adding the lines you mentioned to

/etc/systemd/system/getty.target.wants/getty\@tty1.service 

with no luck.

Is there anything I can do to have pulseaudio starting when X is launched?

Here's .xinitrc in case it might give a hint:

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

xset s off

setxkbmap fr

xset +fp /usr/share/fonts/local
xset fp rehash

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

exec startxfce4

Thank you in advance!

Last edited by geekmiki (2013-01-04 12:30:39)

Offline

#3 2013-11-06 21:57:08

bpont
Banned
Registered: 2010-03-24
Posts: 161

Re: [SOLVED] X-Autostart, Auto-log-in and DBus : a non-pulseaudio issue

I know this is an older post, but I'm hoping by bumping it someone will be able to help me with this issue even though the thread is marked as [SOLVED], so that I won't have to create a new post.

I'm trying to set up a host to autologin a user, then automatically startx to enter a desktop environment.  I am using these guides:

https://wiki.archlinux.org/index.php/au … al_console

https://wiki.archlinux.org/index.php/Start_X_at_Login

I haven't yet set up the startx at login, but I've done that before, so I don't expect any issues or problems.

I successfully set up autologin using the first link and everything seemed fine.  However, on the startx at login wiki, it states:

Tips

This method can be combined with automatic login to virtual console. When doing this you have to set correct dependencies for the autologin systemd service to ensure that dbus is started before ~/.xinitrc is read and hence pulseaudio started (see: BBS#155416)

I don't have pulseaudio issues to worry about, but I do have an exec line to start lxde.  So, I followed that link to this thread and created the lines NougatRillettes suggested.  Here's the complete file:

/etc/systemd/system/getty@tty1.service.d/autologin.conf

[Unit]
Requires=dbus.Service
After=dbus.Service

[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin <username> --noclear %I 38400 linux

Then, when I reboot the kernel spits this out:

Nov 06 14:39:23 [Host] systemd[1]: Set hostname to <[Host]>.
Nov 06 14:39:23 [Host] systemd[1]: [/etc/systemd/system/getty@tty1.service.d/autologin.conf:2] Failed to add dependency on dbus.Service, ignoring: Invalid argument
Nov 06 14:39:23 [Host] systemd[1]: [/etc/systemd/system/getty@tty1.service.d/autologin.conf:3] Failed to add dependency on dbus.Service, ignoring: Invalid argument
Nov 06 14:39:23 [Host] systemd[1]: Cannot add dependency job for unit display-manager.service, ignoring: Unit display-manager.service failed to load: No such file or directory.

I rechecked the wikis and noticed:

Tips & Tricks

Avoiding unnecessary dmesg errors
To avoid errors related to display-manager.service in dmesg, you should set the default target to multi-user instead of graphical:
# systemctl enable multi-user.target

So I went ahead and enabled multi-user.target and rebooted, thinking that would solve the problem, but it didn't...the error messages were the same.

I'm hoping someone can help...and maybe update those two wikis if there's any information missing.  I'm also wondering if I should reverse the last step I described by disabling multi-user.target.

Offline

#4 2013-11-06 22:03:48

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] X-Autostart, Auto-log-in and DBus : a non-pulseaudio issue

Have you tried using just

[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin <username> --noclear %I 38400 linux

Offline

#5 2013-11-06 22:12:56

bpont
Banned
Registered: 2010-03-24
Posts: 161

Re: [SOLVED] X-Autostart, Auto-log-in and DBus : a non-pulseaudio issue

karol wrote:

Have you tried using just

[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin <username> --noclear %I 38400 linux

Yes, I did.  That was my original configuration when I first tested it and it went fine.  I only added the [Unit] entries after rechecking the wikis and thinking that I needed to add those lines so that dbus.Service would start before "exec startlxde" in ~/.xinitrc.  I haven't yet set up the automatic startx part yet because of the error messages I described.  I was assuming I needed to add those lines because of the way I interpreted the advice in the wikis.

Offline

#6 2013-11-06 22:16:57

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] X-Autostart, Auto-log-in and DBus : a non-pulseaudio issue

Try using just https://bbs.archlinux.org/viewtopic.php … 8#p1346578 , add whatever you need to make X start automatically.

Offline

#7 2013-11-06 22:19:51

bpont
Banned
Registered: 2010-03-24
Posts: 161

Re: [SOLVED] X-Autostart, Auto-log-in and DBus : a non-pulseaudio issue

karol wrote:

Try using just https://bbs.archlinux.org/viewtopic.php … 8#p1346578 , add whatever you need to make X start automatically.

OK, I'll try it...I guess the last question is whether I should disable multi-user.target since I only enabled it on the advice of the wiki, but I'm not sure if it really applies to this issue.

Edit: I will keep multi-user.target enabled since I'm not using a display manager, but booting directly into a user X session after an autologin at a virtual console.

In summary, I've removed the [Unit] section posted above, kept the [Service] section, enabled multi-user.target and made the necessary edits to ~/.bash_profile per wiki and have successfully booted, autologin and startx into an lxde environment.

Last edited by bpont (2013-11-06 22:53:12)

Offline

Board footer

Powered by FluxBB