[wdmaudiodev] Re: USB Audio Using Interrupt Transfers

  • From: Udo Eberhardt <Udo.Eb@xxxxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Sun, 22 Jun 2003 22:19:58 +0200


You mean 8 bytes? But my chip (MC68HC908JB8/MC68HC08JB8/MC68HC08JT8-Rev. 2.0) only have 8 bytes In/Out buffer. Maybe I need choose another chip.

Yes, I mean 8 bytes. In order to transfer 64kbps you need to transfer 8 bytes every millisecond. However, this cannot be guaranteed by the host controller because
(a) the EP is not guaranteed to be polled every ms,
(b) the USB clock is (most likely) not exactly matched with your codec's clock (matching could be achieved by hardware means).



Besed on your discussion, for matching 64kbps Codec speed I think:
If  I use a usb chip with 8 bytes In/Out data buffer and 1ms interval, it
may loss 8 bytes data when not be polled in. And this may occur every 2...10
secs. This tone may be not good.
If  I use a usb chip with 16 bytest In/Out data buffer and 1ms polling
interval, it may not loss any data. This tone will be good enough.
If  I use a usb chip with 32 bytest In/Out data buffer and 2ms polling
interval, it may not loss any data. This tone will be good enough.
If  I use a usb chip with 64 bytest In/Out data buffer and 4ms polling
interval, it may not loss any data. This tone will be good enough.
In normal, Host will  fetch data of half of the max packet size. When any
frame not be polled in, the next polling will fetch data of max packet size.
Am I right?

Yes, this is the way it goes. I would recommend to use 4 ms. This is because you will normally send a short packet ( a packet smaller than the FIFO size). A short packet will cause a buffer switch. So you will receive a buffer every 4 ms. If the buffer switching rate is too high then this will cause a considerable CPU load. You can experiment with that...
As an alternative, you could avoid short packets and send stuffing bytes to fill up the packets up to the FIFO size. Then you could put a number of packets into each buffer and thus reduce the buffer switch rate. However, this approach will increase latency...



Note: If you have to choose another USB chip, choose one that support iso transfers ;-)



The second question, I found that in Windows 2000 Sound Recorder's menu:
"File"-->"Properties"-->Format Conversion --> "Convert now"-->Attributes
8.000kHz, 8bit, Mono   7kb/sec
7kb/sec means 7K Bytes/sec?
if so, why it is not 8kb/sec?
>
I assume this is a rounding problem. 8KB is 8192 bytes. But, 8kHz, 8bit, mono produces 8000 bytes per sec.
Remember: k means 1000, K means 1024



Udo Eberhardt Thesycon GmbH


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


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: