Skip to contentSkip to conversation

Problem with USB Class 2 Audio Driver

DISCUSSION Demian Martin 8 participants 11 messages Aug 21, 2010 – Sep 6, 2010 4 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Daniel:

I'm testing an early sample of the Wavelength Wavelink, a USB to S/PDIF adapter that supports 44.1-192 KHz sample rates and uses async usb to talk to ALSA. It works and plays all of the sample rates correctly with the git version of Alsa from 7/30/2010 whenthe files are sourced from the network. However if I try to play from a usb source to the usb dac it doesn't work and the whole system gets unstable. The platforms I have tested it on seem to have a single USB host interface but with USB 2 there should be enough bandwidth to pass the data from a USB stick to the cpu and back. If I use an older 96 only usb dac on the same system it works (unless the down conversion isn't a direct divide, which overloads the CPU, but that is a different issue). The problem seems to be sample rate independent and hits the moment I try to access the file. This is using MPD as a player.

What additional info do you need to troubleshoot this? Is it an intrinsic limitation to the interface? What additional tests should I do? It's possible it's a hardware issue but how do I divide them so I can go back to the hardware guy if it's his issue?

Demian Martin

Product Design Services

#1 lore raw
Quoted 4 lines · Demian Martin

I'm testing an early sample of the Wavelength Wavelink, a USB to S/PDIF adapter that supports 44.1-192 KHz sample rates and uses async usb to talk to ALSA. It works and plays all of the sample rates correctly with the git version of Alsa from 7/30/2010 whenthe files are sourced from the network.

What do you mean by "from the network"? How does your test setup look like?

Quoted 2 lines

However if I try to play from a usb source to the usb dac it doesn't work and the whole system gets unstable.

You could also be more precise here :) What doesn't work, how are you testing, and in which regard does the system get unstable?

Quoted 7 lines

The platforms I have tested it on seem
to have a single USB host interface but with USB 2 there should be enough bandwidth to pass the data from a USB stick to the cpu and back. If I use an older 96 only usb dac on the same system it works (unless the down conversion isn't a direct divide, which overloads the CPU, but that is a different issue). The problem seems to be sample rate independent and hits the moment I try to access the file. This is using MPD as a player.

Ah, so your data file is stored on a media which is also connected to USB? Did you connect the two devices to different USB ports or do they share one uplink with a hub?

Quoted 4 lines

What additional info do you need to troubleshoot this? Is it an intrinsic limitation to the interface? What additional tests should I do? It's possible it's a hardware issue but how do I divide them so I can go back to the hardware guy if it's his issue?

I'm not aware of any limitation, but there could be such issues as exceeded bandwith on the bus and the like. How many audio channels are we talking about?

You could measure the speed of your USB media by using something like this:

	$ time dd if=/path/to/192khz.file of=/dev/null

This should take significantly less time than - let's say - half the real-time audio playback time of the file, so there's enough headroom to transport the audio data back to the USB DAC.

What kind of system is this, after all? Did you try other OS on the same hardware for comparsion?

Daniel

#2 lore raw

Daniel:
I'll try to provide all the info you want. I'll need some prompting for some details, please be patient with me.

First the system.
I have tested on both an intel D945GSEJT atom based MB and an Alis 3.3 AMD Geode based mb.
OS: Linux auraliti-player 2.6.32auraliti-2.0 #1 PREEMPT Fri Jul 30 06:48:14 GMT 2010 i686 GNU/Linux
Distro Voyage Linux 0.6.1
It's a dedicated headless 2 channel audio player, sort of a high performance squeezebox. Details here: www.auraliti.com

When I play a file from a network source (connected through nfs) I have no problems with either .wav or .flac.

I don't know how to tell with certainty if the USB devices are connecting through a common or separate root hubs.

USB stick speed- It took 6.2 seconds to pass a 1 minute 19 second 192/24 file to dev/null so USB speed is not a problem.

It seems there is a collision when there is a high speed USB storage device and the USB class 2 audio on the same host port both moving data at the same time.

All of the following were done with the Alix board (Geode 500 MHz processor). The Intel does similar but seems more likely to work.

Under some conditions the system loses connection to the USB audio device:

auraliti-player:~# aplay -v -Dplughw:1
/media/usb0/Trio-Mytek8X192ADDA-192k.WAV
Playing WAVE '/media/usb0/Trio-Mytek8X192ADDA-192k.WAV' : Signed 24 bit
Little Endian in 3bytes, Rate 192000 Hz, Stereo
aplay: set_params:1116: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S24_3LE
SUBFORMAT:  STD
SAMPLE_BITS: 24
FRAME_BITS: 48
CHANNELS: 2
RATE: 192000
PERIOD_TIME: 125000
PERIOD_SIZE: 24000
PERIOD_BYTES: 144000
PERIODS: 4
BUFFER_TIME: 500000
BUFFER_SIZE: 96000
BUFFER_BYTES: 576000
TICK_TIME: 0
auraliti-player:~#

Fixed by disconnecting and reconnecting the device.

Here is what I get playing a 44.1 file, after about 15 seconds:

Playing WAVE '/media/usb0/Piano_44_1.wav' : Signed 24 bit Little Endian in 3bytes, Rate 44100 Hz, Stereo
Plug PCM: Linear conversion PCM (S32_LE)
Its setup is:

  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S24_3LE
  subformat    : STD
  channels     : 2
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 24
  buffer_size  : 22050
  period_size  : 5513
  period_time  : 125011
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 5513

period_event : 0
start_threshold : 22050
stop_threshold : 22050
silence_threshold: 0
silence_size : 0
boundary : 1445068800
Slave: Hardware PCM card 1 'WaveLink HS SPDIF' device 0 subdevice 0 Its setup is:

  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 32
  buffer_size  : 22050
  period_size  : 5513
  period_time  : 125011
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 5513
  period_event : 0
  start_threshold  : 22050
  stop_threshold   : 22050
  silence_threshold: 0
  silence_size : 0
  boundary     : 1445068800
  appl_ptr     : 0
  hw_ptr       : 0

underrun!!! (at least 0.015 ms long)
Status:
state : XRUN
trigger_time: 903.806908643

  tstamp      : 903.807038997
  delay       : 0
  avail       : 0
  avail_max   : 11028

aplay: xrun:1259: xrun: prepare error: File descriptor in bad state auraliti-player:~#

And the system stops playing.

And very quickly on a 176.4 file:

Playing WAVE '/media/usb0/01_Rimsky-Korsakov Dance of the Tumblers.wav' :
Signed 24 bit Little Endian in 3bytes, Rate 176400 Hz, Stereo Plug PCM: Linear conversion PCM (S32_LE)
Its setup is:

  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S24_3LE
  subformat    : STD
  channels     : 2
  rate         : 176400
  exact rate   : 176400 (176400/1)
  msbits       : 24
  buffer_size  : 88200
  period_size  : 22050
  period_time  : 125000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 22050

period_event : 0
start_threshold : 88200
stop_threshold : 88200
silence_threshold: 0
silence_size : 0
boundary : 1445068800
Slave: Hardware PCM card 1 'WaveLink HS SPDIF' device 0 subdevice 0 Its setup is:

  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 176400
  exact rate   : 176400 (176400/1)
  msbits       : 32
  buffer_size  : 88200
  period_size  : 22050
  period_time  : 125000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 22050
  period_event : 0
  start_threshold  : 88200
  stop_threshold   : 88200
  silence_threshold: 0
  silence_size : 0
  boundary     : 1445068800
  appl_ptr     : 0
  hw_ptr       : 0

underrun!!! (at least 0.010 ms long)
Status:
state : XRUN
trigger_time: 1050.313984810

  tstamp      : 1050.314067000
  delay       : 0
  avail       : 1413
  avail_max   : 22071

aplay: xrun:1259: xrun: prepare error: File descriptor in bad state auraliti-player:~#

If in interpose a USB 1 hub on the usb storage I get this:

auraliti-player:~# aplay -v -Dplughw:1 /media/usb0/01_Rimsky-Korsakov\
Dance\ of\ the\ Tumblers.wav
Playing WAVE '/media/usb0/01_Rimsky-Korsakov Dance of the Tumblers.wav' :
Signed 24 bit Little Endian in 3bytes, Rate 176400 Hz, Stereo
Plug PCM: Linear conversion PCM (S32_LE)
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S24_3LE
  subformat    : STD
  channels     : 2
  rate         : 176400
  exact rate   : 176400 (176400/1)
  msbits       : 24
  buffer_size  : 88200
  period_size  : 22050
  period_time  : 125000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 22050
  period_event : 0
  start_threshold  : 88200
  stop_threshold   : 88200
  silence_threshold: 0
  silence_size : 0
  boundary     : 1445068800
Slave: Hardware PCM card 1 'WaveLink HS SPDIF' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 176400
  exact rate   : 176400 (176400/1)
  msbits       : 32
  buffer_size  : 88200
  period_size  : 22050
  period_time  : 125000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 22050
  period_event : 0
  start_threshold  : 88200
  stop_threshold   : 88200
  silence_threshold: 0
  silence_size : 0
  boundary     : 1445068800
  appl_ptr     : 0
  hw_ptr       : 0
underrun!!! (at least 1.537 ms long)
Status:
  state       : XRUN
  trigger_time: 1219.804905467
  tstamp      : 1219.820257912
  delay       : 0
  avail       : 88220
  avail_max   : 88220
underrun!!! (at least 13.900 ms long)
Status:
  state       : XRUN
  trigger_time: 1222.763695807
  tstamp      : 1222.902684537
  delay       : 0
  avail       : 66169
  avail_max   : 88219
underrun!!! (at least 1.279 ms long)
Status:
  state       : XRUN
  trigger_time: 1225.972436940
  tstamp      : 1225.985216250
  delay       : 0
  avail       : 88221
  avail_max   : 88221
underrun!!! (at least 14.141 ms long)

etc. until I stop the playback.

44.1 playback is fine under these conditions (but then why USB audio class 2?)

Further, using MPD for playback I have discovered that the high bit rate flac files play fine but the same files as wave have the same type of stall/stop problems.

I tried Windows on the Intel platform with similar problems using windows media player but no problems with VLC. However with Windows it is not easy to know what is really going on inside.

Is it possible that the essentially synchronous nature of playing a wave file from USB source to USB Audio device causes a collision since the data is going both ways at essentially the same rate and timing?

Let me know what other info you need.

Thanks for looking at this.
-Demian

-----Original Message-----
From: Daniel Mack [mailto:[email protected]]
Sent: Saturday, August 21, 2010 2:27 AM
To: Demian Martin
Cc: [email protected]
Subject: Re: Problem with USB Class 2 Audio Driver

Quoted 4 lines · Demian Martin

I'm testing an early sample of the Wavelength Wavelink, a USB to S/PDIF adapter that supports 44.1-192 KHz sample rates and uses async usb to talk to ALSA. It works and plays all of the sample rates correctly with the git version of Alsa from 7/30/2010 whenthe files are sourced from the network.

What do you mean by "from the network"? How does your test setup look like?

Quoted 2 lines

However if I try to play from a usb source to the usb dac it doesn't work and the whole system gets unstable.

You could also be more precise here :) What doesn't work, how are you testing, and in which regard does the system get unstable?

Quoted 3 lines

The platforms I have tested it on seem
to have a single USB host interface but with USB 2 there should be enough bandwidth to pass the data from a USB stick to the cpu and back. If I use

an

Quoted 4 lines

older 96 only usb dac on the same system it works (unless the down conversion isn't a direct divide, which overloads the CPU, but that is a different issue). The problem seems to be sample rate independent and hits the moment I try to access the file. This is using MPD as a player.

Ah, so your data file is stored on a media which is also connected to USB? Did you connect the two devices to different USB ports or do they share one uplink with a hub?

Quoted 3 lines

What additional info do you need to troubleshoot this? Is it an intrinsic limitation to the interface? What additional tests should I do? It's possible it's a hardware issue but how do I divide them so I can go back

to

Quoted 1 line

the hardware guy if it's his issue?

I'm not aware of any limitation, but there could be such issues as exceeded bandwith on the bus and the like. How many audio channels are we talking about?

You could measure the speed of your USB media by using something like this:

	$ time dd if=/path/to/192khz.file of=/dev/null

This should take significantly less time than - let's say - half the real-time audio playback time of the file, so there's enough headroom to transport the audio data back to the USB DAC.

What kind of system is this, after all? Did you try other OS on the same hardware for comparsion?

Daniel

#3 lore raw

Demian,

USB Hubs can come in several forms especially USB 2.0 hubs. There are load leveling and store and forward hubs that can mask the underlying problem.

I would suggest direct connection. BUT!!!!! We have found that some front panel USB ports which either travel the length of the PCB or are wire attached sometimes do not retain their correct impedance and run into problems, especially with hard drives and such which have error corrected protocols. Some front panel USB ports will actually force the USB device into Full instead of High Speed because of this problem.

Presently the player is underruning data from the USB stick. Also not all sticks are the same. I bought a 128GB unit for a show to store music on and it's slower than any other unit I have available. You should make sure you try many variations of these to assure success.

Thanks
Gordon

Quoted 358 lines · Demian Martin

Daniel:
I'll try to provide all the info you want. I'll need some prompting for some details, please be patient with me.

First the system.
I have tested on both an intel D945GSEJT atom based MB and an Alis 3.3 AMD Geode based mb.
OS: Linux auraliti-player 2.6.32auraliti-2.0 #1 PREEMPT Fri Jul 30 06:48:14 GMT 2010 i686 GNU/Linux
Distro Voyage Linux 0.6.1
It's a dedicated headless 2 channel audio player, sort of a high performance squeezebox. Details here: www.auraliti.com

When I play a file from a network source (connected through nfs) I have no problems with either .wav or .flac.

I don't know how to tell with certainty if the USB devices are connecting through a common or separate root hubs.

USB stick speed- It took 6.2 seconds to pass a 1 minute 19 second 192/24 file to dev/null so USB speed is not a problem.

It seems there is a collision when there is a high speed USB storage device and the USB class 2 audio on the same host port both moving data at the same time.

All of the following were done with the Alix board (Geode 500 MHz processor). The Intel does similar but seems more likely to work.

Under some conditions the system loses connection to the USB audio device:

auraliti-player:~# aplay -v -Dplughw:1
/media/usb0/Trio-Mytek8X192ADDA-192k.WAV
Playing WAVE '/media/usb0/Trio-Mytek8X192ADDA-192k.WAV' : Signed 24 bit
Little Endian in 3bytes, Rate 192000 Hz, Stereo
aplay: set_params:1116: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S24_3LE
SUBFORMAT:  STD
SAMPLE_BITS: 24
FRAME_BITS: 48
CHANNELS: 2
RATE: 192000
PERIOD_TIME: 125000
PERIOD_SIZE: 24000
PERIOD_BYTES: 144000
PERIODS: 4
BUFFER_TIME: 500000
BUFFER_SIZE: 96000
BUFFER_BYTES: 576000
TICK_TIME: 0
auraliti-player:~#

Fixed by disconnecting and reconnecting the device.

Here is what I get playing a 44.1 file, after about 15 seconds:

Playing WAVE '/media/usb0/Piano_44_1.wav' : Signed 24 bit Little Endian in 3bytes, Rate 44100 Hz, Stereo
Plug PCM: Linear conversion PCM (S32_LE)
Its setup is:

  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S24_3LE
  subformat    : STD
  channels     : 2
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 24
  buffer_size  : 22050
  period_size  : 5513
  period_time  : 125011
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 5513

period_event : 0
start_threshold : 22050
stop_threshold : 22050
silence_threshold: 0
silence_size : 0
boundary : 1445068800
Slave: Hardware PCM card 1 'WaveLink HS SPDIF' device 0 subdevice 0 Its setup is:

  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 32
  buffer_size  : 22050
  period_size  : 5513
  period_time  : 125011
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 5513
  period_event : 0
  start_threshold  : 22050
  stop_threshold   : 22050
  silence_threshold: 0
  silence_size : 0
  boundary     : 1445068800
  appl_ptr     : 0
  hw_ptr       : 0

underrun!!! (at least 0.015 ms long)
Status:
state : XRUN
trigger_time: 903.806908643

  tstamp      : 903.807038997
  delay       : 0
  avail       : 0
  avail_max   : 11028

aplay: xrun:1259: xrun: prepare error: File descriptor in bad state auraliti-player:~#

And the system stops playing.

And very quickly on a 176.4 file:

Playing WAVE '/media/usb0/01_Rimsky-Korsakov Dance of the Tumblers.wav' :
Signed 24 bit Little Endian in 3bytes, Rate 176400 Hz, Stereo Plug PCM: Linear conversion PCM (S32_LE)
Its setup is:

  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S24_3LE
  subformat    : STD
  channels     : 2
  rate         : 176400
  exact rate   : 176400 (176400/1)
  msbits       : 24
  buffer_size  : 88200
  period_size  : 22050
  period_time  : 125000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 22050

period_event : 0
start_threshold : 88200
stop_threshold : 88200
silence_threshold: 0
silence_size : 0
boundary : 1445068800
Slave: Hardware PCM card 1 'WaveLink HS SPDIF' device 0 subdevice 0 Its setup is:

  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 176400
  exact rate   : 176400 (176400/1)
  msbits       : 32
  buffer_size  : 88200
  period_size  : 22050
  period_time  : 125000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 22050
  period_event : 0
  start_threshold  : 88200
  stop_threshold   : 88200
  silence_threshold: 0
  silence_size : 0
  boundary     : 1445068800
  appl_ptr     : 0
  hw_ptr       : 0

underrun!!! (at least 0.010 ms long)
Status:
state : XRUN
trigger_time: 1050.313984810

  tstamp      : 1050.314067000
  delay       : 0
  avail       : 1413
  avail_max   : 22071

aplay: xrun:1259: xrun: prepare error: File descriptor in bad state auraliti-player:~#

If in interpose a USB 1 hub on the usb storage I get this:

auraliti-player:~# aplay -v -Dplughw:1 /media/usb0/01_Rimsky-Korsakov\
Dance\ of\ the\ Tumblers.wav
Playing WAVE '/media/usb0/01_Rimsky-Korsakov Dance of the Tumblers.wav' :
Signed 24 bit Little Endian in 3bytes, Rate 176400 Hz, Stereo
Plug PCM: Linear conversion PCM (S32_LE)
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S24_3LE
  subformat    : STD
  channels     : 2
  rate         : 176400
  exact rate   : 176400 (176400/1)
  msbits       : 24
  buffer_size  : 88200
  period_size  : 22050
  period_time  : 125000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 22050
  period_event : 0
  start_threshold  : 88200
  stop_threshold   : 88200
  silence_threshold: 0
  silence_size : 0
  boundary     : 1445068800
Slave: Hardware PCM card 1 'WaveLink HS SPDIF' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 176400
  exact rate   : 176400 (176400/1)
  msbits       : 32
  buffer_size  : 88200
  period_size  : 22050
  period_time  : 125000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 22050
  period_event : 0
  start_threshold  : 88200
  stop_threshold   : 88200
  silence_threshold: 0
  silence_size : 0
  boundary     : 1445068800
  appl_ptr     : 0
  hw_ptr       : 0
underrun!!! (at least 1.537 ms long)
Status:
  state       : XRUN
  trigger_time: 1219.804905467
  tstamp      : 1219.820257912
  delay       : 0
  avail       : 88220
  avail_max   : 88220
underrun!!! (at least 13.900 ms long)
Status:
  state       : XRUN
  trigger_time: 1222.763695807
  tstamp      : 1222.902684537
  delay       : 0
  avail       : 66169
  avail_max   : 88219
underrun!!! (at least 1.279 ms long)
Status:
  state       : XRUN
  trigger_time: 1225.972436940
  tstamp      : 1225.985216250
  delay       : 0
  avail       : 88221
  avail_max   : 88221
underrun!!! (at least 14.141 ms long)

etc. until I stop the playback.

44.1 playback is fine under these conditions (but then why USB audio class 2?)

Further, using MPD for playback I have discovered that the high bit rate flac files play fine but the same files as wave have the same type of stall/stop problems.

I tried Windows on the Intel platform with similar problems using windows media player but no problems with VLC. However with Windows it is not easy to know what is really going on inside.

Is it possible that the essentially synchronous nature of playing a wave file from USB source to USB Audio device causes a collision since the data is going both ways at essentially the same rate and timing?

Let me know what other info you need.

Thanks for looking at this.
-Demian

-----Original Message-----
From: Daniel Mack [mailto:[email protected]]
Sent: Saturday, August 21, 2010 2:27 AM
To: Demian Martin
Cc: [email protected]
Subject: Re: Problem with USB Class 2 Audio Driver

Quoted 5 lines · Demian Martin

I'm testing an early sample of the Wavelength Wavelink, a USB to S/PDIF adapter that supports 44.1-192 KHz sample rates and uses async usb to talk to ALSA. It works and plays all of the sample rates correctly with the git version of Alsa from 7/30/2010 whenthe files are sourced from the network.

What do you mean by "from the network"? How does your test setup look like?

Quoted 3 lines

However if I try to play from a usb source to the usb dac it doesn't work and the whole system gets unstable.

You could also be more precise here :) What doesn't work, how are you testing, and in which regard does the system get unstable?

Quoted 4 lines

The platforms I have tested it on seem
to have a single USB host interface but with USB 2 there should be enough bandwidth to pass the data from a USB stick to the cpu and back. If I use

an

Quoted 5 lines

older 96 only usb dac on the same system it works (unless the down conversion isn't a direct divide, which overloads the CPU, but that is a different issue). The problem seems to be sample rate independent and hits the moment I try to access the file. This is using MPD as a player.

Ah, so your data file is stored on a media which is also connected to USB? Did you connect the two devices to different USB ports or do they share one uplink with a hub?

Quoted 4 lines

What additional info do you need to troubleshoot this? Is it an intrinsic limitation to the interface? What additional tests should I do? It's possible it's a hardware issue but how do I divide them so I can go back

to

Quoted 2 lines

the hardware guy if it's his issue?

I'm not aware of any limitation, but there could be such issues as exceeded bandwith on the bus and the like. How many audio channels are we talking about?

You could measure the speed of your USB media by using something like this:

	$ time dd if=/path/to/192khz.file of=/dev/null

This should take significantly less time than - let's say - half the real-time audio playback time of the file, so there's enough headroom to transport the audio data back to the USB DAC.

What kind of system is this, after all? Did you try other OS on the same hardware for comparsion?

Daniel

Signature · 19 lines
J. Gordon Rankin
Owner and Chief Scientist
====== Wavelength Audio, ltd ======
High-End Audio since 1981
SET Tube Amplifiers, DACS & Preamps
http://www.WavelengthAudio.com
===================================
Computer USB DACS
http://www.USBDacs.com
===================================
SET Tube Guitar Amplifiers
NAMM Member since 1998
http://www.Guitar-Engines.com
===================================
3703 Petoskey Avenue
Cincinnati, Ohio 45227 USA
mailto:[email protected]
mailto:[email protected]
(513) 271-4186 phone/voicemail
#4 lore raw
In reply to Demian Martin

Hi,

FWIW, I currently have no clue what could be the reason for this issue. I copied the linux-usb mailing list, maybe anyone over there has an idea.

Summary is: Demian is trying to play back an audio file over an USB connected soundcard, and the file itself is also stored on a media connected via USB. The transfer alone seems to be reasonably fast (tested with 'dd'), and the card itself also works fine (tested with a file stored on a different media), but the combination of them both fails. At least for high sample rates - iow, high data throughput.

Could there be anything wrong with the isochronous bandwith reservation?

Thanks,
Daniel

Quoted 336 lines · Demian Martin

Daniel:
I'll try to provide all the info you want. I'll need some prompting for some details, please be patient with me.

First the system.
I have tested on both an intel D945GSEJT atom based MB and an Alis 3.3 AMD Geode based mb.
OS: Linux auraliti-player 2.6.32auraliti-2.0 #1 PREEMPT Fri Jul 30 06:48:14 GMT 2010 i686 GNU/Linux
Distro Voyage Linux 0.6.1
It's a dedicated headless 2 channel audio player, sort of a high performance squeezebox. Details here: www.auraliti.com

When I play a file from a network source (connected through nfs) I have no problems with either .wav or .flac.

I don't know how to tell with certainty if the USB devices are connecting through a common or separate root hubs.

USB stick speed- It took 6.2 seconds to pass a 1 minute 19 second 192/24 file to dev/null so USB speed is not a problem.

It seems there is a collision when there is a high speed USB storage device and the USB class 2 audio on the same host port both moving data at the same time.

All of the following were done with the Alix board (Geode 500 MHz processor). The Intel does similar but seems more likely to work.

Under some conditions the system loses connection to the USB audio device:

auraliti-player:~# aplay -v -Dplughw:1
/media/usb0/Trio-Mytek8X192ADDA-192k.WAV
Playing WAVE '/media/usb0/Trio-Mytek8X192ADDA-192k.WAV' : Signed 24 bit
Little Endian in 3bytes, Rate 192000 Hz, Stereo
aplay: set_params:1116: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S24_3LE
SUBFORMAT:  STD
SAMPLE_BITS: 24
FRAME_BITS: 48
CHANNELS: 2
RATE: 192000
PERIOD_TIME: 125000
PERIOD_SIZE: 24000
PERIOD_BYTES: 144000
PERIODS: 4
BUFFER_TIME: 500000
BUFFER_SIZE: 96000
BUFFER_BYTES: 576000
TICK_TIME: 0
auraliti-player:~#

Fixed by disconnecting and reconnecting the device.

Here is what I get playing a 44.1 file, after about 15 seconds:

Playing WAVE '/media/usb0/Piano_44_1.wav' : Signed 24 bit Little Endian in 3bytes, Rate 44100 Hz, Stereo
Plug PCM: Linear conversion PCM (S32_LE)
Its setup is:

  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S24_3LE
  subformat    : STD
  channels     : 2
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 24
  buffer_size  : 22050
  period_size  : 5513
  period_time  : 125011
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 5513

period_event : 0
start_threshold : 22050
stop_threshold : 22050
silence_threshold: 0
silence_size : 0
boundary : 1445068800
Slave: Hardware PCM card 1 'WaveLink HS SPDIF' device 0 subdevice 0 Its setup is:

  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 32
  buffer_size  : 22050
  period_size  : 5513
  period_time  : 125011
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 5513
  period_event : 0
  start_threshold  : 22050
  stop_threshold   : 22050
  silence_threshold: 0
  silence_size : 0
  boundary     : 1445068800
  appl_ptr     : 0
  hw_ptr       : 0

underrun!!! (at least 0.015 ms long)
Status:
state : XRUN
trigger_time: 903.806908643

  tstamp      : 903.807038997
  delay       : 0
  avail       : 0
  avail_max   : 11028

aplay: xrun:1259: xrun: prepare error: File descriptor in bad state auraliti-player:~#

And the system stops playing.

And very quickly on a 176.4 file:

Playing WAVE '/media/usb0/01_Rimsky-Korsakov Dance of the Tumblers.wav' :
Signed 24 bit Little Endian in 3bytes, Rate 176400 Hz, Stereo Plug PCM: Linear conversion PCM (S32_LE)
Its setup is:

  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S24_3LE
  subformat    : STD
  channels     : 2
  rate         : 176400
  exact rate   : 176400 (176400/1)
  msbits       : 24
  buffer_size  : 88200
  period_size  : 22050
  period_time  : 125000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 22050

period_event : 0
start_threshold : 88200
stop_threshold : 88200
silence_threshold: 0
silence_size : 0
boundary : 1445068800
Slave: Hardware PCM card 1 'WaveLink HS SPDIF' device 0 subdevice 0 Its setup is:

  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 176400
  exact rate   : 176400 (176400/1)
  msbits       : 32
  buffer_size  : 88200
  period_size  : 22050
  period_time  : 125000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 22050
  period_event : 0
  start_threshold  : 88200
  stop_threshold   : 88200
  silence_threshold: 0
  silence_size : 0
  boundary     : 1445068800
  appl_ptr     : 0
  hw_ptr       : 0

underrun!!! (at least 0.010 ms long)
Status:
state : XRUN
trigger_time: 1050.313984810

  tstamp      : 1050.314067000
  delay       : 0
  avail       : 1413
  avail_max   : 22071

aplay: xrun:1259: xrun: prepare error: File descriptor in bad state auraliti-player:~#

If in interpose a USB 1 hub on the usb storage I get this:

auraliti-player:~# aplay -v -Dplughw:1 /media/usb0/01_Rimsky-Korsakov\
Dance\ of\ the\ Tumblers.wav
Playing WAVE '/media/usb0/01_Rimsky-Korsakov Dance of the Tumblers.wav' :
Signed 24 bit Little Endian in 3bytes, Rate 176400 Hz, Stereo
Plug PCM: Linear conversion PCM (S32_LE)
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S24_3LE
  subformat    : STD
  channels     : 2
  rate         : 176400
  exact rate   : 176400 (176400/1)
  msbits       : 24
  buffer_size  : 88200
  period_size  : 22050
  period_time  : 125000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 22050
  period_event : 0
  start_threshold  : 88200
  stop_threshold   : 88200
  silence_threshold: 0
  silence_size : 0
  boundary     : 1445068800
Slave: Hardware PCM card 1 'WaveLink HS SPDIF' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 176400
  exact rate   : 176400 (176400/1)
  msbits       : 32
  buffer_size  : 88200
  period_size  : 22050
  period_time  : 125000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 22050
  period_event : 0
  start_threshold  : 88200
  stop_threshold   : 88200
  silence_threshold: 0
  silence_size : 0
  boundary     : 1445068800
  appl_ptr     : 0
  hw_ptr       : 0
underrun!!! (at least 1.537 ms long)
Status:
  state       : XRUN
  trigger_time: 1219.804905467
  tstamp      : 1219.820257912
  delay       : 0
  avail       : 88220
  avail_max   : 88220
underrun!!! (at least 13.900 ms long)
Status:
  state       : XRUN
  trigger_time: 1222.763695807
  tstamp      : 1222.902684537
  delay       : 0
  avail       : 66169
  avail_max   : 88219
underrun!!! (at least 1.279 ms long)
Status:
  state       : XRUN
  trigger_time: 1225.972436940
  tstamp      : 1225.985216250
  delay       : 0
  avail       : 88221
  avail_max   : 88221
underrun!!! (at least 14.141 ms long)

etc. until I stop the playback.

44.1 playback is fine under these conditions (but then why USB audio class 2?)

Further, using MPD for playback I have discovered that the high bit rate flac files play fine but the same files as wave have the same type of stall/stop problems.

I tried Windows on the Intel platform with similar problems using windows media player but no problems with VLC. However with Windows it is not easy to know what is really going on inside.

Is it possible that the essentially synchronous nature of playing a wave file from USB source to USB Audio device causes a collision since the data is going both ways at essentially the same rate and timing?

Let me know what other info you need.

Thanks for looking at this.
-Demian

-----Original Message-----
From: Daniel Mack [mailto:[email protected]]
Sent: Saturday, August 21, 2010 2:27 AM
To: Demian Martin
Cc: alsa-devel-K7yf7f+aM1XWsZ/[email protected]
Subject: Re: Problem with USB Class 2 Audio Driver

Quoted 4 lines · Demian Martin

I'm testing an early sample of the Wavelength Wavelink, a USB to S/PDIF adapter that supports 44.1-192 KHz sample rates and uses async usb to talk to ALSA. It works and plays all of the sample rates correctly with the git version of Alsa from 7/30/2010 whenthe files are sourced from the network.

What do you mean by "from the network"? How does your test setup look like?

Quoted 2 lines

However if I try to play from a usb source to the usb dac it doesn't work and the whole system gets unstable.

You could also be more precise here :) What doesn't work, how are you testing, and in which regard does the system get unstable?

