[alsa-devel] Getting XRUN after writei in RUNNING state?

Piers O'Hanlon p.ohanlon at cs.ucl.ac.uk
Fri Nov 9 18:07:19 CET 2007


Hi,

Thanks for getting back me.

Jaroslav Kysela wrote:
> On Fri, 9 Nov 2007, Piers O'Hanlon wrote:
> ....
>
> Could you do whole dump (snd_pcm_dump()) to see all plugins in chain?
> I judge from period_size that we have another problem with rate plugin.
> It would be better to do rate resampling in RAT.
>   
I set the period size to the match the closest to the expected minimum
audio packet size (20ms - 320 bytes in our case) - I wasn't sure the
best choice for all parameters. I initially set the buffer size to
approx 3 packets - though I tried increasing to twice that. It just
wasn't clear which parameters were causing it to go into XRUN (I also
set the stop threshold to maximum to make sure it was the stop
threshold  - though I guess it it overrun the buffer size we'll get
audio from the beginning of the ring buffer anyway wthat wouldn't sound
too good)

(snd_pcm_dump()) is below:

 
Plug PCM: Rate conversion PCM (48000, sformat=S16_LE)
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 1
  rate         : 16000
  exact rate   : 16000 (16000/1)
  msbits       : 16
  buffer_size  : 2048
  period_size  : 341
  period_time  : 21333
  tick_time    : 0
  tstamp_mode  : NONE
  period_step  : 1
  sleep_min    : 0
  avail_min    : 341
  xfer_align   : 1
  start_threshold  : 341
  stop_threshold   : 2048
  silence_threshold: 0
  silence_size : 0
  boundary     : 536870912
Slave: Route conversion PCM (sformat=S16_LE)
  Transformation table:
    0 <- 0
    1 <- 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 1
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 16
  buffer_size  : 6144
  period_size  : 1024
  period_time  : 21333
  tick_time    : 0
  tstamp_mode  : NONE
  period_step  : 1
  sleep_min    : 0
  avail_min    : 1024
  xfer_align   : 3
  start_threshold  : 1024
  stop_threshold   : 6144
  silence_threshold: 0
  silence_size : 0
  boundary     : 1610612736
Slave: Direct Stream Mixing PCM
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 16
  buffer_size  : 6144
  period_size  : 1024
  period_time  : 21333
  tick_time    : 0
  tstamp_mode  : NONE
  period_step  : 1
  sleep_min    : 0
  avail_min    : 1024
  xfer_align   : 3
  start_threshold  : 1024
  stop_threshold   : 6144
  silence_threshold: 0
  silence_size : 0
  boundary     : 1610612736
Hardware PCM card 0 'AMD AMD8111' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 16
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tick_time    : 4000
  tstamp_mode  : NONE
  period_step  : 1
  sleep_min    : 0
  avail_min    : 1024
  xfer_align   : 1024
  start_threshold  : 1
  stop_threshold   : 1073741824
  silence_threshold: 0
  silence_size : 1073741824
  boundary     : 1073741824

> 						Jaroslav
>
> -----
> Jaroslav Kysela <perex at perex.cz>
> Linux Kernel Sound Maintainer
> ALSA Project
>   



More information about the Alsa-devel mailing list