all
a
/
b
/
c
/
f
/
h
/
j
/
jp
/
l
/
o
/
q
/
s
/
sw
/
lounge
cgi
up
wiki
Heyuri!
Bulletin Boards
2D Cute
2D Ero
2D Lolikon
3D Girls
Anime/Manga
Flash
Girl Talk
日本語/Japan
Lounge
Oekaki
Off-Topic
Site Discussion
Strange World
Overboard
Heyuri★CGI
Heyuri★CGI
@PartyII
Battle Royale R
Chat
Chinsouki★
Dating
DevChat
Drama Club
Hakoniwa Islands PvE
Hakoniwa Islands PvP
Polls
Slime Breeder
Web Banana
Web Shiritori
Yumemiru Gambler
Kakiko Checker
Other
Anime Nominations
Banners
Cytube
Heyuri Calendar
Heyuri Wiki
MAL Club
Museum
Steam Group
Uploader
[
Settings
]
[
Home
] [
Contact
] [
Catalog
] [
Search
] [
Thread list
] [
Stats
] [
Reports
] [
Watcher
] [
PMs
] [
Admin
]
Off-Topic@Heyuri
it's the place to be!
[
Return
]
Report a post
Preview
File:
fbsdorb.png
(108 KB, 450x435)
ImgOps
Hide image
ImgOps
Hide image
▶
How to switch audio sources on freebsd
Anonymous
2025/09/03
(Wed)
05:14:24
No.
154659
[
Report
]
+
AS
▶
Unlike linux, freebsd doesn't automatically switch between audio sources if you plug in your headphones. I had a hard time trying to figure out how to do it but I finally got it. Kind of.
Firstly you'll need to know what is the pcm number of your headphone jack port and for that you'll use the
dmesg | grep pcm
command. There should show up multiple Realtek entries for most people and the second one is usually the port for headphones. For me its located at pcm5 since the first entries were a bunch of nvidia garbage.
To change the audio source from speakers to headphones system wide you'll use the
sysctl hw.snd.default_unit=X
command replacing X with whatever number is the pcm number for your headphone port. Some programs mainly web browsers use pulseaudio to manage sound so don't be surprised when firefox plays sound from the speaker and your audio player plays sound from your headphones. To fix that you'll use the
pactl set-default-sink oss_output.dspX
command, again replacing the X to switch the pulseaudio output to your headphones as well.
Those commands are too long for me to bother remembering so I just alias them in my .zshrc file like this:
alias s2h="pactl set-default-sink oss_output.dsp5 & sysctl hw.snd.default_unit=5"
and
alias s2s="pactl set-default-sink oss_output.dsp4 & sysctl hw.snd.default_unit=4"
to switch both system audio and pulseaudio source at the same time.
It's not exactly automatic but I'm sure you could make a script that does that for you but this is what i managed to do so far. If anyone's trying to figure out how sound works on freebsd then I hope this helps!
Post number
No.
154659
Board
Off-Topic@Heyuri
Reason
Optional. Describe what's wrong with it.
Style: