Fixing No Sound in GhostBSD XFCE with Firefox (DP Cable)

If you’ve just installed GhostBSD with the XFCE desktop and there’s no sound in Firefox (e.g., when playing YouTube), the issue is often that the system is using the wrong audio device. This is common with HDMI or DisplayPort setups because multiple sound devices appear, but the wrong one may be selected.

Step 1: Check Available Sound Devices

Open a terminal and run:

cat /dev/sndstat

This lists all detected sound devices on your system. For example:

Installed devices:
pcm0: <Realtek ALC256 (Front Analog Headphones)> (play)
pcm1: <Realtek ALC256 (Rear Analog Line-out)> (play)
pcm2: <Intel Kaby Lake (HDMI/DP 8ch)> (play) default
pcm3: <BEHRINGER UMC404HD 192k> (play/rec)

Each pcm entry is a detected sound device. The one marked default is the active device.

Step 2: Identify the Correct Device

  • For speakers or headphones plugged into your computer, look for devices labeled with Analog or Realtek.
  • For HDMI or DisplayPort audio via GPU, look for devices labeled with HDMI or DP.
  • Sometimes multiple HDMI/DP devices appear; test each to find the one that works.

To temporarily switch and test a device, run:

sysctl hw.snd.default_unit=n

Replace n with the device number (e.g., 2 or 3). Then try watching a YouTube video in Firefox. If you don’t hear audio, complete this tutorial because there is a good chance that after rebooting your computer, sound will work.

Step 3: Make the Correct Device Permanent

To make the change permanent, edit /etc/sysctl.conf with *nano and update this line:

hw.snd.default_unit=2

If you are new to editing .conf files, read How to Edit Files in the GhostBSD Terminal with Nano. It will teach you about nano, a simple text editor which is perfect for editing system files.

Step 4: Install and configure XFCE4 mixer

First, install the mixer:

sudo pkg install xfce4-mixer

Open the XFCE Mixer app and select the correct sound card from the dropdown list. After choosing this, the volume sliders will control the right device.

Bonus tip. After installing the xfce4-mixer, you can add the Audo Mixer item to the panel for quick access. If the slider doesn’t change the volume, right-click the speak icon, go to Properties and make sure that the correct sound device is selected. After that, it will work.

Step 5: Reboot and Test Firefox

Open Firefox and go to YouTube to test the new setup. You should now hear sound coming through the correct output (DisplayPort, HDMI, or onboard).

Summary

  • Run cat /dev/sndstat to list all audio devices.
  • Identify whether you need an Analog or HDMI/DP device.
  • Test devices by switching with sysctl hw.snd.default_unit=n.
  • Make permanent by adding the right line to /etc/sysctl.conf.
  • Install xfce4-mixer and set the correct device for full volume control.

In addition, I also documented one more sound tweak I experienced to fix the no sound on wakeup issue.