Brightness and Sound on FreeBSD
Part of the "Exploring FreeBSD on a Laptop" series.
Tested on FreeBSD 14.2
Brightness
I noticed upon logging into the console my laptop's screen was quite dim. This can be remedied with the backlight(8) command.
Get the current setting (off<-->brightness, 0<-->100):
$ backlight
brightness: 32
Set display to maximum brightness:
$ backlight 100
This setting will last only to the end of the current session. I add the command backlight 100
to ~/.profile
to set the display to maximum brightness upon login.
Brightness can also be decreased and increased with the backlight decr [integer]
and backlight incr [integer]
commands. If no amount is specified, by default the brightness will decrease and increase by 10%. I've created keyboard shortcuts for these commands in my Openbox configuration.
Sound
On my Thinkpad T480s, the sound card was automatically detected by the system:
$ dmesg | grep pcm
pcm0: <Realtek ALC257 (Analog 2.0+HP/2.0)> at nid 20,33 and 18 on hdaa0
pcm1: <Realtek ALC257 (Right Analog Mic)> at nid 25 on hdaa0
pcm2: <Intel Kaby Lake (HDMI/DP 8ch)> at nid 3 on hdaa1
The beep(1) command can be used to playback a sound, confirming the card is working:
$ beep
The mixer(8) command is used to manage sound card settings.
By itself, it displays the current settings:
$ mixer
pcm0:mixer: <Realtek ALC257 (Analog 2.0+HP/2.0)> on hdaa0 (play/rec) (default)
vol = 1.00:1.00 pbk
pcm = 1.00:1.00 pbk
speaker = 1.00:1.00 pbk
rec = 0.37:0.37 pbk mute
ogain = 1.00:1.00 pbk
monitor = 0.67:0.67 rec src
Increase or decrease the volume by 5% using mixer vol=+5%
or mixer vol=-5%
.
Toggle mute on/off for the volume or microphone using mixer vol.mute=toggle
or mixer rec.mute=toggle
.
I've also created keyboard shortcuts for these commands in my Openbox configuration.
Another option is to install an audio mixer utility with a terminal user interface (TUI). If you've ever used AlsaMixer on Linux, mixertui(8) will be very familiar:
# pkg install mixertui
You can like, share, or comment on this post on the Fediverse 💬
» Next: Networking on a FreeBSD Laptop
« Previous: FreeBSD Power Management