Changes

Talk:PulseAudio

4,662 bytes added, 06:15, 26 March 2021
/* ATI Audio / AMD audio radeon.audio=0 */
The following lines were added (+) and removed (-):
ALSA directly accesses sound hardware and blocks access to it for other clients. But it is possible to set up ALSA to serve multiple clients.  update-initramfs -u  sudo update-initramfs -u == blacklist snd_hda_codec_hdmi == Try to blacklist both: blacklist snd_hda_intel blacklist snd_hda_codec_hdmior just blacklist snd_hda_codec_hdmito get rid of hdmi audio devices.   If you have another soundboard or usb soundboard this could work. == ATI Audio / AMD audio radeon.audio=0 == Disable support for audio over HDMI disable the audio support in video driver for example for AMD Radeon you should add in the kernel command line: radeon.audio=0 add the following to /etc/default/grub file:  GRUB_CMDLINE_LINUX_DEFAULT="quiet radeon.audio=0" GRUB_DISABLE_RECOVERY=false then refresh sudo grub-mkconfig -o /boot/grub/grub.cfg for short term test try (instead) /boot/vmlinuz-5.4.0-58-generic root=UUID=214e903a-3995-4c07-a18e-6b13b83d813c ro  quiet splash radeon.audio=0 == starting and stopping pulseaudio ==  xxxxx@host:~/test$ systemctl --user stop pulseaudio.socket xxxxx@host:~/test$ systemctl --user stop pulseaudio.service xxxxx@host:~/test$ pulseaudio --check xxxxx@host:~/test$ ps ax|grep -i pulse  24166 pts/1    S+    0:00 grep --color=auto -i pulse xxxxx@host:~/test$ systemctl --user start pulseaudio.socket xxxxx@host:~/test$ systemctl --user start pulseaudio.service xxxxx@host:~/test$ ps ax|grep -i pulse  25146 ?        S<sl  0:00 /usr/bin/pulseaudio --daemonize=no --log-target=journal  25182 ?        Sl    0:00 /usr/libexec/pulse/gsettings-helper  25328 pts/1    S+    0:00 grep --color=auto -i pulse xxxxx@host:~/test$ pulseaudio --check xxxxx@host:~/test$ systemctl --user stop pulseaudio.socket xxxxx@host:~/test$ systemctl --user stop pulseaudio.service xxxxx@host:~/test$ ps ax|grep -i pulse  27114 pts/1    S+    0:00 grep --color=auto -i pulse == PulseAudio fighting with Alsa == When the PulseAudio audio daemon starts, it by default loads module-udev-detect, which detects and opens all sound cards. PulseAudio uses ALSA to interface to the hardware; ALSA is a combination of kernel moadules and userspace libraries. As a result of PulseAudio opening all the sound cards, and as a result of the fact that ALSA cards can only be opened once, the user sees "Device or resource busy" error when trying to open an ALSA card after PulseAudio has started: $ arecord -D hw:2 -f S16_LE -c 1 -r 48000 -d 3 t.wav arecord: main:830: audio open error: Device or resource busy The general design of a sound server is to accept data from a wide variety of software and route it to a useful audio device, and vice versa (for input). Since that's the goal, PulseAudio needs to know about the capabilities of each device it wants to use. It must therefore open them to query capabilities about things like supported sample sizes and expected latency, as well as device names (because the user will want to know that to select the device). Once it's done that, it can present those options to the user. If the user wants to play something to a device, PulseAudio can just play to that card if the card is already open. If the card is not open, then PulseAudio must first acquire it, which may not work if another device is using it. In that case, the user will perceive their sound to be broken without a justified reason. Similarly, the user may question why their microphone doesn't seem to be producing sound. Because the average user does not know about or want to look at logs, having suddenly broken sound which required inspecting logs, especially if trying to start something like a video meeting, would be at best irritating and at worst an insurmountable problem. I'm a highly technical user with decades of experience on Linux and I don't want to troubleshoot sound problems (or any problems, for that matter). Acquiring all the sound cards and then having ALSA use PulseAudio as the default ALSA device means that programs which know how to use ALSA but not PulseAudio will just work without contending with other programs. Otherwise, for example, your audio player could hold onto the card while preventing sound effects like your terminal bell from working. This is not an uncommon problem, in fact; it's why PulseAudio is supported as an ALSA output device. Of course, this design doesn't meet everyone's needs, but it does produce the simplest, most robust behavior, since cards which are displayed to the user are generally usable, and those which are not are not. It may be possible to produce the behavior you desire with some configuration, or you may prefer to use a different solution, such as JACK or ALSA with dmix.
Bureaucrat, administrator
16,199
edits