namehint seem use the conf file to find out the front and surround devices
do "aplay -L" or "arecord -L" still work if the sound card does not has conf file ?
PA already fallback to use "hw" and "plughw" when "front" is not available
Since PA only can handle SND_PCM_ACCESS_MMAP_ INTERLEAVED or SND_PCM_ACCESS_RW_INTERLEAVED and the card only support SNDRV_PCM_INFO_NONINTERLEAVED ,
it fall back to use traditional mode (not timer schedule) and relies on "plug" to perform "interleave" to "noninterleaved" and channels conversion
http://git.0pointer.de/?p=pulseaudio.git;a=blob;f=src/modules/alsa/alsa-util...
D: reserve-wrap.c: Successfully create reservation lock monitor for device 'Audio0' D: alsa-util.c: Checking for superset analog-stereo (front:%f) D: alsa-util.c: Trying front:0 with SND_PCM_NO_AUTO_FORMAT ... I: (alsa-lib)confmisc.c: Unable to find definition 'cards.H-DSP.pcm.front.0:CARD=0' I: (alsa-lib)conf.c: function snd_func_refer returned error: No such file or directory I: (alsa-lib)conf.c: Evaluate error: No such file or directory I: (alsa-lib)pcm.c: Unknown PCM front:0 I: alsa-util.c: Error opening PCM device front:0: No such file or directory
D: alsa-util.c: Trying hw:0 with SND_PCM_NO_AUTO_FORMAT ... D: alsa-util.c: Managed to open hw:0 D: alsa-util.c: snd_pcm_hw_params_set_access() failed: Invalid argument D: alsa-util.c: Trying hw:0 without SND_PCM_NO_AUTO_FORMAT ... D: alsa-util.c: Managed to open hw:0 D: alsa-util.c: snd_pcm_hw_params_set_access() failed: Invalid argument D: alsa-util.c: Trying plug:hw:0 with SND_PCM_NO_AUTO_FORMAT ... D: alsa-util.c: Managed to open plug:hw:0 D: alsa-util.c: snd_pcm_hw_params_set_format(Signed 16 bit Little Endian) failed: Invalid argument D: alsa-util.c: snd_pcm_hw_params_set_format(Signed 16 bit Big Endian) failed: Invalid argument D: alsa-util.c: snd_pcm_hw_params_set_format(Float 32 bit Little Endian) failed: Invalid argument D: alsa-util.c: snd_pcm_hw_params_set_format(Float 32 bit Big Endian) failed: Invalid argument D: alsa-util.c: snd_pcm_hw_params_set_channels(2) failed: Invalid argument
D: alsa-util.c: Trying plug:hw:0 without SND_PCM_NO_AUTO_FORMAT ... D: alsa-util.c: Managed to open plug:hw:0 D: alsa-util.c: snd_pcm_hw_params_set_channels(2) failed: Invalid argument - 顯示引用文字 -
I: alsa-util.c: Failed to set hardware parameters on plug:hw:0: Invalid argument
...
D: alsa-util.c: Checking for subset analog-mono (hw:%f) D: alsa-util.c: Trying hw:0 with SND_PCM_NO_AUTO_FORMAT ... D: alsa-util.c: Managed to open hw:0 D: alsa-util.c: snd_pcm_hw_params_set_access() failed: Invalid argument D: alsa-util.c: Trying hw:0 without SND_PCM_NO_AUTO_FORMAT ... D: alsa-util.c: Managed to open hw:0 D: alsa-util.c: snd_pcm_hw_params_set_access() failed: Invalid argument D: alsa-util.c: Trying plug:hw:0 with SND_PCM_NO_AUTO_FORMAT ... D: alsa-util.c: Managed to open plug:hw:0 D: alsa-util.c: snd_pcm_hw_params_set_format(Signed 16 bit Little Endian) failed: Invalid argument D: alsa-util.c: snd_pcm_hw_params_set_format(Signed 16 bit Big Endian) failed: Invalid argument D: alsa-util.c: snd_pcm_hw_params_set_format(Float 32 bit Little Endian) failed: Invalid argument D: alsa-util.c: snd_pcm_hw_params_set_format(Float 32 bit Big Endian) failed: Invalid argument D: alsa-util.c: snd_pcm_hw_params_set_channels(1) failed: Invalid argument D: alsa-util.c: Trying plug:hw:0 without SND_PCM_NO_AUTO_FORMAT ... D: alsa-util.c: Managed to open plug:hw:0 D: alsa-util.c: snd_pcm_hw_params_set_channels(1) failed: Invalid argument I: alsa-util.c: Failed to set hardware parameters on plug:hw:0: Invalid argument D: alsa-util.c: Trying hw:0 as last resort... D: alsa-util.c: Trying hw:0 with SND_PCM_NO_AUTO_FORMAT ... D: alsa-util.c: Managed to open hw:0 D: alsa-util.c: snd_pcm_hw_params_set_access() failed: Invalid argument D: alsa-util.c: Trying hw:0 without SND_PCM_NO_AUTO_FORMAT ... D: alsa-util.c: Managed to open hw:0 D: alsa-util.c: snd_pcm_hw_params_set_access() failed: Invalid argument D: alsa-util.c: Trying plug:hw:0 with SND_PCM_NO_AUTO_FORMAT ... D: alsa-util.c: Managed to open plug:hw:0 D: alsa-util.c: snd_pcm_hw_params_set_format(Signed 16 bit Little Endian) failed: Invalid argument D: alsa-util.c: snd_pcm_hw_params_set_format(Signed 16 bit Big Endian) failed: Invalid argument D: alsa-util.c: snd_pcm_hw_params_set_format(Float 32 bit Little Endian) failed: Invalid argument D: alsa-util.c: snd_pcm_hw_params_set_format(Float 32 bit Big Endian) failed: Invalid argument D: alsa-util.c: Maximum hw buffer size is 371 ms I: (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed I: (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed I: (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed I: (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed D: alsa-util.c: Set neither period nor buffer size. I: (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed I: alsa-util.c: snd_pcm_hw_params failed: Device or resource busy D: alsa-util.c: Trying plug:hw:0 without SND_PCM_NO_AUTO_FORMAT ... D: alsa-util.c: Managed to open plug:hw:0 D: alsa-util.c: Maximum hw buffer size is 371 ms I: (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed I: (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed I: (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed I: (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed D: alsa-util.c: Set neither period nor buffer size. I: (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed I: alsa-util.c: snd_pcm_hw_params failed: Device or resource busy I: alsa-util.c: Failed to set hardware parameters on plug:hw:0: Device or resource busy
Most likely will need to "define RULES_DEBUG 1 " in /core/pcm_native.c to find out why snd_pcm_hw_params failed after "D: alsa-util.c: Set neither period nor buffer size" ?
In theory , the following should work for all cards unless the sound card has already opened by other application
aplay -v -Dplughw:0 any.wav
aplay -v -M -Dplughw:0 any.wav
BTW , can the application rewind the application pointer to the hardware pointer if the sound card only support SNDRV_PCM_INFO_NONINTERLEAVED and SNDRV_PCM_INFO_DOUBLE ?
2009/11/8 Takashi Iwai tiwai@suse.de
At Sat, 7 Nov 2009 07:12:21 +0800, Raymond Yau wrote:
AFAIK , alsa-lib use the driver name to find the name of corresponding conf file from /usr/share/alsa/cards/aliases.conf In your case , H-DSP.conf does not exist and there is no aliases in /usr/share/alsa/cards/aliases.conf
You have to ask Takashi or Jaroslav to fix this issue for your card
open("/usr/share/alsa/cards/aliases.conf", O_RDONLY) = 3
access("/usr/share/alsa/cards/H-DSP.conf", R_OK) = -1 ENOENT (No such file or directory) open("/dev/snd/controlC1", O_RDONLY) = 3 close(3) = 0
write(2, "ALSA lib confmisc.c:1286:(snd_fu"..., 42ALSA lib confmisc.c:1286:(snd_func_refer) ) = 42 write(2, "Unable to find definition 'cards"..., 58Unable to find definition 'cards.H-DSP.pcm.front.0:CARD=0') = 58 write(2, "\n", 1
Finally I can catch up pending posts...
For hdsp, there is no clear definition for "front" or any surround outputs due to the nature of the hardware. So, getting an error isn't a bug in this case.
PA should fall back into "hw" if all such pre-defined PCMs are not available. So, this is no critical situation for PA. The problem is somewhere else.
Takashi