Quoted 3 lines

The platforms I have tested it on seem
to have a single USB host interface but with USB 2 there should be enough bandwidth to pass the data from a USB stick to the cpu and back. If I use

an

Quoted 4 lines

older 96 only usb dac on the same system it works (unless the down conversion isn't a direct divide, which overloads the CPU, but that is a different issue). The problem seems to be sample rate independent and hits the moment I try to access the file. This is using MPD as a player.

Ah, so your data file is stored on a media which is also connected to USB? Did you connect the two devices to different USB ports or do they share one uplink with a hub?

Quoted 3 lines

What additional info do you need to troubleshoot this? Is it an intrinsic limitation to the interface? What additional tests should I do? It's possible it's a hardware issue but how do I divide them so I can go back

to

Quoted 1 line

the hardware guy if it's his issue?

I'm not aware of any limitation, but there could be such issues as exceeded bandwith on the bus and the like. How many audio channels are we talking about?

You could measure the speed of your USB media by using something like this:

	$ time dd if=/path/to/192khz.file of=/dev/null

This should take significantly less time than - let's say - half the real-time audio playback time of the file, so there's enough headroom to transport the audio data back to the USB DAC.

Quoted 7 lines

What kind of system is this, after all? Did you try other OS on the same hardware for comparsion?

Daniel

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

A message that is not in the archive (sent off-list or not yet received): 20100823191209.GF17833-ahpEBR4enfnCULTFXS99ULNAH6kLmebB@public.gmane.org

#6 lore raw

Daniel,

Part of the problem could be that everything is working synchronously. The reading of the USB drive and the outputting to the USB converter are both happening in sync because the application would work this way.

High End Audio is usually nuts... but I have experienced that this type of combination results in poor output even when it works 100%. I have yet had time to figure out why... same reason that FLAC never sounds as good as a WAV file in my experience, though there I can verify that the CPU usage does go up higher than most people and engineers would suspect.

Thanks
Gordon

Quoted 376 lines · Daniel Mack

Hi,

FWIW, I currently have no clue what could be the reason for this issue. I copied the linux-usb mailing list, maybe anyone over there has an idea.

Summary is: Demian is trying to play back an audio file over an USB connected soundcard, and the file itself is also stored on a media connected via USB. The transfer alone seems to be reasonably fast (tested with 'dd'), and the card itself also works fine (tested with a file stored on a different media), but the combination of them both fails. At least for high sample rates - iow, high data throughput.

Could there be anything wrong with the isochronous bandwith reservation?

Thanks,
Daniel

Quoted 351 lines · Demian Martin

Daniel:
I'll try to provide all the info you want. I'll need some prompting for some details, please be patient with me.

First the system.
I have tested on both an intel D945GSEJT atom based MB and an Alis 3.3 AMD Geode based mb.
OS: Linux auraliti-player 2.6.32auraliti-2.0 #1 PREEMPT Fri Jul 30 06:48:14 GMT 2010 i686 GNU/Linux
Distro Voyage Linux 0.6.1
It's a dedicated headless 2 channel audio player, sort of a high performance squeezebox. Details here: www.auraliti.com

When I play a file from a network source (connected through nfs) I have no problems with either .wav or .flac.

I don't know how to tell with certainty if the USB devices are connecting through a common or separate root hubs.

USB stick speed- It took 6.2 seconds to pass a 1 minute 19 second 192/24 file to dev/null so USB speed is not a problem.

It seems there is a collision when there is a high speed USB storage device and the USB class 2 audio on the same host port both moving data at the same time.

All of the following were done with the Alix board (Geode 500 MHz processor). The Intel does similar but seems more likely to work.

Under some conditions the system loses connection to the USB audio device:

auraliti-player:~# aplay -v -Dplughw:1
/media/usb0/Trio-Mytek8X192ADDA-192k.WAV
Playing WAVE '/media/usb0/Trio-Mytek8X192ADDA-192k.WAV' : Signed 24 bit
Little Endian in 3bytes, Rate 192000 Hz, Stereo
aplay: set_params:1116: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S24_3LE
SUBFORMAT:  STD
SAMPLE_BITS: 24
FRAME_BITS: 48
CHANNELS: 2
RATE: 192000
PERIOD_TIME: 125000
PERIOD_SIZE: 24000
PERIOD_BYTES: 144000
PERIODS: 4
BUFFER_TIME: 500000
BUFFER_SIZE: 96000
BUFFER_BYTES: 576000
TICK_TIME: 0
auraliti-player:~#

Fixed by disconnecting and reconnecting the device.

Here is what I get playing a 44.1 file, after about 15 seconds:

Playing WAVE '/media/usb0/Piano_44_1.wav' : Signed 24 bit Little Endian in 3bytes, Rate 44100 Hz, Stereo
Plug PCM: Linear conversion PCM (S32_LE)
Its setup is:

  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S24_3LE
  subformat    : STD
  channels     : 2
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 24
  buffer_size  : 22050
  period_size  : 5513
  period_time  : 125011
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 5513

period_event : 0
start_threshold : 22050
stop_threshold : 22050
silence_threshold: 0
silence_size : 0
boundary : 1445068800
Slave: Hardware PCM card 1 'WaveLink HS SPDIF' device 0 subdevice 0 Its setup is:

  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 32
  buffer_size  : 22050
  period_size  : 5513
  period_time  : 125011
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 5513
  period_event : 0
  start_threshold  : 22050
  stop_threshold   : 22050
  silence_threshold: 0
  silence_size : 0
  boundary     : 1445068800
  appl_ptr     : 0
  hw_ptr       : 0

underrun!!! (at least 0.015 ms long)
Status:
state : XRUN
trigger_time: 903.806908643

  tstamp      : 903.807038997
  delay       : 0
  avail       : 0
  avail_max   : 11028

aplay: xrun:1259: xrun: prepare error: File descriptor in bad state auraliti-player:~#

And the system stops playing.

And very quickly on a 176.4 file:

Playing WAVE '/media/usb0/01_Rimsky-Korsakov Dance of the Tumblers.wav' :
Signed 24 bit Little Endian in 3bytes, Rate 176400 Hz, Stereo Plug PCM: Linear conversion PCM (S32_LE)
Its setup is:

  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S24_3LE
  subformat    : STD
  channels     : 2
  rate         : 176400
  exact rate   : 176400 (176400/1)
  msbits       : 24
  buffer_size  : 88200
  period_size  : 22050
  period_time  : 125000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 22050

period_event : 0
start_threshold : 88200
stop_threshold : 88200
silence_threshold: 0
silence_size : 0
boundary : 1445068800
Slave: Hardware PCM card 1 'WaveLink HS SPDIF' device 0 subdevice 0 Its setup is:

  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 176400
  exact rate   : 176400 (176400/1)
  msbits       : 32
  buffer_size  : 88200
  period_size  : 22050
  period_time  : 125000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 22050
  period_event : 0
  start_threshold  : 88200
  stop_threshold   : 88200
  silence_threshold: 0
  silence_size : 0
  boundary     : 1445068800
  appl_ptr     : 0
  hw_ptr       : 0

underrun!!! (at least 0.010 ms long)
Status:
state : XRUN
trigger_time: 1050.313984810

  tstamp      : 1050.314067000
  delay       : 0
  avail       : 1413
  avail_max   : 22071

aplay: xrun:1259: xrun: prepare error: File descriptor in bad state auraliti-player:~#

If in interpose a USB 1 hub on the usb storage I get this:

auraliti-player:~# aplay -v -Dplughw:1 /media/usb0/01_Rimsky-Korsakov\
Dance\ of\ the\ Tumblers.wav
Playing WAVE '/media/usb0/01_Rimsky-Korsakov Dance of the Tumblers.wav' :
Signed 24 bit Little Endian in 3bytes, Rate 176400 Hz, Stereo
Plug PCM: Linear conversion PCM (S32_LE)
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S24_3LE
  subformat    : STD
  channels     : 2
  rate         : 176400
  exact rate   : 176400 (176400/1)
  msbits       : 24
  buffer_size  : 88200
  period_size  : 22050
  period_time  : 125000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 22050
  period_event : 0
  start_threshold  : 88200
  stop_threshold   : 88200
  silence_threshold: 0
  silence_size : 0
  boundary     : 1445068800
Slave: Hardware PCM card 1 'WaveLink HS SPDIF' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 176400
  exact rate   : 176400 (176400/1)
  msbits       : 32
  buffer_size  : 88200
  period_size  : 22050
  period_time  : 125000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 22050
  period_event : 0
  start_threshold  : 88200
  stop_threshold   : 88200
  silence_threshold: 0
  silence_size : 0
  boundary     : 1445068800
  appl_ptr     : 0
  hw_ptr       : 0
underrun!!! (at least 1.537 ms long)
Status:
  state       : XRUN
  trigger_time: 1219.804905467
  tstamp      : 1219.820257912
  delay       : 0
  avail       : 88220
  avail_max   : 88220
underrun!!! (at least 13.900 ms long)
Status:
  state       : XRUN
  trigger_time: 1222.763695807
  tstamp      : 1222.902684537
  delay       : 0
  avail       : 66169
  avail_max   : 88219
underrun!!! (at least 1.279 ms long)
Status:
  state       : XRUN
  trigger_time: 1225.972436940
  tstamp      : 1225.985216250
  delay       : 0
  avail       : 88221
  avail_max   : 88221
underrun!!! (at least 14.141 ms long)

etc. until I stop the playback.

44.1 playback is fine under these conditions (but then why USB audio class 2?)

Further, using MPD for playback I have discovered that the high bit rate flac files play fine but the same files as wave have the same type of stall/stop problems.

I tried Windows on the Intel platform with similar problems using windows media player but no problems with VLC. However with Windows it is not easy to know what is really going on inside.

Is it possible that the essentially synchronous nature of playing a wave file from USB source to USB Audio device causes a collision since the data is going both ways at essentially the same rate and timing?

Let me know what other info you need.

Thanks for looking at this.
-Demian

-----Original Message-----
From: Daniel Mack [mailto:[email protected]] Sent: Saturday, August 21, 2010 2:27 AM
To: Demian Martin
Cc: alsa-devel-K7yf7f+aM1XWsZ/[email protected]
Subject: Re: Problem with USB Class 2 Audio Driver

Quoted 5 lines · Demian Martin

I'm testing an early sample of the Wavelength Wavelink, a USB to S/PDIF adapter that supports 44.1-192 KHz sample rates and uses async usb to talk to ALSA. It works and plays all of the sample rates correctly with the git version of Alsa from 7/30/2010 whenthe files are sourced from the network.

What do you mean by "from the network"? How does your test setup look like?

Quoted 3 lines

However if I try to play from a usb source to the usb dac it doesn't work and the whole system gets unstable.

You could also be more precise here :) What doesn't work, how are you testing, and in which regard does the system get unstable?

