[wdmaudiodev] Re: Capture audio from USB Audio Device on XP (SP2)

  • From: Audiodev <audiodev@xxxxxxxxxxxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Wed, 15 Feb 2006 08:55:34 +0100

Hi Edwin,

did the latest hints from Jerry solve your problem?

As soon as reading your EMails and testing a new USB device I found out
that I use ks exactly in the same way when considering the procedure to open the capture pin and
get the same results, output works well, input does not.
Also the ideas from Jerry did not make any difference.


Did you try your software with a lot of audio interfaces?
I have seen that capturing works with some USB devices but with the one that I am currently working with it does not.


I use it in a way to flush 2 or more buffers (index 0..1 for two buffers) to the hardware waiting for an event to be notified, one event
associated to each buffer ( handles, in manualReset = false, that is probably what you call asynchronous..).


My problem is that the first input buffer (index 0) is fine but after that the hardware seems to not continue capturing anymore.
Also the GetPosition(...) function of the pin does always return the same value after the first buffer.
My idea was that I pass the buffer to the hardware and the handle is notified as soon as the buffer is filled but with the USB device the
buffer handle is notified in the moment when the buffer has been passed.


When switching to the PCI device, the buffers are reported the first and then the second (index 0 and then index 1),
then the first again (index 0) and so on.
Also the GetPosition(...) function returns continuously increasing values. In other word: It works well.


Best Regards,
Hauke



Edwin van den Oosterkamp wrote:

Hello Jerry,

Thank you for your reply.

This is what I am currently using in my code:

WAVEFORMATEX wfx;
memset( &wfx, 0, sizeof( WAVEFORMATEX ) );
wfx.wFormatTag          = WAVE_FORMAT_PCM;
wfx.nChannels           = m_CardNumChannels;
wfx.nSamplesPerSec      = m_CardSamplerate;
wfx.nBlockAlign         = wfx.nChannels * 2;
wfx.nAvgBytesPerSec     = wfx.nSamplesPerSec * wfx.nBlockAlign;
wfx.wBitsPerSample      = 16;

Where m_CardNumChannels has been 1 and 2 and m_CardSamplerate has been 48000 
and 44100.

I've also tried the following:

WAVEFORMATEXTENSIBLE wfx;
wfx.Format.wFormatTag           = WAVE_FORMAT_EXTENSIBLE;
wfx.Format.nChannels            = 2;
wfx.Format.nSamplesPerSec       = m_CardSamplerate;
wfx.Format.nBlockAlign          = 4;
wfx.Format.nAvgBytesPerSec      = wfx.Format.nSamplesPerSec * 
wfx.Format.nBlockAlign;
wfx.Format.wBitsPerSample       = 16;
wfx.Format.cbSize               = 
sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX);
wfx.Samples.wValidBitsPerSample = 16;
wfx.dwChannelMask               = KSAUDIO_SPEAKER_STEREO;
wfx.SubFormat                   = KSDATAFORMAT_SUBTYPE_PCM;

Without much luck unfortunately... Did not try this one in mono to be honest.

What are the settings you recommend?

Best regards,

Ing. Edwin van den Oosterkamp
R&D, MDO UK



Hi Edwin


I've got DirectKS audio working over a variety of USB devices on Win2k and WinXP SP1/SP2.

When you create your capture pin what subformat and channelmask do you use?


Jerry ******************

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.com/







******************

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.com/

Other related posts: