[wdmaudiodev] Re: Building an USB audio interface with a PIC18F4550

  • From: DJ Sisolak <dsisolak@xxxxxxxxxxxxxxxxxxxxxx>
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Wed, 28 Mar 2007 13:52:57 -0700

Hi Elios Elios Elios,

The USB Audio driver is just like any other audio driver in the system. You may 
access it through the usual audio APIs as you would any other audio device such 
as the wave APIs you mention below.

Cheers,
DJ Sisolak
Microsoft Corp.

From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Elios Elios Elios
Sent: Wednesday, March 28, 2007 9:57 AM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: Building an USB audio interface with a PIC18F4550


Hello, thanks very much!

At the end we are making our USB Device an USB Audio Class Compliant ... but 
now we have some questions...

- Can I use my USB Device (USB Audio Class Compliant) with winmm.dll? If not... 
Which DLL should I use for that porpouse?

I've controlled my soundcard with this DLL, but I don't know if I could access 
to the driver USBAudio.sys... In fact, I only know "winmm.dll", but I expect 
that WDM Audio Drivers are a lot of things...

this is my example (partial):

private const string mmdll = "winmm.dll";

// native calls

[DllImport(mmdll)]

public static extern int waveOutWrite(IntPtr hWaveOut, ref WaveHdr 
lpWaveOutHdr, int uSize);

[DllImport(mmdll)]

public

static extern int waveOutOpen(out IntPtr hWaveOut, int uDeviceID, WaveFormat 
lpFormat, WaveDelegate dwCallback, int dwInstance, int dwFlags);

[DllImport(mmdll)]

public static

extern int waveOutReset(IntPtr hWaveOut);

...

And my program use these functions.

Can I use this functions to control my USB Audio Device?

Could anyone send me an example of USB Audio programming with C# (ó C++)?

Thanks in advance!



________________________________
From:  DJ Sisolak <dsisolak@xxxxxxxxxxxxxxxxxxxxxx>
Reply-To:  wdmaudiodev@xxxxxxxxxxxxx
To:  "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
Subject:  [wdmaudiodev] Re: Building an USB audio interface with a PIC18F4550
Date:  Tue, 27 Mar 2007 16:53:59 -0700
>Hi All,
>
>Answers dispersed below...
>
>Thx,
>DJ Sisolak
>Microsoft Corp
>
>-----Original Message-----
>From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
>[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Tim Roberts
>Sent: Monday, March 26, 2007 10:56 AM
>To: wdmaudiodev@xxxxxxxxxxxxx
>Subject: [wdmaudiodev] Re: Building an USB audio interface with a PIC18F4550
>
>Elios Elios Elios wrote:
> >
> > I'm making my end of career project (telecomunications engineering),
> > that consist in a USB interface for capturing audio by 4 channels. We
> > are using as IC the PIC18F4550 of Microchip. We have made the PCB, and
> > we have comunicated the PIC and the PC with an C# example that we have
> > found in the WEB. This example is for low speed, and for audio isn't
> > very good...
>
>To do 44.1kHz audio at 16 bits per sample with 4 channels takes 353
>kB/sec.  That's double what a low-speed device can do.  You'll need full
>speed.
>
>[DJ Sisolak] Correct, all spec compliant USB Audio devices MUST be full speed.
>
> > So, what is the better way to make an USB Audio Interface?
> >
> > I read the "USB Device Class Definition for Audio Devices 1.0" and the
> > 2.0... I think that if we follow the specification, we could to
> > control the interface with the driver Usbaudio.sys and programme it
> > with an Native API like WDMAudio Driver (winmm.dll, isn't?), or Core
> > Audio ...
>
>Yes, the best way to build an audio device is to meet the USB Audio
>Class Spec, as you describe above.  The trickiest part is creating the
>descriptors to describe your architecture, and even that's not too hard;
>there are samples in the documents on the USB web site.  You will want
>to do your streaming with an isochronous pipe.
>
>[DJ Sisolak] Again, correct. Streaming for USB Audio per the spec (MIDI being 
>the exception) is done via Isochronous pipes. Descriptor generation for USB 
>Audio 1.0 device is pretty straight forward from the spec. You may want to 
>look at the guidelines as posted on 
>http://www.microsoft.com/whdc/device/audio/UAA_HWdesign.mspx for some other 
>information on this.
>
> > I read that there is a problem with USB 2.0 (the PIC18F4550 works in
> > USB 2.0, full speed) and Usbaudio.sys... Somebody knows it?
>
>Not that I know of.  There are a few discussions of this on the
>Microchip web site, but nothing negative.
>
>[DJ Sisolak] Full speed USB Audio devices should work just fine with USB 2.0 
>bus. There are some issues for getting a High Speed USB Audio 1.0 devices to 
>work though.
>
>
> > Maybe the other solution can be to make a driver with Windriver... I
> > have listened that is very easy to do. But in this way only we could
> > to control our interface with our own driver... isn't?
>
>Making a simple driver with WinDriver might be easy, but making an audio
>driver of any kind is not easy.  Unless you run into some very serious
>problem, you should strive to make your device USB Audio Class compliant.
>
>[DJ Sisolak] I heartily agree. If for some reason you feel that the 
>usbaudio.sys class driver does not fit your needs feel free to let me know why.
>
>--
>Tim Roberts, timr@xxxxxxxxx
>Providenza & Boekelheide, Inc.
>
>******************
>
>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/
>

________________________________
Acepta el reto MSN Premium: incluye Antivirus y Firewall de McAffee. Descárgalo 
y pruébalo 2 meses gratis.<http://g.msn.com/8HMBESES/2731??PS=47575>
****************** 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: