Solved Issues with mixer: pcm.pcm volume misbehavior

Hello,
When I type "mixer" in the terminal, I see this output:

sh:
$ mixer
cm0:mixer: <IDT 92HD87B2/4 (Analog 2.0+HP/2.0)> on hdaa0  (play/rec) (default)
    vol         = 0.90:0.90   pbk
    pcm         = 0.72:0.72   pbk

I think the pcm.vol value should change alongside the pcm.pcm value. What I mean is, when I adjust the volume control in Xfce (using xfce4-pulseaudio-plugin) to show a value like pcm.vol=50.00; pcm.pcm=50.00 or pcm.vol=85; pcm.pcm=85. However, sometimes the pcm.pcm stays fixed at a certain value like 0.75 and doesn't change anymore. This always happens without any apparent reason, sometimes it works, sometimes it doesn't. Bitperfect mode is disabled. In addition to the internal IDT 92HD87B2 sound card , I also have a Behringer UCA 202 USB sound adapter, and I'm experiencing the same issue.

I've searched through the entire forum and noticed that some people ask how to make mixer changes permanent. Someone suggested restarting with shutdown -r now, which usually works. However, even if the pcm.pcm remains at a value I set before restarting, it starts misbehaving later on as I continue to use the computer.

My /var/db contains these files:

sh:
$ cd /var/db/ ls -l | grep "mixer"

-rw-r--r--  1 root     wheel        249 May  1 13:52 mixer0-state
-rw-r--r--  1 root     wheel         89 May  1 13:52 mixer1-state
-rw-r--r--  1 root     wheel         64 May  1 13:52 mixer2-state
-rw-r--r--  1 root     wheel         64 May  1 03:04 mixer3-state

I tried adding a hint for pcm.pcm and set it to 100 in /boot/device.hints, but this causes pcm.pcm to be set to 100 every time I restart. While this does make the volume louder, it feels like a hardcoded fix, and I don't believe it's the proper solution. I would appreciate any suggestions.
 
Hi Mate, i think this is what you want

dont auto reset vol to default

Code:
/etc/sysctl.conf

Code:
# dont autoreset vol to default
hw.snd.vpc_autoreset=0
 
Hi! Thank you for your help. I appreciate it. I set it to zero. The problem is that when I adjust the volume, pcm.pcm doesn't change, especially when I'm listening to music in Firefox. But in Lollypop music player or VLC, both pcm.vol and pcm.pcm change together and work well. I installed Firefox using pkg, so it probably uses Alsa and not OSS by default. Compiling it from source could be tricky for me because of my older hardware, and I'd rather not mix the two, binary and compiled packages.
 
Hi Mate, you can set Firefox to use OSS instead of Pulseaudio

open firefox about:config

Code:
about:config

paste in

Code:
media.cubeb.backend

set the option to string and the value to

Code:
oss

restart Firefox and it will use OSS audio

By default Firefox uses Pulseaudio thats why your having issue with the volume level
switching to oss will fix the issue
 
I searched for media.cubeb.backend in Firefox 125.0.3 but it didn't exist. I created the property manually as a string and added the value OSS. Now it works and the sound quality seems better. Thank you for your help.
 
In Xfce, I use xfce4-pulseaudio-plugin to adjust the volume. The yellow zone is completely silent. The sound starts to be audible from where the red begins and gets to 100% volume where the red ends. I don't know if this is normal. It doesn't bother me, but I thought I'd ask if this is okay.
 

Attachments

  • sound.jpg
    sound.jpg
    18.1 KB · Views: 16
i havent used xfce for years so im not sure about that issue to be honest

Firefox is the only app i have come across on Freesbsd that use pulseaudio instead of oss
you probably wont come across many apps that use pulse on freebsd so may not be too much of an issue

main thing is you got the audio working with Firefox
 
I remember when mixer was really simple. You would just type mixer volume 90:90 or something similar.
Nowadays, I use mixertui, a fairly small program (21k) with only a few deps. It looks very much like alsamixer. (There's also a gui version, gtk-mixer, if you prefer). I've found that it simplifies volume for me. (As I often play videos with mpv, I also find that mpv's keyboard short cut of 9 and 0 to lower and raise volume is very useful).
 
Back
Top