Need help on mmap
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: STDSAMPLE_BITS: 16FRAME_BITS: 32
CHANNELS: 2
RATE: 44100PERIOD_TIME: (27210 27211)PERIOD_SIZE: 1200PERIOD_BYTES: 4800
PERIODS: 4BUFFER_TIME: (108843 108844)BUFFER_SIZE: 4800BUFFER_BYTES: 19200TICK_TIME:
10000
What am I doing wrong??
Thanks in advance
At Mon, 22 Jun 2009 11:54:46 -0700 (PDT),
Quoted 27 lines · Christopher Tsui
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_hardwarestructure
.info =SNDRV_PCM_INFO_INTERLEAVED|SNDRV_PCM_INFO_MMAP|SNDRV_PCM_INFO_MMAP_VALIDIn
snd_pcm_opsstructure
.mmap =my_pcm_mmapSo to test my code, I use
aplay -M -Dhw:0 rock.wavand 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: STDSAMPLE_BITS: 16FRAME_BITS: 32
CHANNELS: 2
RATE: 44100PERIOD_TIME: (27210 27211)
Quoted 8 lines
PERIOD_SIZE: 1200PERIOD_BYTES: 4800
PERIODS: 4BUFFER_TIME: (108843 108844)BUFFER_SIZE: 4800BUFFER_BYTES: 19200TICK_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