You are not logged in.
Hello everyone,
I'm banging me head in the wall due to this problem: I'm using I3 Window Manager, thus no fancy "sound/audio mixer/control"-icon. Everyday now I'm on conference/video calls with colleagues, but after some hours I begin to become annoyed and tired of having the headset on. So I unplug the USB-headset and after this, the sound doesn't work. I used to control the sound level by typing "alsamixer" in a terminal window. Now when I try to run "alsamixer" it says: "cannot open mixer: No such file or directory". I'm thinking it's looking for the detached usb-headset. It should just ignore this and play audio, as if I had rebooted my pc and didn't have the usb-headset connected. I've ran the "alsa-info.sh"-script - info has been uploaded to alsa-info.sh output. I'm not really sure if pulseaudio is supposed to run, as I've never understood the linux sound system, does this look ok?
$ pacmd list-cards
No PulseAudio daemon running, or not running as session daemon.I've tried to restart pulseaudio using:
systemctl --user restart pulseaudioHowever, I'm pretty sure that's incorrect use... I've read a bit about some udev-rules, but don't understand to what extent this applies to me, running i3wm (not a typical configuration, I think most are running gnome wm etc)... Please help me solve this problem, so I soon am able to plugin/out the usb-headset and still have both sound and built-in microphone working as fallback, when the headset isn't connected. I'll be grateful for any help/advice/feedback/explanation, thanks!
Offline
If you want this to happen automatically and sound continuing to play and moving between plugged and not plugged headset you need to use pulseaudio.
Using systemctl would be correct use, granted you are properly starting your session in the first place. How are you starting i3? Maybe also post
sudo fuser -v /dev/snd/* #While using a "typical" audio application
systemctl --user status pulseaudio pulseaudio.socket
loginctl session-statusOffline
Great, thanks about confirming that I should use "pulseaudio". I start I3 from the GDM login screen, where I then normally enter my login user name + password and I3-WM is normally selected (because it's been used the last time, I use I3 for programming to avoid mouse movements). I started writing this, when the audio wasn't working (rebooting the machine obviously solves the problem, but it's not a good solution when I'm working in the daytime and have to e.g. switch to a conference call). I wrote down output of the suggested commands - then rebooted - and repeated (to check/test the difference) - this is the result:
While sound isn't working (=before rebooting):
# sudo fuser -v /dev/snd/*
USER PID ACCESS COMMAND
/dev/snd/controlC1: gdm 404929 F.... pulseaudio
/dev/snd/controlC2: gdm 404929 F.... pulseaudio
/dev/snd/seq: user 440275 F.... pipewireAfter a reboot - sound is working:
# sudo fuser -v /dev/snd/*
USER PID ACCESS COMMAND
/dev/snd/controlC0: gdm 1107 F.... pulseaudio
user 1628 F.... pulseaudio
/dev/snd/controlC1: gdm 1107 F.... pulseaudio
user 1628 F.... pulseaudioWhile sound isn't working (before reboot):
$ systemctl --user status pulseaudio pulseaudio.socket
● pulseaudio.service - Sound Service
Loaded: loaded (/usr/lib/systemd/user/pulseaudio.service; disabled; vendor preset:>
Active: active (running) since Thu 2020-03-19 20:46:50 CET; 57s ago
TriggeredBy: ● pulseaudio.socket
Main PID: 2184506 (pulseaudio)
CGroup: /user.slice/user-1000.slice/user@1000.service/pulseaudio.service
├─2184506 /usr/bin/pulseaudio --daemonize=no
└─2184516 /usr/lib/pulse/gsettings-helper
Mar 19 20:46:49 alien systemd[1746]: Starting Sound Service...
Mar 19 20:46:50 alien systemd[1746]: Started Sound Service.
● pulseaudio.socket - Sound System
Loaded: loaded (/usr/lib/systemd/user/pulseaudio.socket; enabled; vendor preset: e>
Active: active (running) since Thu 2020-03-19 20:46:49 CET; 58s ago
Triggers: ● pulseaudio.service
Listen: /run/user/1000/pulse/native (Stream)
CGroup: /user.slice/user-1000.slice/user@1000.service/pulseaudio.socket
Mar 19 20:46:49 alien systemd[1746]: Listening on Sound System.After a reboot - sound is working:
systemctl --user status pulseaudio pulseaudio.socket
● pulseaudio.service - Sound Service
Loaded: loaded (/usr/lib/systemd/user/pulseaudio.service; disabled; vendor preset: enabled)
Active: active (running) since Thu 2020-03-19 21:23:23 CET; 16min ago
TriggeredBy: ● pulseaudio.socket
Main PID: 1628 (pulseaudio)
CGroup: /user.slice/user-1000.slice/user@1000.service/pulseaudio.service
├─1628 /usr/bin/pulseaudio --daemonize=no
└─1676 /usr/lib/pulse/gsettings-helper
Mar 19 21:23:22 alien systemd[1010]: Starting Sound Service...
Mar 19 21:23:23 alien systemd[1010]: Started Sound Service.
● pulseaudio.socket - Sound System
Loaded: loaded (/usr/lib/systemd/user/pulseaudio.socket; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-03-19 21:09:54 CET; 29min ago
Triggers: ● pulseaudio.service
Listen: /run/user/1000/pulse/native (Stream)
CGroup: /user.slice/user-1000.slice/user@1000.service/pulseaudio.socket
Mar 19 21:09:54 alien systemd[1010]: Listening on Sound System.About the loginctl session-status - this output is much longer (many open/running processes), so I've tried to cut something out that I think is not needed + I'll write a comment below this section, about the diff - the output differences, before and after booting:
After rebooting:
loginctl session-status
3 - user (1000)
Since: Thu 2020-03-19 21:23:16 CET; 16min ago
Leader: 1554 (gdm-session-wor)
Seat: seat0; vc2
TTY: tty2
Service: gdm-password; type x11; class user
State: active
Unit: session-3.scope
├─1554 gdm-session-worker [pam/gdm-password]
├─1563 /usr/lib/gdm-x-session --register-session --run-script i3
├─1565 /usr/lib/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty -verbose 3
├─1569 i3
├─1582 nm-applet --sm-disable
├─1586 xautolock -time 9 -locker i3lock -c 222222 -n
├─1594 /bin/sh -c killall -q polybar; polybar example
├─1599 /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
├─1606 polybar example
├─1610 /usr/bin/picom --config /home/user/.config/picom/picom.conf -b
├─1659 /home/user/.CloudStation/CloudStation.app/bin/cloud-drive-ui
├─1662 /home/user/.CloudStation/CloudStation.app/bin/cloud-drive-connect --log_folder log --info_folder . --log_level CloudStation.app/log_template/syncfolder_c.deb>
├─1671 /home/user/.CloudStation/CloudStation.app/bin/cloud-drive-daemon /home/user/.CloudStation/data/config/client.conf 1024
├─1740 /usr/lib/chromium/chromium
├─1743 ... deleted around 10 chromium-lines here
├─1994 /usr/bin/plasma-browser-integration-host chrome-extension://cimiefiiaegbelhefglklhhakcgmhkai/
├─2033 /usr/lib/firefox/firefox
├─2043 ... deleted around 15 firefox-lines here
├─2644 /usr/lib/firefox/firefox -contentproc -parentBuildID 20200310120528 -prefsLen 8666 -prefMapSize 216751 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/f>
├─2736 /usr/bin/../lib/notepadqq/notepadqq-bin
├─3860 termite
├─3865 /usr/bin/zsh
├─4090 /bin/bash --login /usr/bin/smartgit
├─4102 /bin/bash --login /usr/bin/smartgit
├─4103 /opt/smartgit/jre/bin/java -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:InitiatingHeapOccupancyPercent=25 -Xmx1024m -Xss2m -Xverify:none -XX:MaxJavaStackTraceD>
├─7196 /usr/lib/firefox/firefox -contentproc -childID 5 -isForBrowser -prefsLen 8909 -prefMapSize 216751 -parentBuildID 20200310120528 -greomni /usr/lib/firefox/om>
├─8903 loginctl session-status
└─8904 less
Mar 19 21:28:49 alien notepadqq-bin[2736]: Missing icon: "help-about"
Mar 19 21:29:45 alien sudo[3556]: user : TTY=pts/4 ; PWD=/home/user/Desktop/Notes ; USER=root ; COMMAND=/usr/bin/bash
Mar 19 21:29:45 alien sudo[3556]: pam_unix(sudo:session): session opened for user root by (uid=0)
Mar 19 21:30:14 alien /usr/lib/gdm-x-session[4082]: File /usr/share/applications/qemu.desktop is broken: it contains Type=Application, but no Exec key/value pair. at /usr/bin/i3-dme>
Mar 19 21:30:15 alien /usr/lib/gdm-x-session[4090]: If you experience strange GUI bugs or crashes, try setting GTK_THEME=Adwaita or SWT_GTK3=0.
Mar 19 21:33:02 alien sudo[6987]: user : TTY=pts/9 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/bash
Mar 19 21:33:02 alien sudo[6987]: pam_unix(sudo:session): session opened for user root by (uid=0)
Mar 19 21:36:59 alien sudo[7766]: root : TTY=pts/9 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/fuser -v /dev/snd/by-path /dev/snd/controlC0 /dev/snd/controlC1 /dev/snd/hwC0D0>
Mar 19 21:36:59 alien sudo[7766]: pam_unix(sudo:session): session opened for user root by (uid=0)
Mar 19 21:36:59 alien sudo[7766]: pam_unix(sudo:session): session closed for user rootDifference before/after rebooting:
The last section was significantly different when sound wasn't working. So the end of the same command whose "almost-full" output is shown above, before rebooting was (=when sound didn't work, due to plugging in/out USB-headset):
Mar 19 20:44:07 alien sudo[2182839]: root : TTY=pts/12 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/fuser -v /dev/snd/by-path /dev/snd/controlC1 /dev/snd/controlC2 /dev/snd/hw>
Mar 19 20:44:07 alien sudo[2182839]: pam_unix(sudo:session): session opened for user root by (uid=0)
Mar 19 20:44:07 alien sudo[2182839]: pam_unix(sudo:session): session closed for user root
Mar 19 20:47:26 alien /usr/lib/gdm-x-session[1886392]: [Child 1886392, MediaDecoderStateMachine #1] WARNING: 7ff5720a6e20 OpenCubeb() failed to init cubeb: file /build/firefox/src/f>
Mar 19 20:47:26 alien /usr/lib/gdm-x-session[1886392]: [Child 1886392, MediaDecoderStateMachine #1] WARNING: Decoder=7ff57d5bc800 [OnMediaSinkAudioError]: file /build/firefox/src/fi>
Mar 19 20:47:32 alien /usr/lib/gdm-x-session[1886392]: [Child 1886392, MediaDecoderStateMachine #1] WARNING: Decoder=7ff57d5bc800 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0>
Mar 19 20:47:32 alien /usr/lib/gdm-x-session[1886392]: [Child 1886392, MediaDecoderStateMachine #1] WARNING: 7ff571123940 OpenCubeb() failed to init cubeb: file /build/firefox/src/f>
Mar 19 20:47:32 alien /usr/lib/gdm-x-session[1886392]: [Child 1886392, MediaDecoderStateMachine #1] WARNING: Decoder=7ff57d5d1800 [OnMediaSinkAudioError]: file /build/firefox/src/fi>
Mar 19 20:47:34 alien /usr/lib/gdm-x-session[1886392]: [Child 1886392, MediaDecoderStateMachine #1] WARNING: 7ff571124230 OpenCubeb() failed to init cubeb: file /build/firefox/src/f>
Mar 19 20:47:34 alien /usr/lib/gdm-x-session[1886392]: [Child 1886392, MediaDecoderStateMachine #1] WARNING: Decoder=7ff57d5d1800 [OnMediaSinkAudioError]: file /build/firefox/src/fi>
lines 81-128/128 (END)So, this message contains a lot of DECODER warnings, something about firefox - not sure if that means firefox was the last program, attempting to play music/sound? I think it could very well be the case (I tried to play a youtube music video, I think)... So to summarize:
(1) The "fuser -v /dev/snd/*"-command showed some interesting stuff, namely that the amount of running proccesses was different and then something with pulseaudio was started by "pipewire" - this I don't understand. (2) The "systemctl --user status pulseaudio pulseaudio.socket" didn't provide much help. But..
(3) The last around 10 lines of the output from "loginctl session-status" revealed a lot of decoder-warnings, probably from when it last tried to play a music-video from youtube in firefox...
Does there exist a nice way of e.g. restarting pulseaudio to get out of that "broken state" my system seemed to have been in, due to unplugging the USB-headset (maybe while using both mic and speaker output, i.e. during a video-meeting) before I rebooted? Maybe I took out the USB-headset, while I was using both recording and playback, as it becomes/became annoying to have the headset on for too many hours - not sure if this means anything. I hope someone knows a/the solution, this problem has happened, I think 3 times in the last week and I hate to reboot my pc (normally I just hibernate, to resume working on the next day)... Looking forward to hear any good advice, appreciate and will be grateful for any help, thanks!
Offline