Solved PC speaker won't beep properly.

An other possiblity that could explain this issue, is that the speaker is an active buzzer (that oscillate of is own) - even if there is short beep on startup. A passive buzzer should be used (that oscillate wih the input signal).

You can connect your speaker on an 3 or 5v battery. If it beep, it's an active device.
 
Erichans This is too close to the HW. You read IO port (PIT, e.g. 0x43) and expect it to be i8254 compatible device. In theory BIOS could have provided options you mentioned but I don't know what would be the reason for it. Personally I've not seen such option ever (which means nothing ;-) )

scilek Could you please share your dmesg when system is booted? Can you also share the output of the sysctl -A | grep 8254 ?
 
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).

Ah, ok. While true for all of my laptops from Compaq 1500c (c.y2k) to Thinkpads T23 ('04), more recently X200 and T430s, I'm likely misremembering old desktop and server boxes re speaker volume control.

Apologies to you and cracauer@ about that.

Not with old school PC speaker. :)

Now I understand that you have a HW where you can clearly a) control the volume with mixer b) write to /dev/speaker and get the sound.

I'd be surprised if there were any laptops lacking this ability?

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.

Don't BIOS/UEFI still use beep codes to indicate mbd errors?

My Thinkpads all use snd_hda.

And still curious: What's an FQ?
 
Don't BIOS/UEFI still use beep codes to indicate mbd errors?
It's about board manufacturer and what they opted for. I do have boards that don't have speaker but 4 leds indicating the error code. One Asus board I had had hex code display on board indicating error.

And still curious: What's an FQ?
Frequency :). Setting it on PIT sets the fq by which speaker resonates = tone. You can't do polyfony, you can't adjust volume, etc. But you can fake some stuff. I once shared it here on forums: I created a player that played a tune from a cartoon with fake bass line.

I checked the Intels 500 series and it does include these timers. It could be that manufacturer did something to this board that BIOS is aware of and is able to beep properly.
I asked scilek for dmesg and sysctl output to verify proper fq is set by default. Playing around with those parameters while something keeps writing to /dev/speaker is worth checking out.
 
Can you confirm it was working before ? Just to say yes (and actually confirm), in 12.4 release I can use PC speaker just fine.

If PC speaker itself is not working it doesn't make sense to connect it anywhere else. E.g. In the past people where attaching PC speaker output to amplifier and better speakers to enjoy the FastTracker music.

I was not able to run the 12.4 live CD on this machine.
 
It has two pins, if any gets power, it beeps due to the BIOS. If the pins are reversed, maybe it only works under BIOS and not as wanted under a driver when the power flowing in the wrong direction. Which the software would be the FreeBSD driver for the frequency.
I tried both ways. The same...
 
You are correct, I did miss the post #33. It wouldn't hurt if OP mentioned that to me when I was asking.

I was also asking - perhaps too obliquely - since back at #13.

I kept rereading his original statement, from there one can get impression that this prior versions of FreeBSD existed on this HW.

Yeah, but trying to make allowances ...

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).

Yes, but usually 2 wires to a 4-pin header, so it can't readily be connected backwards, likely to avoid shorts. Hmm ... maybe worth trying another speaker, maybe the piezo type?
 
It's about board manufacturer and what they opted for. I do have boards that don't have speaker but 4 leds indicating the error code. One Asus board I had had hex code display on board indicating error.


Frequency :). Setting it on PIT sets the fq by which speaker resonates = tone. You can't do polyfony, you can't adjust volume, etc. But you can fake some stuff. I once shared it here on forums: I created a player that played a tune from a cartoon with fake bass line.

I checked the Intels 500 series and it does include these timers. It could be that manufacturer did something to this board that BIOS is aware of and is able to beep properly.
I asked scilek for dmesg and sysctl output to verify proper fq is set by default. Playing around with those parameters while something keeps writing to /dev/speaker is worth checking out.

dmesg:
Code:
# dmesg
Copyright (c) 1992-2021 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 13.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC amd64
FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c)
VT(efifb): resolution 1024x768
CPU: Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz (2900.00-MHz K8-class CPU)
  Origin="GenuineIntel"  Id=0xa0653  Family=0x6  Model=0xa5  Stepping=3
  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0x7ffafbbf<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,SDBG,FMA,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND>
  AMD Features=0x2c100800<SYSCALL,NX,Page1GB,RDTSCP,LM>
  AMD Features2=0x121<LAHF,ABM,Prefetch>
  Structured Extended Features=0x29c67af<FSGSBASE,TSCADJ,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,NFPUSG,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PROCTRACE>
  Structured Extended Features2=0x40000000<SGXLC>
  Structured Extended Features3=0xbc000600<MCUOPT,MD_CLEAR,IBPB,STIBP,L1DFL,ARCH_CAP,SSBD>
  XSAVE Features=0xf<XSAVEOPT,XSAVEC,XINUSE,XSAVES>
  IA32_ARCH_CAPS=0x20c2b<RDCL_NO,IBRS_ALL,SKIP_L1DFL_VME,MDS_NO>
  VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID,VID,PostIntr
  TSC: P-state invariant, performance statistics
real memory  = 17179869184 (16384 MB)
avail memory = 16372449280 (15613 MB)
Event timer "LAPIC" quality 600
ACPI APIC Table: <ALASKA A M I >
FreeBSD/SMP: Multiprocessor System Detected: 12 CPUs
FreeBSD/SMP: 1 package(s) x 6 core(s) x 2 hardware threads
random: registering fast source Intel Secure Key RNG
random: fast provider: "Intel Secure Key RNG"
random: unblocking device.
ioapic0 <Version 2.0> irqs 0-119
Launching APs: 1 4 9 6 5 8 3 7 2 11 10
random: entropy device external interface
kbd0 at kbdmux0
WARNING: Device "spkr" is Giant locked and may be deleted before FreeBSD 14.0.
efirtc0: <EFI Realtime Clock>
efirtc0: registered as a time-of-day clock, resolution 1.000000s
smbios0: <System Management BIOS> at iomem 0x99b61000-0x99b6101e
smbios0: Version: 3.3, BCD Revision: 3.3
aesni0: <AES-CBC,AES-CCM,AES-GCM,AES-ICM,AES-XTS>
acpi0: <ALASKA A M I >
acpi0: Power Button (fixed)
cpu0: <ACPI CPU> on acpi0
hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 24000000 Hz quality 950
Event timer "HPET" frequency 24000000 Hz quality 350
Event timer "HPET1" frequency 24000000 Hz quality 340
Event timer "HPET2" frequency 24000000 Hz quality 340
Event timer "HPET3" frequency 24000000 Hz quality 340
Event timer "HPET4" frequency 24000000 Hz quality 340
Event timer "HPET5" frequency 24000000 Hz quality 340
Event timer "HPET6" frequency 24000000 Hz quality 340
Event timer "HPET7" frequency 24000000 Hz quality 340
attimer0: <AT timer> port 0x40-0x43,0x50-0x53 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1808-0x180b on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
vgapci0: <VGA-compatible display> port 0x6000-0x603f mem 0x6000000000-0x6000ffffff,0x4000000000-0x400fffffff at device 2.0 on pci0
vgapci0: Boot video device
xhci0: <Intel Tiger Lake-H USB 3.2 controller> mem 0x6001100000-0x600110ffff at device 20.0 on pci0
xhci0: 32 bytes context size, 64-bit DMA
usbus0 on xhci0
usbus0: 5.0Gbps Super Speed USB v3.0
pci0: <memory, RAM> at device 20.2 (no driver attached)
pci0: <serial bus> at device 21.0 (no driver attached)
pci0: <simple comms> at device 22.0 (no driver attached)
ahci0: <AHCI SATA controller> port 0x6090-0x6097,0x6080-0x6083,0x6060-0x607f mem 0xa0e00000-0xa0e01fff,0xa0e03000-0xa0e030ff,0xa0e02000-0xa0e027ff at device 23.0 on pci0
ahci0: AHCI v1.31 with 6 6Gbps ports, Port Multiplier not supported
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich1: <AHCI channel> at channel 1 on ahci0
ahcich2: <AHCI channel> at channel 2 on ahci0
ahcich3: <AHCI channel> at channel 3 on ahci0
ahcich4: <AHCI channel> at channel 4 on ahci0
ahcich5: <AHCI channel> at channel 5 on ahci0
ahciem0: <AHCI enclosure management bridge> on ahci0
pcib1: <ACPI PCI-PCI bridge> at device 27.0 on pci0
pci1: <ACPI PCI bus> on pcib1
nvme0: <Generic NVMe Device> mem 0xa0d00000-0xa0d03fff at device 0.0 on pci1
pcib2: <ACPI PCI-PCI bridge> at device 28.0 on pci0
pcib3: <ACPI PCI-PCI bridge> at device 28.7 on pci0
pci2: <ACPI PCI bus> on pcib3
re0: <Realtek PCIe 2.5GbE Family Controller> port 0x4000-0x40ff mem 0xa0c00000-0xa0c0ffff,0xa0c10000-0xa0c13fff at device 0.0 on pci2
re0: Using Memory Mapping!
re0: Using 1 MSI-X message
re0: ASPM disabled
re0: version:1.98.00
re0: Ethernet address: 58:11:22:d9:6c:04

This product is covered by one or more of the following patents:
US6,570,884, US6,115,776, and US6,327,625.
re0: Ethernet address: 58:11:22:d9:6c:04
pcib4: <ACPI PCI-PCI bridge> at device 29.0 on pci0
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
hdac0: <Intel (0xf0c8) HDA Controller> mem 0x6001110000-0x6001113fff,0x6001000000-0x60010fffff at device 31.3 on pci0
pci0: <serial bus> at device 31.5 (no driver attached)
acpi_button0: <Sleep Button> on acpi0
acpi_button1: <Power Button> on acpi0
acpi_tz0: <Thermal Zone> on acpi0
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: console (115200,n,8,1)
acpi_syscontainer0: <System Container> on acpi0
acpi_syscontainer1: <System Container> on acpi0
atrtc0: <AT realtime clock> at port 0x70 irq 8 on isa0
atrtc0: Warning: Couldn't map I/O.
atrtc0: registered as a time-of-day clock, resolution 1.000000s
Event timer "RTC" frequency 32768 Hz quality 0
atrtc0: non-PNP ISA device will be removed from GENERIC in FreeBSD 14.
coretemp0: <CPU On-Die Thermal Sensors> on cpu0
hwpstate_intel0: <Intel Speed Shift> on cpu0
hwpstate_intel1: <Intel Speed Shift> on cpu1
hwpstate_intel2: <Intel Speed Shift> on cpu2
hwpstate_intel3: <Intel Speed Shift> on cpu3
hwpstate_intel4: <Intel Speed Shift> on cpu4
hwpstate_intel5: <Intel Speed Shift> on cpu5
hwpstate_intel6: <Intel Speed Shift> on cpu6
hwpstate_intel7: <Intel Speed Shift> on cpu7
hwpstate_intel8: <Intel Speed Shift> on cpu8
hwpstate_intel9: <Intel Speed Shift> on cpu9
hwpstate_intel10: <Intel Speed Shift> on cpu10
hwpstate_intel11: <Intel Speed Shift> on cpu11
Timecounter "TSC-low" frequency 1452002340 Hz quality 1000
Timecounters tick every 1.000 msec
ZFS filesystem version: 5
ZFS storage pool version: features support (5000)
ugen0.1: <Intel XHCI root HUB> at usbus0
nvme0: Allocated 16MB host memory buffer
uhub0 on usbus0
uhub0: <Intel XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
nvd0: <TwinMOS SSD> NVMe namespace
nvd0: 244198MB (500118192 512 byte sectors)
hdacc0: <Realtek ALC897 HDA CODEC> at cad 0 on hdac0
hdaa0: <Realtek ALC897 Audio Function Group> at nid 1 on hdacc0
pcm0: <Realtek ALC897 (Rear Analog 5.1/2.0)> at nid 20,22,21 and 24,26 on hdaa0
pcm1: <Realtek ALC897 (Front Analog)> at nid 27 and 25 on hdaa0
pcm2: <Realtek ALC897 (Rear Digital)> at nid 30 on hdaa0
hdacc1: <Intel Kaby Lake HDA CODEC> at cad 2 on hdac0
hdaa1: <Intel Kaby Lake Audio Function Group> at nid 1 on hdacc1
pcm3: <Intel Kaby Lake (HDMI/DP 8ch)> at nid 3 on hdaa1
ses0 at ahciem0 bus 0 scbus6 target 0 lun 0
ses0: <AHCI SGPIO Enclosure 2.00 0001> SEMB S-E-S 2.00 device
ses0: SEMB SES Device
Trying to mount root from zfs:zroot/ROOT/default []...
uhub0: 22 ports with 22 removable, self powered
Root mount waiting for: usbus0
ugen0.2: <Logitech USB Receiver> at usbus0
ukbd0 on uhub0
ukbd0: <Logitech USB Receiver, class 0/0, rev 2.00/23.01, addr 1> on usbus0
kbd1 at ukbd0
ugen0.3: <ASUS TEK. ASM107x> at usbus0
uhub1 on uhub0
uhub1: <ASUS TEK. ASM107x, class 9/0, rev 2.10/0.01, addr 2> on usbus0
uhub1: MTT enabled
Root mount waiting for: usbus0
uhub1: 4 ports with 4 removable, self powered
ugen0.4: <AsusTek Computer Inc. AURA LED Controller> at usbus0
Root mount waiting for: usbus0
ugen0.5: <vendor 0x05e3 USB2.0 Hub> at usbus0
uhub2 on uhub0
uhub2: <vendor 0x05e3 USB2.0 Hub, class 9/0, rev 2.00/60.90, addr 4> on usbus0
uhub2: 4 ports with 4 removable, self powered
Root mount waiting for: usbus0
ugen0.6: <Logitech USB Optical Mouse> at usbus0
ugen0.7: <ASUS TEK. ASM107x> at usbus0
uhub3 on uhub0
uhub3: <ASUS TEK. ASM107x, class 9/0, rev 3.00/0.01, addr 6> on usbus0
Root mount waiting for: usbus0
uhub3: 4 ports with 4 removable, self powered
Dual Console: Serial Primary, Video Secondary
acpi_wmi0: <ACPI-WMI mapping> on acpi0
acpi_wmi0: cannot find EC device
acpi_wmi0: Embedded MOF found
ACPI: \134AWW0.WQMO: 1 arguments were passed to a non-method ACPI object (Buffer) (20201113/nsarguments-361)
acpi_wmi1: <ACPI-WMI mapping> on acpi0
acpi_wmi1: cannot find EC device
acpi_wmi1: Embedded MOF found
ACPI: \134ATW0.WQMO: 1 arguments were passed to a non-method ACPI object (Buffer) (20201113/nsarguments-361)
acpi_wmi2: <ACPI-WMI mapping> on acpi0
acpi_wmi2: cannot find EC device
acpi_wmi2: Embedded MOF found
ACPI: \134ABAW.WQMO: 1 arguments were passed to a non-method ACPI object (Buffer) (20201113/nsarguments-361)
acpi_wmi3: <ACPI-WMI mapping> on acpi0
acpi_wmi3: cannot find EC device
acpi_wmi3: Embedded MOF found
ACPI: \134RMTW.WQMO: 1 arguments were passed to a non-method ACPI object (Buffer) (20201113/nsarguments-361)
acpi_wmi4: <ACPI-WMI mapping> on acpi0
acpi_wmi4: cannot find EC device
acpi_wmi4: Embedded MOF found
ACPI: \134_SB.WFDE.WQCC: 1 arguments were passed to a non-method ACPI object (Buffer) (20201113/nsarguments-361)
acpi_wmi5: <ACPI-WMI mapping> on acpi0
acpi_wmi5: cannot find EC device
acpi_wmi5: Embedded MOF found
ACPI: \134_SB.WFTE.WQCC: 1 arguments were passed to a non-method ACPI object (Buffer) (20201113/nsarguments-361)
ig4iic0: <Intel Tiger Lake-H I2C Controller-1> at device 21.0 on pci0
ig4iic0: Using MSI
iicbus0: <Philips I2C bus (ACPI-hinted)> on ig4iic0
ichsmb0: <Intel Tiger Lake SMBus controller> port 0xefa0-0xefbf mem 0x6001118000-0x60011180ff at device 31.4 on pci0
smbus0: <System Management Bus> on ichsmb0
lo0: link state changed to UP
re0: link state changed to UP
ums0 on uhub0
ums0: <Logitech USB Receiver, class 0/0, rev 2.00/23.01, addr 1> on usbus0
ums0: 16 buttons and [XYZT] coordinates ID=2
uhid0 on uhub0
uhid0: <AsusTek Computer Inc. AURA LED Controller, class 0/0, rev 2.00/1.00, addr 3> on usbus0
ums1 on uhub0
ums1: <Logitech USB Optical Mouse, class 0/0, rev 2.00/72.00, addr 5> on usbus0
ums1: 3 buttons and [XYZ] coordinates ID=0
#


sysctl:
Code:
# sysctl -A | grep 8254
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
kern.timecounter.choice: TSC-low(1000) ACPI-fast(900) i8254(0) HPET(950) dummy(-1000000)
kern.timecounter.tc.i8254.quality: 0
kern.timecounter.tc.i8254.frequency: 1193182
kern.timecounter.tc.i8254.counter: 26655
kern.timecounter.tc.i8254.mask: 65535
kern.eventtimer.choice: LAPIC(600) HPET(350) HPET1(340) HPET2(340) HPET3(340) HPET4(340) HPET5(340) HPET6(340) HPET7(340) i8254(100) RTC(0)
kern.eventtimer.et.i8254.quality: 100
kern.eventtimer.et.i8254.frequency: 1193182
kern.eventtimer.et.i8254.flags: 1
vfs.bufspacethresh: 1658254537
machdep.i8254_freq: 1193182
#
 
sysctl:
Code:
# sysctl -A | grep 8254
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
kern.timecounter.choice: TSC-low(1000) ACPI-fast(900) i8254(0) HPET(950) dummy(-1000000)
kern.timecounter.tc.i8254.quality: 0
kern.timecounter.tc.i8254.frequency: 1193182
kern.timecounter.tc.i8254.counter: 26655
kern.timecounter.tc.i8254.mask: 65535
kern.eventtimer.choice: LAPIC(600) HPET(350) HPET1(340) HPET2(340) HPET3(340) HPET4(340) HPET5(340) HPET6(340) HPET7(340) i8254(100) RTC(0)
kern.eventtimer.et.i8254.quality: 100
kern.eventtimer.et.i8254.frequency: 1193182
kern.eventtimer.et.i8254.flags: 1
vfs.bufspacethresh: 1658254537
machdep.i8254_freq: 1193182
#

Normal.
 
It's about board manufacturer and what they opted for. I do have boards that don't have speaker but 4 leds indicating the error code.

Ok; too many years ago for me.

Frequency :). Setting it on PIT sets the fq by which speaker resonates = tone. You can't do polyfony, you can't adjust volume,

I've just rebrowsed spkr.c, from ESR's original 1993 code, no less. More PWM intervals than direct freqs, but effectively.

etc. But you can fake some stuff. I once shared it here on forums: I created a player that played a tune from a cartoon with fake bass line.

What fun, simple pleasures.

I checked the Intels 500 series and it does include these timers. It could be that manufacturer did something to this board that BIOS is aware of and is able to beep properly.

All PC-compatible systems, i386 or amd64, have i8254s. Or at least I've not heard of any without ... at bottom line the i8254 (port 1) can be an event timer or even timecounter, as the sysctls reveal.

I asked scilek for dmesg and sysctl output to verify proper fq is set by default. Playing around with those parameters while something keeps writing to /dev/speaker is worth checking out.

Well if nothing else, dmesg shows it uses snd_hda, so if there are audio speaker(s) attached, presumably spkrtest and % echo $string >/dev/speaker will work as it does on laptops using snd_hda - with volume control via 'mixer speaker'!
 
Well if nothing else, dmesg shows it'l uses snd_hda, so if there are audio speaker(s) attached, presumably spkrtest and % echo $string >/dev/speaker will work as it does on laptops using snd_hda - with volume control via 'mixer speaker'!
Just connected stereo headphones, but got nothing.
 
Don't know if this can help, but beep(1) have options to modify frequency, output gain and duration (among others).
This:
beep -D 800 -F 830 -g 85
gives me a beep similar to the one I get when accessing BIOS settings.
Of course, getting a melody this way is not exactly easy...
 
Don't know if this can help, but beep(1) have options to modify frequency, output gain and duration (among others).
This:
beep -D 800 -F 830 -g 85
gives me a beep similar to the one I get when accessing BIOS settings.
Of course, getting a melody this way is not exactly easy...
Now that gives me something from the left channel. It is not loud enough but that could be taken care of.

I could solder the speaker to a stereo jack and make this work.

Where can I find some good music?
 
Just connected stereo headphones, but got nothing.

Are tou getting normal headphones output playing other audio? Mixer speaker at high level? igain, ogain > 0?

Please try providing as much info as you can each time, it's tedious always having to ask.
 
Are tou getting normal headphones output playing other audio? Mixer speaker at high level? igain, ogain > 0?
I did this:
[CMD# mixer igain 100:100[/CMD]
and can't hear anything anymore.

Please try providing as much info as you can each time, it's tedious always having to ask.
Sorry, but I am not knowledgeable in this particular subject. I am trying to find my way around in the dark and things occur to me only when the good people of the FreeBSD world mention them.
 
And the "Imperial March" of Star Wars ;)
This was slightly modified however: since FreeBSD's beep(1) can't handle a duration inferior to 50ms, the 25ms tones duration was increased to 50ms to make the script work.
 

Attachments

You could try setting the output gain (-g) to 100.
As for music, I found this (don't recall exactly where) on the Internet: the "Mission Impossible" theme, made of "beeps" :)
That didn't sound anything like "Mission Impossible" theme to me, but worked anyway.

Now all I have to do is find something that gives one the feeling of booting up and another shutting down.
 
All PC-compatible systems, i386 or amd64, have i8254s. Or at least I've not heard of any without ... at bottom line the i8254 (port 1) can be an event timer or even timecounter, as the sysctls reveal.
Back in the days it was even used as a source of primary tick. Nowadays you have i8254 compatible ones in chipsets or in SoC. But we are talking about its channel 2 (connected to pc speaker) which could be left disconnected (or better to say non existent) in its implementation.

Now that gives me something from the left channel. It is not loud enough but that could be taken care of.
That means that you don't have PC speaker but some sort of speaker that is connected to sound card. And most likely BIOS uses it too.

For the sake of test just play around and set the fq to something bogus: sysctl machdep.i8254_freq=10. Try to write to /dev/speaker again. Try some other frequencies in orders of 10s (100, 1000, etc..). Does it make any difference ?
 
For the sake of test just play around and set the fq to something bogus: sysctl machdep.i8254_freq=10. Try to write to /dev/speaker again. Try some other frequencies in orders of 10s (100, 1000, etc..). Does it make any difference ?

Just tried 10, 100, 1000 and 10000. All with the same clicking sounds.
 
Thanks for the confirmation. You don't have PC speaker connected to PIT timer. Unfortunately it's impossible to troubleshoot this over the distance. But I see you were able to get sound out of that speaker, so I guess all good.
 
Thanks for the confirmation. You don't have PC speaker connected to PIT timer. Unfortunately it's impossible to troubleshoot this over the distance. But I see you were able to get sound out of that speaker, so I guess all good.
Yes, thank you all. I will buy a stereo jack, solder a speaker to the left channel, and try to find something suitable to indicate system boot-up and shutdown. Do you happen to know anywhere I can come by anything of the sort?
 
Where do you get these?
I don't recall, since some years have passed, but you can find some here: https://github.com/JoshuaCurry/linux-beep-tunes. The scripts contain even the link from where they were found. However, a research with your favourite search engine for "linux beep music" or "linux beep themes" should give you more results.

P.S.
Remember to adapt these for FreeBSD's beep(1). Some switches just corresponds to different ones (i.e. on Linux -l is used to set the duration, while on FreeBSD is -D), while others (-n) don't exist. Don't know if audio/beep differs and is option-per-option compatible with Linux's one.
 
I don't recall, since some years have passed, but you can find some here: https://github.com/JoshuaCurry/linux-beep-tunes. The scripts contain even the link from where they were found. However, a research with your favourite search engine for "linux beep music" or "linux beep themes" should give you more results.

P.S.
Remember to adapt these for FreeBSD's beep(1). Some switches just corresponds to different ones (i.e. on Linux -l is used to set the duration, while on FreeBSD is -D).

Already done that, but unfortunately it seems the differences go a little deeper. But I'll find a way. Thank you.
 
Back
Top