# switching between speakers and headset



## uig200 (Aug 26, 2021)

Hi,
I'm rather new in Free BSD. Although everything works great, I have a problem with the sound card. When I switch between speakers and headset, I have always to restart the corresponding application (for example Firefox) in order to have an effect on it. Otherwise it won't work. Is this normal?

with this command I switch to headphones: sysctl hw.snd.default_unit=0
with this I switch to speakers: sysctl hw.snd.default_unit=1

uig200

p.s.

Actually, some applications like vlc do not need restart. Only Firefox.


----------



## free-and-bsd (Aug 27, 2021)

uig200 said:


> Hi,
> I'm rather new in Free BSD. Although everything works great, I have a problem with the sound card. When I switch between speakers and headset, I have always to restart the corresponding application (for example Firefox) in order to have an effect on it. Otherwise it won't work. Is this normal?
> 
> with this command I switch to headphones: sysctl hw.snd.default_unit=0
> ...


Ha, is it because (default compile) Firefox relies on pulseaudio while vlc uses native sound driver?


----------



## sko (Aug 27, 2021)

Kill pulseaudio (ideally rm/rename the binary and replace it with an empty file and set the immutable flag on it) and you only need to pause/restart the video or at worst reload the tab.
Getting rid of pulseaudio also prevents it from blocking USB devices when disconnecting a USB soundcard/DAC because pulse keeps the stream open and prevents the proper removal of the device.

There's a long thread about removing pulseaudio dependencies; you might want to take a look at that too.


----------

