Hi,
I'm currently working on a virtualization project using F18. One of the use cases is booting on the multi-user systemd target, then starting the Spice client in a very restricted X environment by simply issuing
*$ xinit /usr/bin/spicec (some parameters)*
Everything works fine, except the sound : as I don't start a complete GDM in this boot scenario, PulseAudio isn't loaded. I thus tried to start PulseAudio manually by issuing :
*$ start-pulseaudio-x11*
before starting xinit with the same user, but it doesn't work either. After testing a *$ pacat /dev/urandom* from the host on Fedora Virtualization team's advice, it turns out PA doesn't work at all.
*So, here is my question : how to start PulseAudio correctly in such a setup (multi-user.target then xinit) ?*
Please note that if I connect to the VM from a complete GDM in the graphical systemd target, everything works fine.
Thank you for your attention !
Regards,
Eric Viseur
Am 09.07.2013 16:01, schrieb Eric Viseur:
I'm currently working on a virtualization project using F18. One of the use cases is booting on the multi-user systemd target, then starting the Spice client in a very restricted X environment by simply issuing
/$ xinit /usr/bin/spicec (some parameters)/
Everything works fine, except the sound : as I don't start a complete GDM in this boot scenario, PulseAudio isn't loaded. I thus tried to start PulseAudio manually by issuing :
/$ start-pulseaudio-x11/
before starting xinit with the same user, but it doesn't work either. After testing a /$ pacat /dev/urandom/ from the host on Fedora Virtualization team's advice, it turns out PA doesn't work at all.
*So, here is my question : how to start PulseAudio correctly in such a setup (multi-user.target then xinit) ?*
Please note that if I connect to the VM from a complete GDM in the graphical systemd target, everything works fine.
Thank you for your attention!
system wide instance is your friend
[harry@rh:~]$ cat /etc/systemd/system/pulsed.service [Unit] Description=Pulseaudio Daemon After=rtkit-daemon.service udev.service dbus.service
[Service] Type=simple ExecStart=-/usr/bin/pulseaudio --daemonize=false --system=true --log-level=0 --log-target=stderr --disallow-module-loading=true --disallow-exit=true --exit-idle-time=0 --disable-shm=true --no-cpu-limit=false --use-pid-file=false --resample-method=src-sinc-best-quality Restart=always RestartSec=30 TimeoutSec=15 Nice=-10 CapabilityBoundingSet=~CAP_SYS_PTRACE InaccessibleDirectories=/boot InaccessibleDirectories=/root
[Install] WantedBy=multi-user.target
Sadly the daemon refuses to start. When started from console without the log-level=0, the daemon seems to start, but I still can't get any sound out of the box.
Eric Viseur
2013/7/9 Reindl Harald h.reindl@thelounge.net
Am 09.07.2013 16:01, schrieb Eric Viseur:
I'm currently working on a virtualization project using F18. One of the
use cases is booting on the multi-user
systemd target, then starting the Spice client in a very restricted X
environment by simply issuing
/$ xinit /usr/bin/spicec (some parameters)/
Everything works fine, except the sound : as I don't start a complete
GDM in this boot scenario, PulseAudio isn't
loaded. I thus tried to start PulseAudio manually by issuing :
/$ start-pulseaudio-x11/
before starting xinit with the same user, but it doesn't work either.
After testing a /$ pacat /dev/urandom/ from
the host on Fedora Virtualization team's advice, it turns out PA doesn't
work at all.
*So, here is my question : how to start PulseAudio correctly in such a
setup (multi-user.target then xinit) ?*
Please note that if I connect to the VM from a complete GDM in the
graphical systemd target, everything works fine.
Thank you for your attention!
system wide instance is your friend
[harry@rh:~]$ cat /etc/systemd/system/pulsed.service [Unit] Description=Pulseaudio Daemon After=rtkit-daemon.service udev.service dbus.service
[Service] Type=simple ExecStart=-/usr/bin/pulseaudio --daemonize=false --system=true --log-level=0 --log-target=stderr --disallow-module-loading=true --disallow-exit=true --exit-idle-time=0 --disable-shm=true --no-cpu-limit=false --use-pid-file=false --resample-method=src-sinc-best-quality Restart=always RestartSec=30 TimeoutSec=15 Nice=-10 CapabilityBoundingSet=~CAP_SYS_PTRACE InaccessibleDirectories=/boot InaccessibleDirectories=/root
[Install] WantedBy=multi-user.target
Eric Viseur wrote:
Hi,
I'm currently working on a virtualization project using F18. One of the use cases is booting on the multi-user systemd target, then starting the Spice client in a very restricted X environment by simply issuing
*$ xinit /usr/bin/spicec (some parameters)*
Everything works fine, except the sound : as I don't start a complete GDM in this boot scenario, PulseAudio isn't loaded. I thus tried to start PulseAudio manually by issuing :
*$ start-pulseaudio-x11*
before starting xinit with the same user, but it doesn't work either.
it needs to run *after* X is started, not before.
-- rex
On Tuesday, July 09, 2013 04:01:47 PM Eric Viseur wrote:
I'm currently working on a virtualization project using F18. One of the use cases is booting on the multi-user systemd target, then starting the Spice client in a very restricted X environment by simply issuing
$ xinit /usr/bin/spicec (some parameters)
Everything works fine, except the sound : as I don't start a complete GDM in this boot scenario, PulseAudio isn't loaded. I thus tried to start PulseAudio manually by issuing :
$ start-pulseaudio-x11
before starting xinit with the same user, but it doesn't work either. After testing a $ pacat /dev/urandom from the host on Fedora Virtualization team's advice, it turns out PA doesn't work at all.
So, here is my question : how to start PulseAudio correctly in such a setup (multi-user.target then xinit) ?
Please note that if I connect to the VM from a complete GDM in the graphical systemd target, everything works fine.
Thank you for your attention !
I'm wondering if you might be able to use systemd user sessions along with the xorg-launch-helper [1] and user-session-units [2] since you may need some dbus magic for PulseAudio to work. I am using this along with PulseAudio for my F19 MythTV frontends with great success (I use it to be able to auto-switch from speaker output to bluetooth headset output when everyone else is trying to sleep).
Aside from the xorg-launch-helper package, which I package here [3], I have manually created some of the files from the user-session-units, which I don't yet package. Those are below:
# # dbus.service [Unit] Description=D-Bus System Message Bus Requires=dbus.socket
[Service] ExecStart=/bin/dbus-daemon --session --address=systemd: --nofork --systemd- activation ExecReload=/usr/bin/dbus-send --print-reply --session --type=method_call -- dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig
# # dbus.socket [Unit] Description=D-Bus System Message Bus Socket
[Socket] ListenStream=%t/dbus/user_bus_socket
# # example spicec.service [Unit] Description=spicec service After=network.target
[Service] ExecStart=/usr/bin/spicec (some parameters) Restart=on-failure
[Install] WantedBy=mythfrontend.target
# # example spicec.target [Unit] Description=spicec target Wants=xorg.target Requires=dbus.socket #After=network.target AllowIsolate=true
And I have PulseAudio set to autospawn: # /etc/pulse/client.conf ... autospawn = yes ...
There's a little more service/unit file help I can give if you think this might be a way for you to resolve the issue.
-A
[1] https://github.com/sofar/xorg-launch-helper [2] https://github.com/sofar/user-session-units [3] http://messinet.com/rpms
Just solved it, a much easier way. Thanks you for your advices, I directed me to taking a closer look to the logs. It lead me to discover that PA indeed started, but actually couldn't reach the sound card.
What I did was simply add my lowpriv user to the group audio, then start PulseAudio, unmute the sink and set it's volume to 100% before starting spicec. And voilà, it works like a charm ! No need for a systemwide instance :)
Eric Viseur Etudiant Ingénieur Civil Electricien +32 497 92 36 80 LinkedIn Profilehttp://www.linkedin.com/profile/view?id=193442069&trk=tab_pro
2013/7/10 Anthony Messina amessina@messinet.com
On Tuesday, July 09, 2013 04:01:47 PM Eric Viseur wrote:
I'm currently working on a virtualization project using F18. One of the
use
cases is booting on the multi-user systemd target, then starting the
Spice
client in a very restricted X environment by simply issuing
$ xinit /usr/bin/spicec (some parameters)
Everything works fine, except the sound : as I don't start a complete
GDM in
this boot scenario, PulseAudio isn't loaded. I thus tried to start PulseAudio manually by issuing :
$ start-pulseaudio-x11
before starting xinit with the same user, but it doesn't work either.
After
testing a $ pacat /dev/urandom from the host on Fedora Virtualization team's advice, it turns out PA doesn't work at all.
So, here is my question : how to start PulseAudio correctly in such a
setup
(multi-user.target then xinit) ?
Please note that if I connect to the VM from a complete GDM in the
graphical
systemd target, everything works fine.
Thank you for your attention !
I'm wondering if you might be able to use systemd user sessions along with the xorg-launch-helper [1] and user-session-units [2] since you may need some dbus magic for PulseAudio to work. I am using this along with PulseAudio for my F19 MythTV frontends with great success (I use it to be able to auto-switch from speaker output to bluetooth headset output when everyone else is trying to sleep).
Aside from the xorg-launch-helper package, which I package here [3], I have manually created some of the files from the user-session-units, which I don't yet package. Those are below:
# # dbus.service [Unit] Description=D-Bus System Message Bus Requires=dbus.socket
[Service] ExecStart=/bin/dbus-daemon --session --address=systemd: --nofork --systemd- activation ExecReload=/usr/bin/dbus-send --print-reply --session --type=method_call -- dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig
# # dbus.socket [Unit] Description=D-Bus System Message Bus Socket
[Socket] ListenStream=%t/dbus/user_bus_socket
# # example spicec.service [Unit] Description=spicec service After=network.target
[Service] ExecStart=/usr/bin/spicec (some parameters) Restart=on-failure
[Install] WantedBy=mythfrontend.target
# # example spicec.target [Unit] Description=spicec target Wants=xorg.target Requires=dbus.socket #After=network.target AllowIsolate=true
And I have PulseAudio set to autospawn: # /etc/pulse/client.conf ... autospawn = yes ...
There's a little more service/unit file help I can give if you think this might be a way for you to resolve the issue.
-A
[1] https://github.com/sofar/xorg-launch-helper [2] https://github.com/sofar/user-session-units [3] http://messinet.com/rpms
-- Anthony - http://messinet.com - http://messinet.com/~amessina/gallery 8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E
-- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
On Wednesday, July 10, 2013 11:03:14 AM Eric Viseur wrote:
Just solved it, a much easier way. Thanks you for your advices, I directed me to taking a closer look to the logs. It lead me to discover that PA indeed started, but actually couldn't reach the sound card.
What I did was simply add my lowpriv user to the group audio, then start PulseAudio, unmute the sink and set it's volume to 100% before starting spicec. And voilà, it works like a charm ! No need for a systemwide instance :)
I don't use a system-wide instance either, but one that's spawned dynamically within a systemd user session.
I'm glad you got it working! -A