[wdmaudiodev] AW: Re: AW: Re: DirectKS Problem on some machines

  • From: "Patrick Pfeifer" <patrick_pfeifer@xxxxxxxx>
  • To: <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Tue, 15 Feb 2005 14:43:20 +0100

I did try with 48000 Hz. I open the output pin AFTER the input one, so there
can't be any complication, anyway the output uses the same format as the
input...


-----Ursprüngliche Nachricht-----
Von: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] Im Auftrag von Stephan Kappertz
Gesendet: Dienstag, 15. Februar 2005 14:37
An: wdmaudiodev@xxxxxxxxxxxxx
Betreff: [wdmaudiodev] Re: AW: Re: DirectKS Problem on some machines

Did you try 48 kHz? Some audio devices are fixed to 48 kHz sampling 
rate. Also make sure that you open the input pin at the same rate as the 
output pin (if you open both). Not every audio device has independent 
sample clocks for input and output.

- Stephan


Patrick Pfeifer wrote:
> Already tried. No result. --> "Error: No pins available for capturing. hr
=
> 0x00000000"
> 
> Why is that? Capture Filters are found beforehand. Rendering instantiates
> correctly, too.
> 
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: wdmaudiodev-bounce@xxxxxxxxxxxxx
> [mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] Im Auftrag von Jerry Evans
> Gesendet: Dienstag, 15. Februar 2005 13:24
> An: wdmaudiodev@xxxxxxxxxxxxx
> Betreff: [wdmaudiodev] Re: DirectKS Problem on some machines
> 
> Have you tried opening them in stereo ? My AC97 and Creative hardware
fails 
> in mono mode.
> 
> wfx.Format.nChannels = 2;
> wfx.dwChannelMask = 0;
> 
> ----- Original Message ----- 
> From: "Patrick Pfeifer" <patrick_pfeifer@xxxxxxxx>
> To: <wdmaudiodev@xxxxxxxxxxxxx>
> Sent: Tuesday, February 15, 2005 11:56 AM
> Subject: [wdmaudiodev] DirectKS Problem on some machines
> 
> 
> Hello!
> 
> I implemented a low latency audio I/O streaming using the DirectKS
sources.
> Finally on some machines (with old soundcards, as well as on PC's with new
> hardware, so I don't think it is a driver problem) that have a
> wdm-audio-driver, I can't get any capture pins (finding appropriate pins
for
> rendering instead is no problem), although capturing filters have been
> found. Why can't I get these capture pins in this simple format (see
below)
> if appropriate capturing filters are indeed available?
> 
> Help would be greatly appreciated.
> 
> Thank you!
> 
> 
> As I said, on some machines, this works perfectly well and capable capture
> pins are found without problems:
> 
> 
> ...
> 
> GUID  aguidEnumCats[] = { STATIC_KSCATEGORY_AUDIO ,
> STATIC_KSCATEGORY_CAPTURE};
> 
>   hr =
>       pEnumerator->EnumFilters
>       (
>   eAudCap,            // create audio capture filters ...
>         aguidEnumCats,      // ... of these categories
>         2,                  // There are 2 categories
>         TRUE,               // While you're at it, enumerate the pins
>         FALSE,              // ... but don't bother with nodes
>         TRUE               // Instantiate the filters
>        );
> 
> ThrowOnFail(hr, "CKsEnumFilters::EnumFilters failed");
> 
> 
> 
> bool failed=1;
> 
> while(failed && !pEnumerator->m_listFilters.IsEmpty())
> {
> failed=0;
> pEnumerator->m_listFilters.GetHead((CKsFilter**)&_pFilter);
> ThrowOnNull(_pFilter, "No filters available for capturing");
> 
> // instantiate the pin as 16bit, 48KHz, stereo
> // use WAVEFORMATEXTENSIBLE to describe wave format
> WAVEFORMATEXTENSIBLE wfx;
> wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
> wfx.Format.nChannels = 1;
> wfx.Format.nSamplesPerSec = 44100;
> wfx.Format.nBlockAlign = 2;
> 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_MONO;
> wfx.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
> 
> 
> _pPin = _pFilter->CreateCapturePin(&wfx.Format, TRUE);
> if (!_pPin)
> _pPin = _pFilter->CreateCapturePin(&wfx.Format,
> FALSE);
> 
> if (!_pPin)
> {
> 
> // driver can't handle WAVEFORMATEXTENSIBLE, so fall
> back // to WAVEFORMATEX format descriptor and try again
> wfx.Format.wFormatTag = WAVE_FORMAT_PCM;
> // set unused members to zero
> wfx.Format.cbSize = 0;
> wfx.Samples.wValidBitsPerSample = 0;
> wfx.dwChannelMask = 0;
> wfx.SubFormat = GUID_NULL;
> 
> _pPin = _pFilter->CreateCapturePin(&wfx.Format,
> TRUE);
> if (!_pPin)
>        _pPin = _pFilter->CreateCapturePin(&wfx.Format, FALSE);
> }
> 
> if (_pPin==NULL)
> {
> pEnumerator-
> 
>>m_listFilters.RemoveHead((CKsFilter**)&_pFilter);
> 
> failed=1;
> }
> }
> 
> ThrowOnNull(_pPin, "No pins available for capturing");
> if (_pPin!=NULL)
> cout << "Capturing filter and pin found. " << endl;
> 
> ...
> 
> 
> ******************
> 
> 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.de/
> 
> ******************
> 
> 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.de/
> 
> 
> ******************
> 
> 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.de/
> 
> 


-- 
Stephan Kappertz
M-Audio - an Avid Technology Company
Muensterplatz 1
55116 Mainz, Germany
++49 6131 669910
******************

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.de/


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

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.de/

Other related posts: