Sound and Vision
- 4 minutes read - 641 wordsWhen you’re on a “Just Focus” laptop, it might be because your daytime life and responsibilities mean that the wee hours are your friend. When that’s the case, you definitely want to be able to turn volume down or off and you definitely need to be able to control the brightness of the screen.
What seemed like a pair of simple tasks, turned out to be the most difficult configuration change I found in my entire journey. In fact, it was because of this difficulty that I decided to write this series.
It wound up being a small thing to fix, but I’m not sure how I managed it besides pure luck. Maybe it’s the age of the hardware, maybe it’s the vendor, but this is still pretty mysterious to me.
Brightness
Adjust brightness? That’s backlight(8)
. You can set it at an absolute
percentage (1%
in the middle of the night) or decrement it or increment it.
The man
page will tell you all you need. Awesome.
Sound Volume
Adjust volume? That’s mixer(8)
. It supports volume increment, decrement, and
muting. The man
page will tell you all you need. Awesome.
So there you have it, tools for controlling brightness and volume from the command line.
What About Special Keys?
Now, my Dell has special keys for changing brightness and volume along the function keys at top. These do not work in FreeBSD, nor do they appear likely to without a lot of expertise that I simply don’t have.
👀 TOIMPROVE: It’d be great if more machines had support for their special keys. I know that the Thinkpads have a module extension that gives them access to the special keys.
The Bug
As I was reading up on mixer
, I was advised to test my change by using
beep(1)
(whose source is, of course, here). I couldn’t hear any
sound when I ran the program used to test sound. I tried various debugging
steps and ended up stuck.
I brought this question up in the forums and…sadly it did not pan out. No one could help. It was a very dispiriting development.
👀 TOIMPROVE: It’s unreasonable that basic sound doesn’t come working for more laptops out of the box.
👀 TOIMPROVE: At this stage of installation, I had precious few tools for getting my diagnostic data and they were quite confusing.
👀 TOIMPROVE Some diagnostic data are very large. It would be great if there were tools for getting these data somewhere public with personally-identifying information sanitized. There’s no
git
, there’s no console-mode browser installed, etc. FreeBSD should make it easier to get system data to a support venue. Additionally, recognizing and mounting a USB drive is not obvious unless you know what you’re doing. It’s too much to ask of a casual FreeBSD laptop user.
The Solution
There’s no other way to explain it other than I just got lucky and got a formula that I adapted to my pinout data.
👀 TOIMPROVE: I still have no idea what
pinout
means. How are we expecting this as a baseline for new adopter understanding?
In /boot/device.hints
:
hint.hdaa.0.nid33.config="as=2 seq=15"
hint.hdaa.0.nid18.config="as=2 seq=15"
Apparently the hardware detection needed some additional hinting to get my
sound subsystem working, hence the name /boot/device.hints
. 😆
Operating systems have to deal with thousands of vendors, sometimes a little
help is required to know how to group my headphones and system speaker into the
appropriate audio group. As the post notes, the relevant man pages are
snd_hda
, loader.conf(5)
, and sysctl(8)
.
I rebooted and then logged in as root and beep
made a beepy sound. 🎊
I wanted to test that richer sound experiences were also possible, so I did the following:
# pkg install vorbis-tools # Tools for sound
# curl -o t.ogg https://getsamplefiles.com/download/ogg/sample-1.ogg
# ogg123 t.ogg # Music plays! Yes!
With this, I had sound and a visible screen.