[alsa-devel] Need help on mmap
Takashi Iwai
tiwai at suse.de
Wed Jun 24 12:10:10 CEST 2009
At Mon, 22 Jun 2009 11:54:46 -0700 (PDT),
Christopher Tsui wrote:
>
> Hi
>
> I am in the process of add mmap support in my ALSA driver.
>
> So this is what i have done so far
>
> In snd_pcm_hardware structure
> .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID
>
> In snd_pcm_ops structure
> .mmap = my_pcm_mmap
>
> So to test my code, I use
> aplay -M -Dhw:0 rock.wav
>
> and this is what I get
> ALSA lib pcm_mmap.c:378:(snd_pcm_mmap) mmap failed: Invalid argument
> aplay: set_params:1022: Unable to install hw params:
> ACCESS: MMAP_INTERLEAVED
> FORMAT: S16_LE
> SUBFORMAT: STD
> SAMPLE_BITS: 16
> FRAME_BITS: 32
> CHANNELS: 2
> RATE: 44100
> PERIOD_TIME: (27210 27211)
> PERIOD_SIZE: 1200
> PERIOD_BYTES: 4800
> PERIODS: 4
> BUFFER_TIME: (108843 108844)
> BUFFER_SIZE: 4800
> BUFFER_BYTES: 19200
> TICK_TIME:
> 10000
The buffer setup looks strange. It couldn't be resolved to the right
configuration. You see BUFFER_TIME is between 108843 and 108844, so
there is no integer value between them.
Maybe your snd_pcm_hardware is consistent, or you give a too strict
hw_constraint.
Anyway, a bit more code snippet would be helpful to analyze.
Takashi
More information about the Alsa-devel
mailing list