Sound Problems

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Uranium
Posts: 16
Joined: Fri Jul 04, 2008 8:00 am

Sound Problems

Post by Uranium »

Ok, I know how to program the PC Speaker to make basic noises, most people do. But I don't want it to interfere with the PIT timer. Which basically rules out the PC Speaker as a method for playing sounds.

Also, I don't want to have to write a shed load of sound card drivers for all the different types of sound cards there are out there (SoundBlaster, SoundBlaster 16, SoundBlaster AWE32, SoundBlaster AWE64 etc...).

What is a simple solution for playing basic WAV files that will work on all/most computers with a sound card?

Volume control would also be nice, and I don't want it to interfere with the PIT or the RTC.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Sound Problems

Post by AJ »

Uranium wrote:Ok, I know how to program the PC Speaker to make basic noises, most people do. But I don't want it to interfere with the PIT timer. Which basically rules out the PC Speaker as a method for playing sounds.
PIT channel 2 is discrete from channel 0, so there shouldn't be much of a problem there.
Also, I don't want to have to write a shed load of sound card drivers for all the different types of sound cards there are out there (SoundBlaster, SoundBlaster 16, SoundBlaster AWE32, SoundBlaster AWE64 etc...).

What is a simple solution for playing basic WAV files that will work on all/most computers with a sound card?
I think you are out of luck there - it's a case of a separate driver for each sound card. A lot of cards used to provide soundblaster emulation - if that's still the case, it would be a good starting point. I think there is even a VESA sound specification, but IIRC not many BIOS/Sound card manufacturers bothered implementing it.

Cheers,
Adam
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: Sound Problems

Post by Dex »

You have just hit one of the reason why there is not a shed load of OS, it's impossible to code all available drivers.
Your best start with the most common (eg: in this case AC97) also once you have a USB stack you could use that as more people use usb speakers or headphones eg:
http://board.flatassembler.net/topic.ph ... sc&start=0
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: Sound Problems

Post by bewing »

AFAIK there is an 8 bit "legacy mode" Soundblaster emulation that all cards support? Including other soundblasters.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Sound Problems

Post by Combuster »

I thought of that, practically all old dos games I have run on my SB 64, and depending on the game I have to select one of the soundblaster settings it has (SB 16, SB pro, SB clone) to get it working for that exact program (which differs!) so there must be some similarity between the various soundblaster chips...

The question would be where that similarity ends...
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Omega
Member
Member
Posts: 250
Joined: Sun May 25, 2008 2:04 am
Location: United States
Contact:

Re: Sound Problems

Post by Omega »

Sorry to hijack the thread, but why not support existing drivers? I mean how does Windows do it. You just install the hardware suitable for your MB/OS, install the drivers that came with the device, and your done. So, why aren't people just doing that? I think that you might try PnP too, could that work or perhaps a default set of values that work on a broad set of drivers? I think an OS should just support what is guaranteed and PnP everything else. Is this suggestion just harder than it sounds or am I way off and proving I have no idea what I am talking about?
Free energy is indeed evil for it absorbs the light.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Sound Problems

Post by Combuster »

And implement the entire linux kernel interface, or worse, windows'

Bad Idea (tm)
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Omega
Member
Member
Posts: 250
Joined: Sun May 25, 2008 2:04 am
Location: United States
Contact:

Re: Sound Problems

Post by Omega »

So, it is a matter of being too involving rather than impossible?
Free energy is indeed evil for it absorbs the light.
Uranium
Posts: 16
Joined: Fri Jul 04, 2008 8:00 am

Re: Sound Problems

Post by Uranium »

For something which is designed to fit on a floppy disk, support for ever different kind of sound card would be impossible and take hundreds of hours of work. Most of these things are poorly documented anyway.
User avatar
Omega
Member
Member
Posts: 250
Joined: Sun May 25, 2008 2:04 am
Location: United States
Contact:

Re: Sound Problems

Post by Omega »

Well you can't be everything to everyone. I suggest you go with what is popular and code for that. It isn't like many people will have floppy drives before long anyway.
Free energy is indeed evil for it absorbs the light.
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: Sound Problems

Post by jal »

Combuster wrote:so there must be some similarity between the various soundblaster chips... The question would be where that similarity ends...
Of course there's many similarity between the chips, it would be silly for them not to do that. Besides that, there's plenty of programming information available for the older chips.


JAL
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: Sound Problems

Post by Dex »

NOTE: SB compatibility is of little uses, why because all cards that are SB compatible unless they are old cards, have the SB compatibility turned off as default, and the way you enable them is different for each card, so your back to square one.
Uranium
Posts: 16
Joined: Fri Jul 04, 2008 8:00 am

Re: Sound Problems

Post by Uranium »

Omega: It is for a games console, not a proper operating system.
User avatar
Omega
Member
Member
Posts: 250
Joined: Sun May 25, 2008 2:04 am
Location: United States
Contact:

Re: Sound Problems

Post by Omega »

Oh, right on, my fault. :oops:
Free energy is indeed evil for it absorbs the light.
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: Sound Problems

Post by jal »

Uranium wrote:Omega: It is for a games console, not a proper operating system.
I'm not sure I'd call dexos "not a proper operating system" though...


JAL
Post Reply