All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>
Cc: alsa-devel@alsa-project.org, lars@metafoo.de,
	Takashi Iwai <tiwai@suse.de>,
	nsekhar@ti.com, Jyri Sarha <jsarha@ti.com>,
	zonque@gmail.com
Subject: Re: [PATCH v3 1/3] ASoC: davinci-mcasp: Constraint on the period and buffer size based on FIFO usage
Date: Tue, 18 Mar 2014 16:28:55 +0200	[thread overview]
Message-ID: <53285827.1070709@ti.com> (raw)
In-Reply-To: <532848D5.30806@ti.com>

On 03/18/2014 03:23 PM, Peter Ujfalusi wrote:
> On 03/18/2014 03:20 PM, Peter Ujfalusi wrote:
>> We need to place constraint on the period if the read or write AFIFO
>> is enabled and it is configured for more than one word otherwise
>> the DMA will fail in buffer configuration where the sizes are not
>> aligned with the requested FIFO configuration.
> 
> Oh, I edited the commit message and removed the text related to buffer size
> but I failed to do that for the commit title :(

Actually I still have issue with the constraint.
If I play a 48KHz sample with mplayer it is fine:
Trying preferred audio driver 'alsa', options '[none]'
alsa-init: requested format: 48000 Hz, 2 channels, 9
alsa-init: using ALSA 1.0.27.2
alsa-init: setup for 1/2 channel(s)
alsa-init: using device default
alsa-init: opening device in blocking mode
alsa-init: device reopened in blocking mode
alsa-init: got buffersize=96000
alsa-init: got period size 1600
alsa: 48000 Hz/2 channels/4 bpf/96000 bytes buffer/Signed 16 bit Little Endian
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
AO: Description: ALSA-0.9.x-1.x audio output
AO: Author: Alex Beregszaszi, Zsolt Barat <joy@streamminister.de>
AO: Comment: under development
Building audio filter chain for 48000Hz/2ch/s16le -> 48000Hz/2ch/s16le...


However if I play 44.1KHz sample with mplayer:
Trying preferred audio driver 'alsa', options '[none]'
alsa-init: requested format: 44100 Hz, 2 channels, 9
alsa-init: using ALSA 1.0.27.2
alsa-init: setup for 1/2 channel(s)
alsa-init: using device default
alsa-init: opening device in blocking mode
alsa-init: device reopened in blocking mode
ALSA ERROR hw_params: set_near (BUFFER_TIME)
           value = 500000 : Invalid argument
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 44100
PERIOD_TIME: 50000
PERIOD_SIZE: NONE
PERIOD_BYTES: [4736 65536]
PERIODS: (1 19)
BUFFER_TIME: 500000
BUFFER_SIZE: 22050
BUFFER_BYTES: 88200
TICK_TIME: ALL
[AO_ALSA] Unable to set buffer time near: Invalid argument
Failed to initialize audio driver 'alsa'


Now if I place the same constraint to the buffer size as well and playing the
same 44.1KHz sample:
Trying preferred audio driver 'alsa', options '[none]'
alsa-init: requested format: 44100 Hz, 2 channels, 9
alsa-init: using ALSA 1.0.27.2
alsa-init: setup for 1/2 channel(s)
alsa-init: using device default
alsa-init: opening device in blocking mode
alsa-init: device reopened in blocking mode
alsa-init: got buffersize=88192
alsa-init: got period size 1696
alsa: 44100 Hz/2 channels/4 bpf/88192 bytes buffer/Signed 16 bit Little Endian
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
AO: Description: ALSA-0.9.x-1.x audio output
AO: Author: Alex Beregszaszi, Zsolt Barat <joy@streamminister.de>
AO: Comment: under development
Building audio filter chain for 44100Hz/2ch/s16le -> 44100Hz/2ch/s16le...

It seams that I need to place the same constraint step to both period size and
buffer size.
For some reason snd_pcm_hw_params_set_buffer_time_near() fails in case of
44.1KHz when asking for 0.5s buffer when I placed step 32 constraint to period
size. Placing the same 32 steps constraint to the buffer size as well will
make things working (for mplayer at least)

-- 
Péter

  reply	other threads:[~2014-03-18 14:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-18 13:20 [PATCH v3 0/3] ASoC: davinci: perparation for eDMA dmaengine PCM Peter Ujfalusi
2014-03-18 13:20 ` [PATCH v3 1/3] ASoC: davinci-mcasp: Constraint on the period and buffer size based on FIFO usage Peter Ujfalusi
2014-03-18 13:23   ` Peter Ujfalusi
2014-03-18 14:28     ` Peter Ujfalusi [this message]
2014-03-18 18:07       ` Mark Brown
2014-03-19 11:13         ` Peter Ujfalusi
2014-03-19 13:14           ` Mark Brown
2014-03-20 13:47             ` Peter Ujfalusi
2014-03-20 14:15               ` Lars-Peter Clausen
2014-03-25 10:07                 ` Peter Ujfalusi
2014-03-18 13:20 ` [PATCH v3 2/3] ASoC: davinci-mcasp: Assign the dma_data earlier in dai_probe callback Peter Ujfalusi
2014-03-19 13:19   ` Mark Brown
2014-03-18 13:20 ` [PATCH v3 3/3] ASoC: davinci-pcm: Add empty functions for !CONFIG_SND_DAVINCI_SOC builds Peter Ujfalusi
2014-03-19 13:16   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53285827.1070709@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jsarha@ti.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=nsekhar@ti.com \
    --cc=tiwai@suse.de \
    --cc=zonque@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.