Re: Hercules Deejay Trim, "not enough bandwidth"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 24 Oct 2010, Daniel Stöckner wrote:

> Am Samstag, den 23.10.2010, 22:24 -0400 schrieb Alan Stern:
> > Unfortunately the "periodic" files are all the same!  Which means they 
> > don't contain any useful information -- they show the transfers 
> > scheduled for the integrated hub but nothing for the sound card.
> > 
> > Can you try doing the same thing with a smaller number of streams, so 
> > that no errors occur?  The "periodic" file contents while the transfers 
> > are running should be more informative.
> 
> I made a periodic copy of the periodic file on a (very rough) 100
> milliseconds basis. The exact nanosecond time is included in each copy.
> The soundcard was busy in 24bit 44100 2/2 mode. A second log of periodic
> is attached, while trying to open in 24bit 44100 4/2 mode.

I'll look at them later...

> > Also, when you're trying to get this to work with 4 or 4+2 streams,
> > what is the bandwidth used by each stream?  It looks like the card 
> > supports both 48 KHz 16-bit stereo and 48 KHz 24-bit stereo (as well as 
> > 44.1 KHz variants).  Which are you trying to use?
> 
> This is a summary of what modes work or don't. The format for the
> channels is "no channels in/no channels out". "0" means simplex mode.
> 
>     description         mode works
> 
> 00. 16 bit 44100 2/2    yes
> 01. 16 bit 48000 2/2    yes
> 02. 24 bit 44100 2/2    yes
> 03. 24 bit 48000 2/2    yes
> 04. 16 bit 44100 4/2    no
> 05. 16 bit 48000 4/2    no
> 06. 24 bit 44100 4/2    no
> 07. 24 bit 48000 4/2    no
> 08. 24 bit 48000 4/0    yes
> 09. 24 bit 44100 4/0    yes
> 10. 16 bit 48000 4/0    yes
> 11. 16 bit 44100 4/0    yes
> 12. 24 bit 48000 2/0    yes
> 13. 24 bit 48000 0/2    yes
> 
> It seems as if only 6 channel mode doesn't work. Up to for 4 channels
> everything works fine, regardless of bits and sampling rate. For me, the
> "24 bit 44100 4/2" mode is important, because I need to record 4
> channels to a playback in realtime.

Okay, this pretty much explains the problem.

The lsusb output for your sound card shows that it doesn't distinguish
between 44.1 KHz and 48 KHz when listing its bandwidth requirements; it
asks for the same amount of bandwidth in either case.  In particular,
it requires 192 bytes/frame for 16-bit transfers and 296 bytes/frame
for 24-bit transfers (a frame is 1 ms).  Don't ask me why the second
number is 8 bytes larger than it should be -- I don't know.

The information in section 5.11.3 of the USB-2.0 specification shows
how to compute the amount of USB bus time based on the size of a
transfer.  For 192 bytes isochronous OUT this comes to a little over
153 us, and for 296 bytes iso OUT it comes to a little over 237 us.  
IN transfers require about 1 us more.  You can get reasonably close to
these numbers just by realizing that full-speed USB runs at 12 Mb/s or
2/3 us per byte and that bit-stuffing requires all the times to be
increased by a factor of 7/6 -- and keep in mind that the protocol has
some overhead.

For full-speed transfers, you are allowed to allocate up to 90% of the
total frame time for periodic transfers like the isochronous transfers
used for audio.  Hence 900 us per frame is available for your audio
data.

With 16-bit audio, this means there is enough capacity for 900/153
streams, i.e., less than 6.  So you should be okay allocating up to 5
streams but there isn't enough bandwidth to accomodate 6 streams.  
Similarly, with 24-bit audio there is capacity for 900/237 or 3 streams
but not 4.

Which makes me a little concerned about lines 2, 3, 8, and 9 in your 
table above.  According to these calculations they shouldn't work.  On 
the other hand, I know that the 2.6.35 kernel has a bug causing it 
to overestimate the available bandwidth for periodic transfers.  This 
bug has been fixed in 2.6.36; it would be interesting to see what 
happens if you run the tests under the newer kernel.

As for your audio requirements, it looks like there simply is no way to
do what you want using that sound card.  If you can find a card that
supports high-speed USB transfers, it should work okay.  Or a card that
accurately lists the bandwidth requirements for 44.1 KHz audio, since 6
streams at 44.1 KHz should fit even though at 48 KHz they don't.  Or
you could use two cards of the sort you've got, although you'd have to
plug at least one of them into a separate external USB hub.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux