VOGONS


PC Speaker Passthrough?

Topic actions

First post, by Yushatak

User metadata
Rank Member
Rank
Member

If I'm not mistaken, DOSBox currently emulates the PC speaker, right?

It sounds a bit off, when compared to a real one, because full range speakers are very different to the PC speaker (you can adjust speakers to make them sound right, but for games that use both that and Adlib for example, it then makes the Adlib sound wrong). It's great that we emulate that, as the speaker is slowly going away, but for machines that still have one, it would be nice if DOSBox could pass the signals to it for a more authentic reproduction of sound effects and PC speaker music.

Is this a feasible thing, or is the PC speaker heavily abstracted like other hardware on Win32? I'm not sure, to be honest, since it's such an innocuous device.

Reply 1 of 12, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I prefer fixing the pc speaker emulation.

Water flows down the stream
How to ask questions the smart way!

Reply 2 of 12, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I prefer fixing the pc speaker emulation.

Imo this is the only feasible thing anyways since all platforms benefit from it.
You never know if "passthrough" is even possible on next gen windows architectures either

Reply 3 of 12, by Yushatak

User metadata
Rank Member
Rank
Member

That's a valid point, wd, but I think that at least for one further generation we'll have the same ARC name translation to low-level devices.. Who knows what hardware will be like in another few years, though, and software will follow it - it may well be impossible then, you're right, and by then there may well be not even as much as a beeper. Still a good option for current and older machines, though - DOSBox can run on P3s and such, after all. If the emulation can compensate, though, my idea is irrelevant, as Qbix suggests.

Qbix: How can you compensate for full-range speakers in software? I didn't think that was possible. The only solution I can think of is using separate outputs on the sound card, or separate sound cards, for each output device in DOSBox and allowing you to select output devices for different device emulations - i.e., PC Speaker goes from Line Out while SB16 sound goes through Speaker Out, etc. You can then hook up appropriate speakers or appropriately adjusted speakers for the PC Speaker output - still partially a hardware solution, though..

Reply 4 of 12, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

pc speakers are just still in current pcs because manufacturers like to denote
failure through it. May be sooner or later removed, who knows. Don't see any reason
to spend any time with this, but nobody will hold you off. Hope you enjoy those
pc-speaker games enough that it's worth for you.

Reply 5 of 12, by Yushatak

User metadata
Rank Member
Rank
Member

Well, a surprisingly large number of games use PC speaker for sound effects and Adlib for music. I was just curious if it was feasible, really, and since you guys don't seem to think it worth the effort nor future-proof, I don't see a reason to spend time pursuing it.

Thanks for the input, guys.

Oh and Qbix, if you do have some kind of idea about getting the PC Speaker to sound right on full-range speakers, please tell - I'm curious.

Reply 6 of 12, by butterfly

User metadata
Rank Member
Rank
Member

I'm not sure but don't VirtualPC and VMWare have that feature?

Reply 7 of 12, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

what is so special about that full range that you keep mentioning ?
a pc speaker is a bit of an odd thing, but I don't see impossibilities in emulating it. In fact the current code isn't very bad, although changing the hooked timer could get some updates and the rise and drop functions could get a better shape.

Water flows down the stream
How to ask questions the smart way!

Reply 8 of 12, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The small paper cone speakers in DOS-era PCs weren't exactly hifi (modern piezoelectric buzzers are even worse), but maybe running the output through a lo/hi-pass filter might make the sound more "authentic" by cutting out the frequencies that were not originally audible.

Would take more host CPU to do, but maybe it could be done relatively inexpensively (integer FFT?) considering it doesn't have to be high quality. But before going that far, take a wave capture of the current output and process it in an audio editor to see if a lo/hi-pass filter is the desired effect.

Reply 9 of 12, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie
Qbix wrote:

what is so special about that full range that you keep mentioning ?

According to an audio engineer friend of mine...must be real big speakers.
Other than that, he probably refers to modern speakers with high, mid and low frequency outputs (though, they may not be full range in the end in the real world)

Reply 10 of 12, by rfnagel

User metadata
Rank Oldbie
Rank
Oldbie

Connect the output of your sound card to one (or two) of those old-school PC buzzers... problem solved <grin>! 😀

Rich ¥Weeds¥ Nagel
http://www.richnagel.net

Reply 11 of 12, by leileilol

User metadata
Rank l33t++
Rank
l33t++
ripsaw8080 wrote:

Would take more host CPU to do, but maybe it could be done relatively inexpensively (integer FFT?) considering it doesn't have to be high quality. But before going that far, take a wave capture of the current output and process it in an audio editor to see if a lo/hi-pass filter is the desired effect.

That'd be interesting if there was a 'speaker type/position/case material' setting and it'd be even more interesting to make it work with HRTF so you can use your 5.1 system to mock the position of your computer for the pc speaker sound.

apsosig.png
long live PCem

Reply 12 of 12, by digistorm

User metadata
Rank Member
Rank
Member

Why would you want to use your onboard speaker? If you want authenticity, it will not help you because the current onboard buzzers are no comparison to the tiny-but-real speakers in the PCs of the old days. If you really want to, you can measure the frequency response of a typical PC speaker of the old days (they are also found in old pocket transistor radios) and calculate an impulse response for it. Should not be too hard to implement (can be found all over the net) and when done right is relatively cpu friendly.