Hello

I have a problem enumerating soundcards in DirectSound.
I get the strings and guids of the soundcards but when I try open it with the DirectSoundCreate function, I get an error. (DSERR_NODRIVER)


lea esi,SoundCardGuids
mov eax,SoundCardNr
shl eax,4
add eax,esi

invoke DirectSoundCreate,eax,addr g_pDS,NULL

Who can tell me to do it the right way ?

Here are the sources:
Attachments:
Posted on 2009-05-26 10:04:57 by Siekmanski
Siekmanski,

In the following topic:

http://board.flatassembler.net/topic.php?t=6990

I posted a number of versions of a program the selects the input and output sound devices to record sound and then play it back.  The program selects hardcoded devices: IMic sound card USB device for recording, and my notebooks onboard speakers for playback, but you can see how I select these in the DSEcallback rourine.

It uses the fasm, but other than the cominvk macro, the code should be easy to use with any assembler.

hth,

farrier
Posted on 2009-05-26 17:23:01 by farrier
FYI: DirectSound is deprecated.
Posted on 2009-05-26 21:01:07 by ti_mo_n
Thanks farrier  :D

I'll have a look at your code, so I can do it the right way.

@ti_mo_n

Do you mean I should go for XAudio2 or do you have an other suggestion ?
Posted on 2009-05-27 02:50:14 by Siekmanski
Solved !!!!!

Thanks farrier.

My approach was wrong.......

Here's the working version
Attachments:
Posted on 2009-05-27 05:44:45 by Siekmanski
Siekmanski,

Glad I could help!

I'm not sure what ti_mo_n was trying to say.  There are other audio recording/playback systems, but DirectX/DirectSound is still used extensively.  ti_mo_n, come back and be enlightening!

farrier
Posted on 2009-05-27 09:30:24 by farrier
Direct Sound may be used but it's officially deprecated. It's not going to be updated, it's not hardware accelerated on Vista and it's planned to be dropped completely as of Windows 7 (but I guess there will still be some compatibility mode). Additionally, DirectSound is not available on Windows CE.

If you're asking about alternatives: I highly suggest using openAL - it's easy, fast, hardware accelerated and amazing :) And, additionally, it's strongly supported by Creative so it allows you to play extra nicely with Sound Blaters. Its new "Effects API" or "EFX" is extremely straightforward. You can have 3d audio with EAX5.0 effects with ~10 simple api calls.

Another alternative is what Microsoft suggests: XACT/Xaudio/Xaudio2. It's about equally powerful, while being much easier to use (you get a WYHIWYG-type tool for audio creation). The cost is that it's not hardware accelerated at all.

Both XACT and OpenAL support XBOX360.
Posted on 2009-05-27 19:56:24 by ti_mo_n
If he's enumerating soundcards, then it's certainly not for games but for synths. (otherwise you'd just ask DSound for default device)
If it's for synths, only latency, bitdepth and stereo matter. For that, ASIO is the only choice. It's not available on mobo-integrated crap, so a DSound fallback is needed for temporary toying around with the app.

In my experience and what I've read from others, Creative are notorious for drivers. It took them many years to make their stuff not crash every now and then; afaik they still can't figure-out how to use 2-3 of their cards in one PC for multichannel recording. Btw one can BSOD a PC with a certain misuse of ASIO :) . I've had enough crashes with openAL on different Audigies until recently, too. Then, different Audigies have their effects sounding different.

x360 is barely an incentive, it's only an incense (rrod). Or a C# playground.
Posted on 2009-05-27 23:50:47 by Ultrano
Hello guys

Where can I get the SDK for ASIO ?

The reason I need to enumerate soundcards is that I bought a second soundcard.
I needed one that can sample at 192 KHz and does not filter the the output signal.
( M-Audio Audiophile 192 does the job )

My goal is to make a software FM stereo MPX signal with RDS.

So I can transmit in Stereo and radio-text trough a simple MONO FM-Transmitter

BTW, does someone of you know how to make a good FIR-filter ?
Posted on 2009-05-28 02:24:41 by Siekmanski
it seems my thread about it here is lost, but here's my ISound "lib", to interface ASIO:

Funny, I don't have ASIO right now to test it - must be some fluke drivers Creative published for my cheapo Audigy.

P.S. ASIO generally enforces you to use one of the native samplerates (usually 48kHz iirc), and possibly data-formats (bit-depths). Anyway, you can get the SDK from http://www.steinberg.net/en/company/3rd_party_developer.html  (requires free registration)
Attachments:
Posted on 2009-05-28 12:01:15 by Ultrano
You can download the ASIO SDK for free from http://www.steinberg.net/en/company/3rd_party_developer.html
I think you need to register as a developer first though.
I downloaded it a few years ago, not entirely sure how it went, but it didn't cost any money anyway, and I never got spammed :)
Posted on 2009-05-28 12:01:37 by Scali
Thanks Ultrano, for the sources

Nice way to select between: Simple (Bush) and Advanced (Einstein)  :lol:

I've also downloaded the ASIO-SDK from www.steinberg.net
Posted on 2009-05-28 15:31:58 by Siekmanski