[alsa-devel] What is the meaning of the mask values in the pcm hw constraints struct ?
I am developing an ASoC driver for a custom SoC (not in tree yet), I have written the platform and board modules and my hardware detects and installs ok, im now trying to play sound using aplay but im having issues.
I get the error "aplay: set_params:1022: Unable to install hw params:" I have traced the problem to a failing ioctl call (snd_pcm_playback_ioctl) the error occurs in snd_pcm_hw_refine when refining the mask for the SNDRV_PCM_HW_PARAM_ACCESS mask, all the bit fields in my runtime->hw_constraints are zero for this field, but the requested params have the value 7, Im not sure what this means, the SNDRV_PCM_ACCESS_xxx defines in asound.h only go upto 4 ?
I have attached logs below (with RULES_DEBUG turned on) hopefully this may shed some light.
Thanks in advance for any help,
Neil Jones
Logs:
# /usr/bin/aplay /var/snd48khz.wav Playing WAVE '/var/snd48khz.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo aplay: set_params:1022: Unable to install hw params: ACCESS: RW_INTERLEAVED FORMAT: S16_LE SUBFORMAT: STD SAMPLE_BITS: 16 FRAME_BITS: 32 CHANNELS: 2 RATE: 48000 PERIOD_TIME: (85333 85334) PERIOD_SIZE: 4096 PERIOD_BYTES: 16384 PERIODS: (5 6) BUFFER_TIME: 500000 BUFFER_SIZE: 24000 BUFFER_BYTES: 96000 TICK_TIME: 0
(klog) ... Rule 0 [4030f9f4]: FORMAT = 4 -> 4 Rule 2 [4030f750]: SAMPLE_BITS = [16 16] -> [16 16] Rule 4 [4030f90c]: FRAME_BITS = [16 16] -> [16 16] Rule 5 [4030f90c]: FRAME_BITS = [16 16] -> [16 16] Rule 7 [4030f90c]: RATE = [48000 48000] -> [48000 48000] Rule 8 [4030f90c]: RATE = [48000 48000] -> [48000 48000] Rule 9 [4030f750]: PERIODS = [1 128] -> [1 128] Rule 10 [4030f750]: PERIOD_SIZE = [16 4096] -> [16 4096] Rule 12 [4030f828]: PERIOD_SIZE = [16 4096] -> [16 4096] Rule 15 [4030f828]: BUFFER_SIZE = [16 65536] -> [16 65536] Rule 18 [4030f90c]: PERIOD_TIME = (166 128000] -> (333 85334) Rule 19 [4030f90c]: BUFFER_TIME = (166 2048000] -> (333 1365334) Rule 7 [4030f90c]: RATE = [48000 48000] -> [48000 48000] Rule 8 [4030f90c]: RATE = [48000 48000] -> [48000 48000] Rule 12 [4030f828]: PERIOD_SIZE = [16 4096] -> [16 4096] Rule 15 [4030f828]: BUFFER_SIZE = [16 65536] -> [16 65536] ACCESS = 0000000000000007 -> 0000000000000000 - This message is subject to Imagination Technologies' e-mail terms: http://www.imgtec.com/e-mail.htm
Imagination Technologies Ltd is a limited company registered in England No: 1306335 Registered Office: Imagination House, Home Park Estate, Kings Langley, Hertfordshire, WD4 8LZ.
Email to and from the company may be monitored for compliance and other administrative purposes. -
On Tue, Oct 20, 2009 at 04:54:32PM +0100, Neil Jones wrote:
I get the error "aplay: set_params:1022: Unable to install hw params:" I have traced the problem to a failing ioctl call (snd_pcm_playback_ioctl) the error occurs in snd_pcm_hw_refine when refining the mask for the SNDRV_PCM_HW_PARAM_ACCESS mask, all the bit fields in my runtime->hw_constraints are zero for this field, but the
You should set these up with snd_soc_set_runtime_hwparams() with the flags in the info field.
requested params have the value 7, Im not sure what this means, the SNDRV_PCM_ACCESS_xxx defines in asound.h only go upto 4 ?
It's a bitmask at this point, treat those values as shifts.
I get the error "aplay: set_params:1022: Unable to install hw
params:"
I have traced the problem to a failing ioctl call (snd_pcm_playback_ioctl) the error occurs in snd_pcm_hw_refine when refining the mask for the SNDRV_PCM_HW_PARAM_ACCESS mask, all the bit fields in my runtime->hw_constraints are zero for this field, but the
You should set these up with snd_soc_set_runtime_hwparams() with the flags in the info field.
requested params have the value 7, Im not sure what this means, the SNDRV_PCM_ACCESS_xxx defines in asound.h only go upto 4 ?
It's a bitmask at this point, treat those values as shifts.
Cheers, I wasn't setting the 'SNDRV_PCM_INFO_MMAP' in my snd_pcm_hardware description, because I didn't have MMAP support, I have now added MMAP support to my driver to resolve this issue, although I thought ALSA/aplay supported drivers without MMAP support ?
- This message is subject to Imagination Technologies' e-mail terms: http://www.imgtec.com/e-mail.htm
Imagination Technologies Ltd is a limited company registered in England No: 1306335 Registered Office: Imagination House, Home Park Estate, Kings Langley, Hertfordshire, WD4 8LZ.
Email to and from the company may be monitored for compliance and other administrative purposes. -
On Fri, Oct 23, 2009 at 02:39:58PM +0100, Neil Jones wrote:
Cheers, I wasn't setting the 'SNDRV_PCM_INFO_MMAP' in my snd_pcm_hardware description, because I didn't have MMAP support, I have now added MMAP support to my driver to resolve this issue, although I thought ALSA/aplay supported drivers without MMAP support ?
It should be supportable, yes, although to be honest I've never actually looked at hardware that can't deal with mmap() so I don't know off hte top of my head what the required setup is.
participants (2)
-
Mark Brown
-
Neil Jones