The mixer has nothing to do with the PC speaker.Check yourmixer
and make sure speaker is set
The mixer has nothing to do with the PC speaker.
The mixer has nothing to do with this.% mixer speaker 20
Mixer speaker is currently set to 20:20
% echo abcdefg >/dev/speaker
(softer play)
% mixer speaker 100
Mixer speaker is currently set to 100:100
% echo abcdefg >/dev/speaker
(louder play)
mixer(8) speaker works fine here, only on mixer instances that include one of course. Also, speaker usually has only a few distinct volume steps (here about 4) between 0 and 100.
I just tried doing the same using the live CD, and got the same thing.
Running this command used to give me a nice melody:
/bin/echo "\msl16oldcd4mll8pcb-agf+4.g4" > /dev/speaker
The mixer has nothing to do with this.
Ok. As expected, but it does confirm that your install hasn't damaged the relevant files.
Ok, so which FreeBSD version were you running on this same machine when /dev/speaker was working correctly?
Can you boot to LiveCD mode using the installer from that earlier working version, to confirm that with spkrtest?
If that works, you have all you need to submit a PR against the speaker driver, for that machine's particular hardware.
As shown above, the mixer level for speaker does indeed matter. At least it must be set greater than zero, which should mute speaker output - it does here anyway.
# mixer
Mixer vol is currently set to 100:100
Mixer pcm is currently set to 100:100
Mixer speaker is currently set to 100:100
Mixer line is currently set to 1:1
Mixer mic is currently set to 67:67
Mixer mix is currently set to 74:74
Mixer rec is currently set to 37:37
Mixer igain is currently set to 0:0
Mixer ogain is currently set to 100:100
Recording source: mic
/dev/speaker
and mixer are two different things./dev/speaker
being a device connected to 8254 PIT (if I recall correctly there were some hacks how to adjust volume on PC speaker ; it's in the same realm as how to play PCM on it).beep
in 13.x base and one from ports.root@freebsd13:~ # dmesg |grep CPU
CPU: Pentium II/Pentium II Xeon/Celeron (501.15-MHz 686-class CPU)
root@freebsd13:~ # uname -a
FreeBSD freebsd13.2 13.2-RELEASE FreeBSD 13.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC i386
root@freebsd13:~ #
Can I do anything to fix it?As cracauer@ said/dev/speaker
and mixer are two different things./dev/speaker
being a device connected 8254 PIT (if I recall correctly there were some hacks how to do it ; in the same realm as how to play PCM on it).
You set a FQ on PIT (channel 2) and that's it. Then you mute it. There's no other magic going on, you can't do any fancy thing through mixer or otherwise.
Also as mentioned above one has to pay attention to beep in 13.x base and one from ports.
My 13.2 test machine doesn't have PC speaker unfortunatelly, only a "speaker"/"beeper" connected to sound card.
I dug my old jig:
Code:root@freebsd13:~ # dmesg |grep CPU CPU: Pentium II/Pentium II Xeon/Celeron (501.15-MHz 686-class CPU) root@freebsd13:~ # uname -a FreeBSD freebsd13.2 13.2-RELEASE FreeBSD 13.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC i386 root@freebsd13:~ #
Had to go through my boxes of old cables/hw/junk to find a PC speaker, connected it to this board.. and voila, it works. I found some random video streaming service online where I can share the video for 2 days: pc speaker in action.
At a first glance of your video it seems like it's a timer issue -- the timer is just too quick.
That's a good question. If I have to debug this I'd start diffing the tsleep() in 12 and 13 to see if there were any changes. Also we are working on assumption that your HW can 100% use PC speaker as intended on 12.x version (you could boot there just to verify this once again).Can I do anything to fix it?
/dev/speaker
will throw some debug messages about timings. Comparing 12 and 13 messages (yes, that means compile kernel with DEBUG on 12 and 13) could give you a hint what's happening too.Sorry, that is just too much work, and I wouldn't know where to find tsleep() anyway.That's a good question. If I have to debug this I'd start diffing the tsleep() in 12 and 13 to see if there were any changes. Also we are working on assumption that your HW can 100% use PC speaker as intended on 12.x version (you could boot there just to verify this once again).
If you compile kernel with DEBUG accessing/dev/speaker
will through some debug messages about timings. Comparing 12 and 13 messages (yes, that means compile kernel with DEBUG on 12 and 13) could give you a hint what's happening too.
That's why I asked to confirm it works under 12.x as you stated in your opening statement. If it worked before then something had to be changed that messed up your setup.My conclusion is that it is the motherboard.
Can I still do something about it?That's why I asked to confirm it works under 12.x as you stated in your opening statement. If it worked before then something had to be changed that messed up your setup.
There's not much software do go by though. You set a fq on a PIT and enable the output, that's it. Then you disable it to mute. In FreeBSD all this is happening via that kernel module.If it got any electrical signal, it would work, and perhaps if the polarity is attached by the wrong pin, it wouldn't work correctly with some software?
That's why I asked to confirm it works under 12.x as you stated in your opening statement. If it worked before then something had to be changed that messed up your setup.
This is the first time I have used this motherboard, an Asus TUF Gaming b560M-PLUS. It is also the very first time I have installed FreeBSD 13 on physical hardware.
As cracauer@ said/dev/speaker
and mixer are two different things.
/dev/speaker
being a device connected to 8254 PIT (if I recall correctly there were some hacks how to adjust volume on PC speaker ; it's in the same realm as how to play PCM on it).
You set a FQ on PIT (channel 2) and that's it. Then you mute it.
There's no other magic going on, you can't do any fancy thing through mixer or otherwise.
I dug my old jig:
Code:root@freebsd13:~ # dmesg |grep CPU CPU: Pentium II/Pentium II Xeon/Celeron (501.15-MHz 686-class CPU) root@freebsd13:~ # uname -a FreeBSD freebsd13.2 13.2-RELEASE FreeBSD 13.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC i386 root@freebsd13:~ #
Had to go through my boxes of old cables/hw/junk to find a PC speaker, connected it to this board.. and voila, it works. I found some random video streaming service online where I can share the video for 2 days: pc speaker in action.
At a first glance of your video it seems like it's a timer issue -- the timer is just too quick.
Then it's not an actual PC speaker (i8254 or alike) but a speaker connected to a sound card (or as I mention below). Something similar I have on my test board I mentioned above (HP ProDesk 600 G1).They are, but as I demonstrate in #29, 'mixer speaker' controls the volume of the PC speaker, and so of all beeps. At least, on my thinkpads, other laptops and all desktops and servers with beepers since 1998.
Not with old school PC speaker.Except control its volume
/dev/speaker
and get the sound. I'd bet HW manufacturer did something here on its own, maybe hooked IO ports. One can imagine there's no high demand for actual PC speaker these days.You are correct, I did miss the post #33. It wouldn't hurt if OP mentioned that to me when I was asking.Please see my posts #29 and #31 seeking the same info, and post #33 containing the above. [edit] and also that 12.4 wouldn't boot on this hardware.
I kept rereading his original statement, from there one can get impression that this prior versions of FreeBSD existed on this HW.But when I tried to get anything out it of usingbeep
, it just gave me low-pitch clicking sounds. That did not use to happen with versions prior to 13.
Is my asumption correct that to resolve the issue, one needs to:[...] I went through the user manual of Asus TUF Gaming b560M-PLUS. On page 15, paragraph 16, point 3 there's "4-pin speaker". There is no other description of this IO port. Classic PC speaker had two pins (Gnd and Vcc).