Quoted 4 lines

The platforms I have tested it on seem
to have a single USB host interface but with USB 2 there should be enough bandwidth to pass the data from a USB stick to the cpu and back. If I use

an

Quoted 5 lines

older 96 only usb dac on the same system it works (unless the down conversion isn't a direct divide, which overloads the CPU, but that is a different issue). The problem seems to be sample rate independent and hits the moment I try to access the file. This is using MPD as a player.

Ah, so your data file is stored on a media which is also connected to USB? Did you connect the two devices to different USB ports or do they share one uplink with a hub?

Quoted 4 lines

What additional info do you need to troubleshoot this? Is it an intrinsic limitation to the interface? What additional tests should I do? It's possible it's a hardware issue but how do I divide them so I can go back

to

Quoted 2 lines

the hardware guy if it's his issue?

I'm not aware of any limitation, but there could be such issues as exceeded bandwith on the bus and the like. How many audio channels are we talking about?

You could measure the speed of your USB media by using something like this:

	$ time dd if=/path/to/192khz.file of=/dev/null

This should take significantly less time than - let's say - half the real-time audio playback time of the file, so there's enough headroom to transport the audio data back to the USB DAC.

What kind of system is this, after all? Did you try other OS on the same hardware for comparsion?

Daniel

Signature · 24 lines
J. Gordon Rankin
Owner and Chief Scientist
====== Wavelength Audio, ltd ======
High-End Audio since 1981
SET Tube Amplifiers, DACS & Preamps
http://www.WavelengthAudio.com
===================================
Computer USB DACS
http://www.USBDacs.com
===================================
SET Tube Guitar Amplifiers
NAMM Member since 1998
http://www.Guitar-Engines.com
===================================
3703 Petoskey Avenue
Cincinnati, Ohio 45227 USA
mailto:[email protected]
mailto:wavelength-rDkNP/[email protected]
(513) 271-4186 phone/voicemail

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw
Quoted 4 lines · J. Gordon Rankin

Part of the problem could be that everything is working synchronously. The reading of the USB drive and the outputting to the USB converter are both happening in sync because the application would work this way.

True. But for the USB side of the story, there is a reserved part of the bandwidth for isochronous (real-time) data which is guaranteed for exacty such scenarios, so bulk data bursts wont't kill the stream.

The question is whether this reserved bandwidth is large enough for the application that causes trouble here, and if the driver does the right thing to let the core know about its needs.

Quoted 6 lines

High End Audio is usually nuts... but I have experienced that this type of combination results in poor output even when it works 100%. I have yet had time to figure out why... same reason that FLAC never sounds as good as a WAV file in my experience, though there I can verify that the CPU usage does go up higher than most people and engineers would suspect.

That shouldn't be a problem as long as the application reads its bulk data is chunks which are large enough. As far as I'm concerned, I've never seen such issues on Linux or Mac OS X, unless for very small data blocks, resulting in too tight scheduling. In other words, it might be an issue for any kind of real-time audio processing which requires minimal latency, but not for an audio player which can operate on huge blocks.

Daniel

Quoted 358 lines
Quoted 357 lines · Daniel Mack

Hi,

FWIW, I currently have no clue what could be the reason for this issue. I copied the linux-usb mailing list, maybe anyone over there has an idea.

Summary is: Demian is trying to play back an audio file over an USB connected soundcard, and the file itself is also stored on a media connected via USB. The transfer alone seems to be reasonably fast (tested with 'dd'), and the card itself also works fine (tested with a file stored on a different media), but the combination of them both fails. At least for high sample rates - iow, high data throughput.

Could there be anything wrong with the isochronous bandwith reservation?

Thanks,
Daniel

Quoted 336 lines · Demian Martin

Daniel:
I'll try to provide all the info you want. I'll need some prompting for some details, please be patient with me.

First the system.
I have tested on both an intel D945GSEJT atom based MB and an Alis 3.3 AMD Geode based mb.
OS: Linux auraliti-player 2.6.32auraliti-2.0 #1 PREEMPT Fri Jul 30 06:48:14 GMT 2010 i686 GNU/Linux
Distro Voyage Linux 0.6.1
It's a dedicated headless 2 channel audio player, sort of a high performance squeezebox. Details here: www.auraliti.com

When I play a file from a network source (connected through nfs) I have no problems with either .wav or .flac.

I don't know how to tell with certainty if the USB devices are connecting through a common or separate root hubs.

USB stick speed- It took 6.2 seconds to pass a 1 minute 19 second 192/24 file to dev/null so USB speed is not a problem.

It seems there is a collision when there is a high speed USB storage device and the USB class 2 audio on the same host port both moving data at the same time.

All of the following were done with the Alix board (Geode 500 MHz processor). The Intel does similar but seems more likely to work.

Under some conditions the system loses connection to the USB audio device:

auraliti-player:~# aplay -v -Dplughw:1
/media/usb0/Trio-Mytek8X192ADDA-192k.WAV
Playing WAVE '/media/usb0/Trio-Mytek8X192ADDA-192k.WAV' : Signed 24 bit
Little Endian in 3bytes, Rate 192000 Hz, Stereo
aplay: set_params:1116: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S24_3LE
SUBFORMAT:  STD
SAMPLE_BITS: 24
FRAME_BITS: 48
CHANNELS: 2
RATE: 192000
PERIOD_TIME: 125000
PERIOD_SIZE: 24000
PERIOD_BYTES: 144000
PERIODS: 4
BUFFER_TIME: 500000
BUFFER_SIZE: 96000
BUFFER_BYTES: 576000
TICK_TIME: 0
auraliti-player:~#

Fixed by disconnecting and reconnecting the device.

Here is what I get playing a 44.1 file, after about 15 seconds:

Playing WAVE '/media/usb0/Piano_44_1.wav' : Signed 24 bit Little Endian in 3bytes, Rate 44100 Hz, Stereo
Plug PCM: Linear conversion PCM (S32_LE)
Its setup is:

 stream       : PLAYBACK
 access       : RW_INTERLEAVED
 format       : S24_3LE
 subformat    : STD
 channels     : 2
 rate         : 44100
 exact rate   : 44100 (44100/1)
 msbits       : 24
 buffer_size  : 22050
 period_size  : 5513
 period_time  : 125011
 tstamp_mode  : NONE
 period_step  : 1
 avail_min    : 5513

period_event : 0
start_threshold : 22050
stop_threshold : 22050
silence_threshold: 0
silence_size : 0
boundary : 1445068800
Slave: Hardware PCM card 1 'WaveLink HS SPDIF' device 0 subdevice 0 Its setup is:

 stream       : PLAYBACK
 access       : MMAP_INTERLEAVED
 format       : S32_LE
 subformat    : STD
 channels     : 2
 rate         : 44100
 exact rate   : 44100 (44100/1)
 msbits       : 32
 buffer_size  : 22050
 period_size  : 5513
 period_time  : 125011
 tstamp_mode  : NONE
 period_step  : 1
 avail_min    : 5513
 period_event : 0
 start_threshold  : 22050
 stop_threshold   : 22050
 silence_threshold: 0
 silence_size : 0
 boundary     : 1445068800
 appl_ptr     : 0
 hw_ptr       : 0

underrun!!! (at least 0.015 ms long)
Status:
state : XRUN
trigger_time: 903.806908643

 tstamp      : 903.807038997
 delay       : 0
 avail       : 0
 avail_max   : 11028

aplay: xrun:1259: xrun: prepare error: File descriptor in bad state auraliti-player:~#

And the system stops playing.

And very quickly on a 176.4 file:

Playing WAVE '/media/usb0/01_Rimsky-Korsakov Dance of the Tumblers.wav' :
Signed 24 bit Little Endian in 3bytes, Rate 176400 Hz, Stereo Plug PCM: Linear conversion PCM (S32_LE)
Its setup is:

 stream       : PLAYBACK
 access       : RW_INTERLEAVED
 format       : S24_3LE
 subformat    : STD
 channels     : 2
 rate         : 176400
 exact rate   : 176400 (176400/1)
 msbits       : 24
 buffer_size  : 88200
 period_size  : 22050
 period_time  : 125000
 tstamp_mode  : NONE
 period_step  : 1
 avail_min    : 22050

period_event : 0
start_threshold : 88200
stop_threshold : 88200
silence_threshold: 0
silence_size : 0
boundary : 1445068800
Slave: Hardware PCM card 1 'WaveLink HS SPDIF' device 0 subdevice 0 Its setup is:

 stream       : PLAYBACK
 access       : MMAP_INTERLEAVED
 format       : S32_LE
 subformat    : STD
 channels     : 2
 rate         : 176400
 exact rate   : 176400 (176400/1)
 msbits       : 32
 buffer_size  : 88200
 period_size  : 22050
 period_time  : 125000
 tstamp_mode  : NONE
 period_step  : 1
 avail_min    : 22050
 period_event : 0
 start_threshold  : 88200
 stop_threshold   : 88200
 silence_threshold: 0
 silence_size : 0
 boundary     : 1445068800
 appl_ptr     : 0
 hw_ptr       : 0

underrun!!! (at least 0.010 ms long)
Status:
state : XRUN
trigger_time: 1050.313984810

 tstamp      : 1050.314067000
 delay       : 0
 avail       : 1413
 avail_max   : 22071

aplay: xrun:1259: xrun: prepare error: File descriptor in bad state auraliti-player:~#

If in interpose a USB 1 hub on the usb storage I get this:

auraliti-player:~# aplay -v -Dplughw:1 /media/usb0/01_Rimsky-Korsakov\
Dance\ of\ the\ Tumblers.wav
Playing WAVE '/media/usb0/01_Rimsky-Korsakov Dance of the Tumblers.wav' :
Signed 24 bit Little Endian in 3bytes, Rate 176400 Hz, Stereo
Plug PCM: Linear conversion PCM (S32_LE)
Its setup is:
 stream       : PLAYBACK
 access       : RW_INTERLEAVED
 format       : S24_3LE
 subformat    : STD
 channels     : 2
 rate         : 176400
 exact rate   : 176400 (176400/1)
 msbits       : 24
 buffer_size  : 88200
 period_size  : 22050
 period_time  : 125000
 tstamp_mode  : NONE
 period_step  : 1
 avail_min    : 22050
 period_event : 0
 start_threshold  : 88200
 stop_threshold   : 88200
 silence_threshold: 0
 silence_size : 0
 boundary     : 1445068800
Slave: Hardware PCM card 1 'WaveLink HS SPDIF' device 0 subdevice 0
Its setup is:
 stream       : PLAYBACK
 access       : MMAP_INTERLEAVED
 format       : S32_LE
 subformat    : STD
 channels     : 2
 rate         : 176400
 exact rate   : 176400 (176400/1)
 msbits       : 32
 buffer_size  : 88200
 period_size  : 22050
 period_time  : 125000
 tstamp_mode  : NONE
 period_step  : 1
 avail_min    : 22050
 period_event : 0
 start_threshold  : 88200
 stop_threshold   : 88200
 silence_threshold: 0
 silence_size : 0
 boundary     : 1445068800
 appl_ptr     : 0
 hw_ptr       : 0
underrun!!! (at least 1.537 ms long)
Status:
 state       : XRUN
 trigger_time: 1219.804905467
 tstamp      : 1219.820257912
 delay       : 0
 avail       : 88220
 avail_max   : 88220
underrun!!! (at least 13.900 ms long)
Status:
 state       : XRUN
 trigger_time: 1222.763695807
 tstamp      : 1222.902684537
 delay       : 0
 avail       : 66169
 avail_max   : 88219
underrun!!! (at least 1.279 ms long)
Status:
 state       : XRUN
 trigger_time: 1225.972436940
 tstamp      : 1225.985216250
 delay       : 0
 avail       : 88221
 avail_max   : 88221
underrun!!! (at least 14.141 ms long)

etc. until I stop the playback.

44.1 playback is fine under these conditions (but then why USB audio class 2?)

Further, using MPD for playback I have discovered that the high bit rate flac files play fine but the same files as wave have the same type of stall/stop problems.

I tried Windows on the Intel platform with similar problems using windows media player but no problems with VLC. However with Windows it is not easy to know what is really going on inside.

Is it possible that the essentially synchronous nature of playing a wave file from USB source to USB Audio device causes a collision since the data is going both ways at essentially the same rate and timing?

Let me know what other info you need.

Thanks for looking at this.
-Demian

-----Original Message-----
From: Daniel Mack [mailto:[email protected]] Sent: Saturday, August 21, 2010 2:27 AM
To: Demian Martin
Cc: alsa-devel-K7yf7f+aM1XWsZ/[email protected]
Subject: Re: Problem with USB Class 2 Audio Driver

Quoted 4 lines · Demian Martin

I'm testing an early sample of the Wavelength Wavelink, a USB to S/PDIF adapter that supports 44.1-192 KHz sample rates and uses async usb to talk to ALSA. It works and plays all of the sample rates correctly with the git version of Alsa from 7/30/2010 whenthe files are sourced from the network.

What do you mean by "from the network"? How does your test setup look like?

Quoted 2 lines

However if I try to play from a usb source to the usb dac it doesn't work and the whole system gets unstable.

You could also be more precise here :) What doesn't work, how are you testing, and in which regard does the system get unstable?

Quoted 3 lines

The platforms I have tested it on seem
to have a single USB host interface but with USB 2 there should be enough bandwidth to pass the data from a USB stick to the cpu and back. If I use

an

Quoted 4 lines

older 96 only usb dac on the same system it works (unless the down conversion isn't a direct divide, which overloads the CPU, but that is a different issue). The problem seems to be sample rate independent and hits the moment I try to access the file. This is using MPD as a player.

Ah, so your data file is stored on a media which is also connected to USB? Did you connect the two devices to different USB ports or do they share one uplink with a hub?

Quoted 3 lines

What additional info do you need to troubleshoot this? Is it an intrinsic limitation to the interface? What additional tests should I do? It's possible it's a hardware issue but how do I divide them so I can go back

to

Quoted 1 line

the hardware guy if it's his issue?

I'm not aware of any limitation, but there could be such issues as exceeded bandwith on the bus and the like. How many audio channels are we talking about?

You could measure the speed of your USB media by using something like this:

	$ time dd if=/path/to/192khz.file of=/dev/null

This should take significantly less time than - let's say - half the real-time audio playback time of the file, so there's enough headroom to transport the audio data back to the USB DAC.

What kind of system is this, after all? Did you try other OS on the same hardware for comparsion?

Quoted 27 lines
Quoted 5 lines
Quoted 3 lines

Daniel

Signature · 19 lines
J. Gordon Rankin
Owner and Chief Scientist
====== Wavelength Audio, ltd ======
High-End Audio since 1981
SET Tube Amplifiers, DACS & Preamps
http://www.WavelengthAudio.com
===================================
Computer USB DACS
http://www.USBDacs.com
===================================
SET Tube Guitar Amplifiers
NAMM Member since 1998
http://www.Guitar-Engines.com
===================================
3703 Petoskey Avenue
Cincinnati, Ohio 45227 USA
mailto:[email protected]
mailto:wavelength-rDkNP/[email protected]
(513) 271-4186 phone/voicemail

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

A message that is not in the archive (sent off-list or not yet received): 20100824070601.GK17833-ahpEBR4enfnCULTFXS99ULNAH6kLmebB@public.gmane.org

#10 lore raw

Am Dienstag, 24. August 2010, 09:06:02 schrieb Daniel Mack:

Quoted 9 lines · J. Gordon Rankin
Quoted 4 lines

Part of the problem could be that everything is working synchronously. The reading of the USB drive and the outputting to the USB converter are both happening in sync because the application would work this way.

True. But for the USB side of the story, there is a reserved part of the bandwidth for isochronous (real-time) data which is guaranteed for exacty such scenarios, so bulk data bursts wont't kill the stream.

Yes, but note that this works one-way. The audio can still starve the disk. You need to check in the device descriptors, how much bandwidth the audio device will take. Then you need to compute whether the rest left to the disk is enough.

Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#11 lore raw
In reply to a message not in the archive
Quoted 6 lines · Daniel Mack

Hi,

FWIW, I currently have no clue what could be the reason for this issue. I copied the linux-usb mailing list, maybe anyone over there has an idea.

Quoted 8 lines

Summary is: Demian is trying to play back an audio file over an USB connected soundcard, and the file itself is also stored on a media connected via USB. The transfer alone seems to be reasonably fast (tested with 'dd'), and the card itself also works fine (tested with a file stored on a different media), but the combination of them both fails. At least for high sample rates - iow, high data throughput.

Could there be anything wrong with the isochronous bandwith reservation?

I doubt it. But we have seen reports of problems before from people trying to do high-bandwidth transfers to multiple devices concurrently.

To start, let's see the "lsusb -v" output for the audio card and the storage device, together with the dmesg log showing the two devices being plugged in.

For tracking down the exact problem, it will help to have a usbmon trace showing what happens during playback. (Stop the playback after the first underrun occurs.) Instructions are in Documentation/usb/usbmon.txt.

Alan Stern

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

A message that is not in the archive (sent off-list or not yet received): Pine.LNX.4.44L0.1008241050320.1652-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org

#13 lore raw

Sorry for the slow response, the communications were trapped by Yahoo's spam filter. More details to follow.

First, I switched to a more powerful platform (slightly) the Intel Atom D945GSEJT.
I have managed to get Win & to run on this and it allowed me to test the same hardware doing the same task (as much as Windows permits). I can using adjacent USB ports boot Win & and play 192 KHz content through to the Wavelink 192 KHz USB audio interface without problems. This suggests (but isn't absolute proof) that the hardware is not a restriction.

Second, trying the suggestions below I noticed an error making this more difficult. When connecting the Wavelink I see its accessible from ALSA:

auraliti-player:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: SPDIF [WaveLink HS SPDIF], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

But invisible to lsusb. Its device 009 below:

auraliti-player:~# lsusb
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 006: ID 413c:3012 Dell Computer Corp. Optical Wheel Mouse
Bus 002 Device 005: ID 413c:2006 Dell Computer Corp.
Bus 002 Device 004: ID 10d5:000d Uni Class Technology Co., Ltd
Bus 002 Device 003: ID 413c:1004 Dell Computer Corp.
Bus 002 Device 002: ID 058f:9254 Alcor Micro Corp. Hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 009: ID 21b4:0210
Bus 001 Device 003: ID 1307:0163 Transcend Information, Inc. 256MB/512MB/1GB
Flash Drive
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Here is the message when its installed:

Sep  6 17:22:29 localhost vmunix: [ 1537.716042] usb 1-7: new high speed USB
device using ehci_hcd and address 9
Sep  6 17:22:29 localhost vmunix: [ 1537.830436] usb 1-7: config 1 has an
invalid interface number: 3 but max is 2
Sep  6 17:22:29 localhost vmunix: [ 1537.830518] usb 1-7: config 1 has no
interface number 2
Sep  6 17:22:29 localhost vmunix: [ 1537.830804] usb 1-7: config 1 has an
invalid interface number: 3 but max is 2
Sep  6 17:22:29 localhost vmunix: [ 1537.830884] usb 1-7: config 1 has no
interface number 2
Sep  6 17:22:29 localhost vmunix: [ 1537.833069] usb 1-7: configuration #1

chosen from 2 choices

Here is the detailed output from lsusb -v -s 001:009 | tee usb.txt

Bus 001 Device 009: ID 21b4:0210
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2 ?
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
idVendor 0x21b4
idProduct 0x0210
bcdDevice 1.51

  iManufacturer           1 Wavelength Audio, ltd.
  iProduct                2 WaveLink HS SPDIF
  iSerial                 3 (C) 2010 XMOS/Wavelength Audio
  bNumConfigurations      2

Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 168
bNumInterfaces 3
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 1 Audio
bFunctionSubClass 0
bFunctionProtocol 32
iFunction 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 1 Control Device
bInterfaceProtocol 32
iInterface 7 WaveLink HS SPDIF
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdADC 2.00
wTotalLength 31496
bInCollection 0
junk at descriptor end: 00
AudioControl Interface Descriptor:
bLength 8
bDescriptorType 36
bDescriptorSubtype 10 (unknown)
Invalid desc subtype: 28 01 07 00 01
AudioControl Interface Descriptor:
bLength 17
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 2
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bNrChannels 40
wChannelConfig 0x0302
Right Front (R)
Surround (S)
Side Left (SL)
iChannelNames 0
iTerminal 0
junk at descriptor end: 00 00 00 00 02
AudioControl Interface Descriptor:
bLength 18
bDescriptorType 36
bDescriptorSubtype 6 (FEATURE_UNIT)
bUnitID 10
bSourceID 2
bControlSize 0
iFeature 0
junk at descriptor end: 00 00 00 00 00 00 00 00 00 00 0f
AudioControl Interface Descriptor:
bLength 12
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 20
wTerminalType 0x0301 Speaker
bAssocTerminal 0
bSourceID 10
iTerminal 40 ËÌ
junk at descriptor end: 00 00 05
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 32
iInterface 8 WaveLink HS SPDIF
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 1
bNumEndpoints 2
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 32
iInterface 9 WaveLink HS SPDIF
AudioStreaming Interface Descriptor:
bLength 16
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 2
bDelay 0 frames
wFormatTag 257 undefined
junk at descriptor end: 00 00 00 02 03 00 00 00 00
AudioStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
Warning: Descriptor too short
bFormatType 1 (FORMAT_TYPE_I)
Warning: Descriptor too short
bNrChannels 4
bSubframeSize 24
bBitResolution 0
bSamFreqType 0 Continuous
tLowerSamFreq 0
tUpperSamFreq 12544
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0400 1x 1024 bytes
bInterval 1
AudioControl Endpoint Descriptor:
bLength 8
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x00
bLockDelayUnits 0 Undefined
wLockDelay 2050 Undefined
junk at descriptor end: 00
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 17
Transfer Type Isochronous
Synch Type None
Usage Type Feedback
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 8
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 254 Application Specific Interface
bInterfaceSubClass 1 Device Firmware Update
bInterfaceProtocol 0
iInterface 0
Device Firmware Upgrade Interface Descriptor:
bLength 7
bDescriptorType 33
bmAttributes 7
Will Not Detach
Manifestation Tolerant
Upload Supported
Download Supported
wDetachTimeout 250 milliseconds
wTransferSize 64 bytes
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 168
bNumInterfaces 3
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 1 Audio
bFunctionSubClass 0
bFunctionProtocol 32
iFunction 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 1 Control Device
bInterfaceProtocol 32
iInterface 7 WaveLink HS SPDIF
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdADC 2.00
wTotalLength 31496
bInCollection 0
junk at descriptor end: 00
AudioControl Interface Descriptor:
bLength 8
bDescriptorType 36
bDescriptorSubtype 10 (unknown)
Invalid desc subtype: 28 01 07 00 01
AudioControl Interface Descriptor:
bLength 17
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 2
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bNrChannels 40
wChannelConfig 0x0302
Right Front (R)
Surround (S)
Side Left (SL)
iChannelNames 0
iTerminal 0
junk at descriptor end: 00 00 00 00 02
AudioControl Interface Descriptor:
bLength 18
bDescriptorType 36
bDescriptorSubtype 6 (FEATURE_UNIT)
bUnitID 10
bSourceID 2
bControlSize 0
iFeature 0
junk at descriptor end: 00 00 00 00 00 00 00 00 00 00 0f
AudioControl Interface Descriptor:
bLength 12
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 20
wTerminalType 0x0301 Speaker
bAssocTerminal 0
bSourceID 10
iTerminal 40 ËÌ
junk at descriptor end: 00 00 05
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 32
iInterface 8 WaveLink HS SPDIF
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 1
bNumEndpoints 2
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 32
iInterface 9 WaveLink HS SPDIF
AudioStreaming Interface Descriptor:
bLength 16
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 2
bDelay 0 frames
wFormatTag 257 undefined
junk at descriptor end: 00 00 00 02 03 00 00 00 00
AudioStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
Warning: Descriptor too short
bFormatType 1 (FORMAT_TYPE_I)
Warning: Descriptor too short
bNrChannels 4
bSubframeSize 24
bBitResolution 0
bSamFreqType 0 Continuous
tLowerSamFreq 0
tUpperSamFreq 12544
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0400 1x 1024 bytes
bInterval 1
AudioControl Endpoint Descriptor:
bLength 8
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x00
bLockDelayUnits 0 Undefined
wLockDelay 2050 Undefined
junk at descriptor end: 00
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 17
Transfer Type Isochronous
Synch Type None
Usage Type Feedback
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 8
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 254 Application Specific Interface
bInterfaceSubClass 1 Device Firmware Update
bInterfaceProtocol 0
iInterface 0
Device Firmware Upgrade Interface Descriptor:
bLength 7
bDescriptorType 33
bmAttributes 7
Will Not Detach
Manifestation Tolerant
Upload Supported
Download Supported
wDetachTimeout 250 milliseconds
wTransferSize 64 bytes
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00

  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 

bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0000
(Bus Powered)

I need to figure out how to install usbmon on this debian platform before I can get a trace. I may be able to borrow a USB sniffer if that helps.
-Demian

-----Original Message-----
From: Alan Stern [mailto:stern-nwvwT67g6+6dFdvTe/[email protected]]
Sent: Tuesday, August 24, 2010 7:56 AM
To: Daniel Mack
Cc: Demian Martin; alsa-devel-K7yf7f+aM1XWsZ/[email protected]; 'J. Gordon Rankin'; [email protected]
Subject: Re: Problem with USB Class 2 Audio Driver

Quoted 6 lines · Daniel Mack

Hi,

FWIW, I currently have no clue what could be the reason for this issue. I copied the linux-usb mailing list, maybe anyone over there has an idea.

Quoted 8 lines

Summary is: Demian is trying to play back an audio file over an USB connected soundcard, and the file itself is also stored on a media connected via USB. The transfer alone seems to be reasonably fast (tested with 'dd'), and the card itself also works fine (tested with a file stored on a different media), but the combination of them both fails. At least for high sample rates - iow, high data throughput.

Could there be anything wrong with the isochronous bandwith reservation?

I doubt it. But we have seen reports of problems before from people trying to do high-bandwidth transfers to multiple devices concurrently.

To start, let's see the "lsusb -v" output for the audio card and the storage device, together with the dmesg log showing the two devices being plugged in.

For tracking down the exact problem, it will help to have a usbmon trace showing what happens during playback. (Stop the playback after the first underrun occurs.) Instructions are in Documentation/usb/usbmon.txt.

Alan Stern

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

#14 lore raw
Quoted 6 lines · Demian Martin

Sorry for the slow response, the communications were trapped by Yahoo's spam filter. More details to follow.

First, I switched to a more powerful platform (slightly) the Intel Atom D945GSEJT.
I have managed to get Win & to run on this and it allowed me to test the

Windows 7?

Quoted 7 lines

same hardware doing the same task (as much as Windows permits). I can using adjacent USB ports boot Win & and play 192 KHz content through to the Wavelink 192 KHz USB audio interface without problems. This suggests (but isn't absolute proof) that the hardware is not a restriction.

Second, trying the suggestions below I noticed an error making this more difficult. When connecting the Wavelink I see its accessible from ALSA:

Quoted 7 lines
auraliti-player:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: SPDIF [WaveLink HS SPDIF], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

But invisible to lsusb. Its device 009 below:

What do you mean by "invisible"? It's plainly visible as device 009, as you point out.

Quoted 27 lines
auraliti-player:~# lsusb
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 006: ID 413c:3012 Dell Computer Corp. Optical Wheel Mouse
Bus 002 Device 005: ID 413c:2006 Dell Computer Corp.
Bus 002 Device 004: ID 10d5:000d Uni Class Technology Co., Ltd
Bus 002 Device 003: ID 413c:1004 Dell Computer Corp.
Bus 002 Device 002: ID 058f:9254 Alcor Micro Corp. Hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 009: ID 21b4:0210
Bus 001 Device 003: ID 1307:0163 Transcend Information, Inc. 256MB/512MB/1GB
Flash Drive
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Here is the message when its installed:

Sep  6 17:22:29 localhost vmunix: [ 1537.716042] usb 1-7: new high speed USB
device using ehci_hcd and address 9
Sep  6 17:22:29 localhost vmunix: [ 1537.830436] usb 1-7: config 1 has an
invalid interface number: 3 but max is 2
Sep  6 17:22:29 localhost vmunix: [ 1537.830518] usb 1-7: config 1 has no
interface number 2
Sep  6 17:22:29 localhost vmunix: [ 1537.830804] usb 1-7: config 1 has an
invalid interface number: 3 but max is 2
Sep  6 17:22:29 localhost vmunix: [ 1537.830884] usb 1-7: config 1 has no
interface number 2
Sep  6 17:22:29 localhost vmunix: [ 1537.833069] usb 1-7: configuration #1
Quoted 1 line

chosen from 2 choices

The stupid firmware lists config 1 twice! And within config 1, it has interfaces 0, 1, and 3! Nevertheless, it should still work.

Quoted 2 lines

I need to figure out how to install usbmon on this debian platform before I can get a trace. I may be able to borrow a USB sniffer if that helps.

There's probably nothing to install. Try just following the instructions.

Alan Stern

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