All of lore.kernel.org
 help / color / mirror / Atom feed
* Rate or plug plugin issue with snd-pcsp
@ 2014-06-03  7:54 Alexander E. Patrakov
  2014-06-05  4:53 ` Raymond Yau
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander E. Patrakov @ 2014-06-03  7:54 UTC (permalink / raw)
  To: ALSA Development Mailing List

Hello.

While testing application support for weird-rate cards (such as 
snd-pcsp), I found a bug in alsa-lib. Alsa-plugins are installed, so the 
"libspeex (builtin)" rate converter is used. This bug already exists in 
alsa-plugins 1.0.27.2, so not a regression and thus should not block 1.0.28.

$ file test.wav
test.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, 
stereo 32000 Hz

$ aplay -vvv -D plughw:pcsp test.wav
Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 32000 Hz, Stereo
aplay: set_params:1297: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: NONE
PERIOD_TIME: (125006 125007)
PERIOD_SIZE: NONE
PERIOD_BYTES: (16000 16004)
PERIODS: (3 4)
BUFFER_TIME: 500000
BUFFER_SIZE: 16000
BUFFER_BYTES: 64000
TICK_TIME: 0

The pcsp device supports the sample rate of 37286 Hz.

Files with 44100 Hz sample rate work fine.

$ aplay -vv -D plughw:pcsp -f cd /dev/zero
Playing raw data '/dev/zero' : Signed 16 bit Little Endian, Rate 44100 
Hz, Stereo
Plug PCM: Route conversion PCM (sformat=S16_LE)
   Transformation table:
     0 <- 0*0,5 + 1*0,5
Its setup is:
   stream       : PLAYBACK
   access       : RW_INTERLEAVED
   format       : S16_LE
   subformat    : STD
   channels     : 2
   rate         : 44100
   exact rate   : 44100 (44100/1)
   msbits       : 16
   buffer_size  : 22050
   period_size  : 5512
   period_time  : 125006
   tstamp_mode  : NONE
   period_step  : 1
   avail_min    : 5512
   period_event : 0
   start_threshold  : 22050
   stop_threshold   : 22050
   silence_threshold: 0
   silence_size : 0
   boundary     : 6206523236469964800
Slave: Rate conversion PCM (37286, sformat=S16_LE)
Converter: libspeex (builtin)
Protocol version: 10002
Its setup is:
   stream       : PLAYBACK
   access       : MMAP_INTERLEAVED
   format       : S16_LE
   subformat    : STD
   channels     : 1
   rate         : 44100
   exact rate   : 44100 (44100/1)
   msbits       : 16
   buffer_size  : 22050
   period_size  : 5512
   period_time  : 125006
   tstamp_mode  : NONE
   period_step  : 1
   avail_min    : 5512
   period_event : 0
   start_threshold  : 22050
   stop_threshold   : 22050
   silence_threshold: 0
   silence_size : 0
   boundary     : 6206523236469964800
Slave: Hardware PCM card 2 'pcsp' device 0 subdevice 0
Its setup is:
   stream       : PLAYBACK
   access       : MMAP_INTERLEAVED
   format       : S16_LE
   subformat    : STD
   channels     : 1
   rate         : 37286
   exact rate   : 37286 (37286/1)
   msbits       : 16
   buffer_size  : 18644
   period_size  : 4661
   period_time  : 125006
   tstamp_mode  : NONE
   period_step  : 1
   avail_min    : 4661
   period_event : 0
   start_threshold  : 18644
   stop_threshold   : 18644
   silence_threshold: 0
   silence_size : 0
   boundary     : 5247819465793470464
   appl_ptr     : 0
   hw_ptr       : 0
#+                                                 | 00%^C

-- 
Alexander E. Patrakov

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Rate or plug plugin issue with snd-pcsp
  2014-06-03  7:54 Rate or plug plugin issue with snd-pcsp Alexander E. Patrakov
@ 2014-06-05  4:53 ` Raymond Yau
  0 siblings, 0 replies; 2+ messages in thread
From: Raymond Yau @ 2014-06-05  4:53 UTC (permalink / raw)
  To: Alexander E. Patrakov; +Cc: ALSA Development Mailing List

>
> While testing application support for weird-rate cards (such as
snd-pcsp), I found a bug in alsa-lib. Alsa-plugins are installed, so the
"libspeex (builtin)" rate converter is used. This bug already exists in
alsa-plugins 1.0.27.2, so not a regression and thus should not block 1.0.28.
>
> $ file test.wav
> test.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit,
stereo 32000 Hz
>
> $ aplay -vvv -D plughw:pcsp test.wav
> Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 32000 Hz,
Stereo
> aplay: set_params:1297: Unable to install hw params:
> ACCESS:  RW_INTERLEAVED
> FORMAT:  S16_LE
> SUBFORMAT:  STD
> SAMPLE_BITS: 16
> FRAME_BITS: 32
> CHANNELS: 2
> RATE: NONE
> PERIOD_TIME: (125006 125007)
> PERIOD_SIZE: NONE
> PERIOD_BYTES: (16000 16004)
> PERIODS: (3 4)
> BUFFER_TIME: 500000
> BUFFER_SIZE: 16000
> BUFFER_BYTES: 64000
> TICK_TIME: 0
>
> The pcsp device supports the sample rate of 37286 Hz.

PERIOD_SIZE: NONE

Seem driver bug which use sndrv_pcm_rate_knot when only support single rate
and

The constraint refinement  need driver  usIng equal size periods

snd_pcm_hw_constraint_integer(runtime,
   SNDRV_PCM_HW_PARAM_PERIODS)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-05  4:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-03  7:54 Rate or plug plugin issue with snd-pcsp Alexander E. Patrakov
2014-06-05  4:53 ` Raymond Yau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.