[Home] [Catalog] [Search] [Inbox] [Write PM] [Admin]
[Return]

Posting mode: Reply

(for deletion, 8 chars max)
  • Allowed file types are: gif, jpg, jpeg, png, bmp, swf, webm, mp4
  • Maximum file size allowed is 50000 KB.
  • Images greater than 200 * 200 pixels will be thumbnailed.



We will watch Strike Witches (2008) next Saturday 18:00 UTC [Info] [Countdown]


File: fbsdorb.png
(108 KB, 450x435)[ImgOps]
108 KB
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!
Marked for deletion (Old)
>>
thx
>>
thats similar how openbsd dose it
https://www.openbsd.org/faq/faq13.html#usbaudio
https://www.openbsd.org/faq/faq13.html#default

i am moving to freebsd soon (like in 4-10 days). but only for my server so i would not need sound. but thanks for info!


Delete post: []