You are not logged in.
When I plug in my MS LifeChat LX-3000 headphones into my usb drive into notebook, I have to manually change the sound output to the headset by pavucontrol.
And when I switch the sound manualy and try to change volume from my keyboard (on the rope) the volume remains the same.
I found this link in the wiki https://wiki.archlinux.org/index.php/Pu … on_connect
And try to test command in terminal # pactl load-module module-switch-on-connect
i have this error
i3 ~ $ sudo su
[root@PC i3]# pactl load-module module-switch-on-connect
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
[root@PC i3]#
PS -ArchLinux wm i3
Last edited by Yashalta (2017-07-11 13:43:38)
Offline
Why are you running this as root? Your pulse runs as your user, so run the pactl command as your user. You've already been told this extensively here Although in your defense you might've been thrown off by the # which usually means run something as root, which is an error in the wiki article, I'm going to fix that. However please try to learn from your exchanges on the boards and if running something as root doesn't work, try it as your user/finding a solution before opening another thread.
Offline
FYI: This exact module made pulseaudio crash for me on my work laptop (Ubuntu) when I added it to ~/.config/pulse/default.pa. Didn't investigate any further though.
Offline
Define "added". If you have a default.pa in ~/.config/pulse/ it overrides the configuration in /etc/pulse/default.pa so if you create a file with only that line as its content pulse won't load any other modules. Correct location to make it persistent would either way be before the if..udev detect block in /etc/pulse/default.pa (or a relevant copy of said file to the home dir path)
Offline
Why are you running this as root?
Jeez! Thank you for the amendment.
But, if i run command as user it is also a problem.
i3 ~ $ pactl load-module module-switch-on-connect
Failure: Module initialization failed
i3 ~ $
Offline
Define "added". If you have a default.pa in ~/.config/pulse/ it overrides the configuration in /etc/pulse/default.pa so if you create a file with only that line as its content pulse won't load any other modules.
Ha, you got me. I jumped to the conclusion that the user config is loaded in addition to the one in /etc.
Yashalta, "Failure: Module initialization failed" is also printed when the module was successfully loaded before. Check your journal, it should contain a more specific error message.
Offline
Yashalta, "Failure: Module initialization failed" is also printed when the module was successfully loaded before. Check your journal, it should contain a more specific error message.
1. How to open a journal?
2. And journal need to open after entering the command # pactl load-module module-switch-on-connect in the terminal?
Offline
https://wiki.archlinux.org/index.php/Sy … he_journal
However I don't know if a module-load failure will be logged there. Best to verify, what is the output of
pacmd list-modules | grep 'switch'
Offline
https://wiki.archlinux.org/index.php/Sy … he_journal
However I don't know if a module-load failure will be logged there. Best to verify, what is the output ofpacmd list-modules | grep 'switch'
Thanks for link!
i3 ~ $ pacmd list-modules | grep 'switch'
name: <module-switch-on-port-available>
name: <module-switch-on-connect>
module.description = "When a sink/source is added, switch to it or conditionally switch to it"
i3 ~ $
command
i3 ~ $ sudo su
[root@PC i3]# pactl load-module module-switch-on-connect
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
[root@PC i3]#
i3 ~ $ journalctl --user
-- Logs begin at Mon 2017-07-10 12:06:22 EEST, end at Mon 2017-07-10 19:23:32 EEST. --
Jul 10 12:06:22 PC systemd[393]: Stopping Accessibility services bus...
Jul 10 12:06:22 PC systemd[393]: Stopped target Default.
Jul 10 12:06:22 PC systemd[393]: Stopping Sound Service...
Jul 10 12:06:22 PC systemd[393]: Stopping D-Bus User Message Bus...
Jul 10 12:06:22 PC systemd[393]: Stopping Virtual filesystem service...
Jul 10 12:06:22 PC systemd[393]: Stopped D-Bus User Message Bus.
Jul 10 12:06:22 PC systemd[393]: Stopped Sound Service.
Jul 10 12:06:22 PC systemd[393]: Stopped Virtual filesystem service.
Jul 10 12:06:22 PC systemd[393]: Stopped Accessibility services bus.
Jul 10 12:06:22 PC systemd[393]: Stopped target Basic System.
Jul 10 12:06:22 PC systemd[393]: Stopped target Timers.
Jul 10 12:06:22 PC systemd[393]: Stopped target Paths.
Jul 10 12:06:22 PC systemd[393]: Stopped target Sockets.
Jul 10 12:06:22 PC systemd[393]: Closed GnuPG cryptographic agent and passphrase cache (access for web browsers).
Jul 10 12:06:22 PC systemd[393]: Closed GnuPG cryptographic agent and passphrase cache.
Jul 10 12:06:22 PC systemd[393]: Closed GnuPG network certificate management daemon.
Jul 10 12:06:22 PC systemd[393]: Closed GnuPG cryptographic agent and passphrase cache (restricted).
Jul 10 12:06:22 PC systemd[393]: Closed Sound System.
Jul 10 12:06:22 PC systemd[393]: Closed GnuPG cryptographic agent (ssh-agent emulation).
Jul 10 12:06:22 PC systemd[393]: Closed D-Bus User Message Bus Socket.
Jul 10 12:06:22 PC systemd[393]: Reached target Shutdown.
Jul 10 12:06:22 PC systemd[393]: Starting Exit the Session...
Jul 10 12:06:22 PC systemd[393]: Received SIGRTMIN+24 from PID 32656 (kill).
Jul 10 12:06:22 PC systemd[394]: pam_unix(systemd-user:session): session closed for user i3
-- Reboot --
Jul 10 19:07:33 PC systemd[394]: Listening on GnuPG cryptographic agent (ssh-agent emulation).
Jul 10 19:07:33 PC systemd[394]: Reached target Timers.
Jul 10 19:07:33 PC systemd[394]: Listening on GnuPG cryptographic agent and passphrase cache (access for web browsers).
Jul 10 19:07:33 PC systemd[394]: Listening on GnuPG cryptographic agent and passphrase cache (restricted).
Jul 10 19:07:33 PC systemd[394]: Starting D-Bus User Message Bus Socket.
Jul 10 19:07:33 PC systemd[394]: Listening on GnuPG network certificate management daemon.
Jul 10 19:07:33 PC systemd[394]: Reached target Paths.
Jul 10 19:07:33 PC systemd[394]: Listening on GnuPG cryptographic agent and passphrase cache.
Jul 10 19:07:33 PC systemd[394]: Listening on Sound System.
Jul 10 19:07:33 PC systemd[394]: Listening on D-Bus User Message Bus Socket.
Jul 10 19:07:33 PC systemd[394]: Reached target Sockets.
Jul 10 19:07:33 PC systemd[394]: Reached target Basic System.
Jul 10 19:07:33 PC systemd[394]: Reached target Default.
Jul 10 19:07:33 PC systemd[394]: Startup finished in 43ms.
Jul 10 19:07:33 PC systemd[394]: Started D-Bus User Message Bus.
Jul 10 19:07:33 PC dbus-daemon[417]: Successfully activated service 'org.freedesktop.systemd1'
Jul 10 19:07:33 PC dbus-daemon[417]: Activating service name='org.freedesktop.Notifications'
Jul 10 19:07:33 PC dbus-daemon[417]: Successfully activated service 'org.freedesktop.Notifications'
Jul 10 19:07:33 PC org.freedesktop.Notifications[417]: Name Lost. Is Another notification daemon running?
Jul 10 19:07:33 PC org.freedesktop.Notifications[417]: no dunstrc found -> skipping
Jul 10 19:07:34 PC dbus-daemon[417]: Activating via systemd: service name='org.gtk.vfs.Daemon' unit='gvfs-daemon.service'
Jul 10 19:07:34 PC systemd[394]: Starting Virtual filesystem service...
Jul 10 19:07:34 PC dbus-daemon[417]: Successfully activated service 'org.gtk.vfs.Daemon'
Jul 10 19:07:34 PC systemd[394]: Started Virtual filesystem service.
Jul 10 19:07:34 PC dbus-daemon[417]: Activating via systemd: service name='org.a11y.Bus' unit='at-spi-dbus-bus.service'
Jul 10 19:07:34 PC systemd[394]: Starting Accessibility services bus...
Jul 10 19:07:34 PC dbus-daemon[417]: Successfully activated service 'org.a11y.Bus'
Jul 10 19:07:34 PC systemd[394]: Started Accessibility services bus.
Jul 10 19:07:34 PC at-spi-bus-launcher[635]: Activating service name='org.a11y.atspi.Registry'
Jul 10 19:07:34 PC dbus-daemon[417]: Activating service name='org.xfce.Xfconf'
Jul 10 19:07:34 PC dbus-daemon[417]: Successfully activated service 'org.xfce.Xfconf'
Jul 10 19:07:34 PC at-spi-bus-launcher[635]: Successfully activated service 'org.a11y.atspi.Registry'
Jul 10 19:07:34 PC org.a11y.atspi.Registry[648]: SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
Jul 10 19:07:34 PC pkexec[725]: pam_unix(polkit-1:session): session opened for user root by (uid=1000)
Jul 10 19:07:36 PC systemd[394]: Starting Sound Service...
Jul 10 19:07:36 PC systemd[394]: Started Sound Service.
Jul 10 19:23:31 PC dbus-daemon[417]: Activating via systemd: service name='org.gtk.vfs.UDisks2VolumeMonitor' unit='gvfs-udisks2-volume-monitor.
Jul 10 19:23:31 PC systemd[394]: Starting Virtual filesystem service - disk device monitor...
Jul 10 19:23:31 PC dbus-daemon[417]: Successfully activated service 'org.gtk.vfs.UDisks2VolumeMonitor'
Jul 10 19:23:31 PC systemd[394]: Started Virtual filesystem service - disk device monitor.
Jul 10 19:23:31 PC dbus-daemon[417]: Activating via systemd: service name='org.gtk.vfs.MTPVolumeMonitor' unit='gvfs-mtp-volume-monitor.service'
Jul 10 19:23:31 PC systemd[394]: Starting Virtual filesystem service - Media Transfer Protocol monitor...
Jul 10 19:23:31 PC dbus-daemon[417]: Successfully activated service 'org.gtk.vfs.MTPVolumeMonitor'
Jul 10 19:23:31 PC systemd[394]: Started Virtual filesystem service - Media Transfer Protocol monitor.
Jul 10 19:23:31 PC dbus-daemon[417]: Activating via systemd: service name='org.gtk.vfs.GPhoto2VolumeMonitor' unit='gvfs-gphoto2-volume-monitor.
Jul 10 19:23:31 PC systemd[394]: Starting Virtual filesystem service - digital camera monitor...
Jul 10 19:23:31 PC dbus-daemon[417]: Successfully activated service 'org.gtk.vfs.GPhoto2VolumeMonitor'
Jul 10 19:23:31 PC systemd[394]: Started Virtual filesystem service - digital camera monitor.
Jul 10 19:23:31 PC dbus-daemon[417]: Activating via systemd: service name='org.gtk.vfs.Metadata' unit='gvfs-metadata.service'
Jul 10 19:23:31 PC systemd[394]: Starting Virtual filesystem metadata service...
Jul 10 19:23:31 PC dbus-daemon[417]: Successfully activated service 'org.gtk.vfs.Metadata'
Jul 10 19:23:31 PC systemd[394]: Started Virtual filesystem metadata service.
Jul 10 19:23:32 PC dbus-daemon[417]: Activating service name='org.freedesktop.thumbnails.Thumbnailer1'
Jul 10 19:23:32 PC dbus-daemon[417]: Successfully activated service 'org.freedesktop.thumbnails.Thumbnailer1'
ESCOD
Jul 10 19:23:31 PC systemd[394]: Starting Virtual filesystem service - disk device monitor...
Jul 10 19:23:31 PC dbus-daemon[417]: Successfully activated service 'org.gtk.vfs.UDisks2VolumeMonitor'
Jul 10 19:23:31 PC systemd[394]: Started Virtual filesystem service - disk device monitor.
Jul 10 19:23:31 PC dbus-daemon[417]: Activating via systemd: service name='org.gtk.vfs.MTPVolumeMonitor' unit='gvfs-mtp-volume-monitor.service'
Jul 10 19:23:31 PC systemd[394]: Starting Virtual filesystem service - Media Transfer Protocol monitor...
Jul 10 19:23:31 PC dbus-daemon[417]: Successfully activated service 'org.gtk.vfs.MTPVolumeMonitor'
Jul 10 19:23:31 PC systemd[394]: Started Virtual filesystem service - Media Transfer Protocol monitor.
Jul 10 19:23:31 PC dbus-daemon[417]: Activating via systemd: service name='org.gtk.vfs.GPhoto2VolumeMonitor' unit='gvfs-gphoto2-volume-monitor.
Jul 10 19:23:31 PC systemd[394]: Starting Virtual filesystem service - digital camera monitor...
Jul 10 19:23:31 PC dbus-daemon[417]: Successfully activated service 'org.gtk.vfs.GPhoto2VolumeMonitor'
Jul 10 19:23:31 PC systemd[394]: Started Virtual filesystem service - digital camera monitor.
Jul 10 19:23:31 PC dbus-daemon[417]: Activating via systemd: service name='org.gtk.vfs.Metadata' unit='gvfs-metadata.service'
Jul 10 19:23:31 PC systemd[394]: Starting Virtual filesystem metadata service...
Jul 10 19:23:31 PC dbus-daemon[417]: Successfully activated service 'org.gtk.vfs.Metadata'
Jul 10 19:23:31 PC systemd[394]: Started Virtual filesystem metadata service.
Jul 10 19:23:32 PC dbus-daemon[417]: Activating service name='org.freedesktop.thumbnails.Thumbnailer1'
Jul 10 19:23:32 PC dbus-daemon[417]: Successfully activated service 'org.freedesktop.thumbnails.Thumbnailer1'
ESCOD
Jul 10 19:23:31 PC systemd[394]: Starting Virtual filesystem service - disk device monitor...
Jul 10 19:23:31 PC dbus-daemon[417]: Successfully activated service 'org.gtk.vfs.UDisks2VolumeMonitor'
Jul 10 19:23:31 PC systemd[394]: Started Virtual filesystem service - disk device monitor.
Jul 10 19:23:31 PC dbus-daemon[417]: Activating via systemd: service name='org.gtk.vfs.MTPVolumeMonitor' unit='gvfs-mtp-volume-monitor.service'
Jul 10 19:23:31 PC systemd[394]: Starting Virtual filesystem service - Media Transfer Protocol monitor...
Jul 10 19:23:31 PC dbus-daemon[417]: Successfully activated service 'org.gtk.vfs.MTPVolumeMonitor'
Jul 10 19:23:31 PC systemd[394]: Started Virtual filesystem service - Media Transfer Protocol monitor.
Jul 10 19:23:31 PC dbus-daemon[417]: Activating via systemd: service name='org.gtk.vfs.GPhoto2VolumeMonitor' unit='gvfs-gphoto2-volume-monitor.
Jul 10 19:23:31 PC systemd[394]: Starting Virtual filesystem service - digital camera monitor...
Jul 10 19:23:31 PC dbus-daemon[417]: Successfully activated service 'org.gtk.vfs.GPhoto2VolumeMonitor'
Jul 10 19:23:31 PC systemd[394]: Started Virtual filesystem service - digital camera monitor.
Jul 10 19:23:31 PC dbus-daemon[417]: Activating via systemd: service name='org.gtk.vfs.Metadata' unit='gvfs-metadata.service'
Jul 10 19:23:31 PC systemd[394]: Starting Virtual filesystem metadata service...
Jul 10 19:23:31 PC dbus-daemon[417]: Successfully activated service 'org.gtk.vfs.Metadata'
Jul 10 19:23:31 PC systemd[394]: Started Virtual filesystem metadata service.
Jul 10 19:23:32 PC dbus-daemon[417]: Activating service name='org.freedesktop.thumbnails.Thumbnailer1'
Jul 10 19:23:32 PC dbus-daemon[417]: Successfully activated service 'org.freedesktop.thumbnails.Thumbnailer1'
lines 64-80/80 (END)
i3 ~ $ journalctl --user -u myunit.service
-- No entries --
i3 ~ $
i3 ~ $ journalctl --user --user-unit myunit.service
-- No entries --
i3 ~ $
Offline
Again, for the nth time DO NOT EVER run anything pulseaudio related as root it wont ever fix anything. The fact that pacmd lists that module shows that it has been loaded, so it should be ready to go. Does it not work? What happens if you unplug/plug your headset? If it still doesn't switch, try to add
load-module module-switch-on-connect
before the if..udev-detect block in your /etc/pulse/default.pa instead of wherever you have added it now. And those journal invocations are obviously bogus, the service you want information on is unsurprisingly called pulseaudio and not "myunit".
Offline
ugh sudo su...perhaps you want to know there's sudo -s and sudo -i?
But please just stop running pulseaudio or any of its utilities as root. Especially in your case you are trying to get more info from possible logs triggered by the module initialization failure.
In your case "myunit.servive" should pulseaudio.service.
Offline
ugh sudo su...perhaps you want to know there's sudo -s and sudo -i?
But please just stop running pulseaudio or any of its utilities as root. Especially in your case you are trying to get more info from possible logs triggered by the module initialization failure.
In your case "myunit.servive" should pulseaudio.service.
I probably do something wrong?!?
i3 ~ $ sudo systemctl status | grep pulseaudio
[sudo] password for i3:
│ │ ├─pulseaudio.service
│ │ │ └─840 /usr/bin/pulseaudio --daemonize=no
│ ├─29297 grep pulseaudio
i3 ~ $ sudo systemctl disable pulseaudio
Failed to disable unit: Unit file pulseaudio.service does not exist.
i3 ~ $ sudo systemctl disable pulseaudio.service
Failed to disable unit: Unit file pulseaudio.service does not exist.
i3 ~ $ sudo systemctl stop pulseaudio
Failed to stop pulseaudio.service: Unit pulseaudio.service not loaded.
i3 ~ $ sudo systemctl stop pulseaudio.service
Failed to stop pulseaudio.service: Unit pulseaudio.service not loaded.
i3 ~ $
Offline
Read the article I linked to, from top to bottom instead of just the paragraph. Pulseaudio is an user service it runs as your user you have to use systemctl --user . And the service is running that isn't the problem here. Please try to remain on topic, you learning about what user services are has nothing to do with the actual problem.
The module is loaded and should be working, what happens if you unplug and plug your headset now?
Offline
Read the article I linked to, from top to bottom instead of just the paragraph. Pulseaudio is an user service it runs as your user you have to use systemctl --user . And the service is running that isn't the problem here. Please try to remain on topic, you learning about what user services are has nothing to do with the actual problem.
I will read your link carefully, thank you!
The module is loaded and should be working, what happens if you unplug and plug your headset now?
Yes, it really works! I did not understand how it was fixed, but now it works!
Offline
One of your invocations of pactl (after you stopped doing them as root) was successful, you should've seen something like
i3 ~ $ pactl load-module module-switch-on-connect
20 #This number can differ, it tells you what index the module was loaded with
at least once. Afterwards, as randomguy pointed out, it will tell you that the load fails because the module was already loaded and it makes no sense to load it multiple times. If you want to make this persistent (so that you don't have to run pactl everytime) you can add
load-module module-switch-on-connect
to your /etc/pulse/default.pa
Offline
ok, thanks!
Offline