[alsa-devel] Listing up to 8 PCM devices

Gregoire ETIENNE gregoire.etienne at parrot.com
Wed Nov 19 09:19:21 CET 2008


Hi,

I'm currently writting a driver with up to 8 pcm devices, so I turned on
"Dynamic device file minor numbers" option. But when I try to list devices
through aplay or a record (which are calling ioctl with cmd
SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE) I can only list devices from 0 to 7. This is
due to this code :

linux/sound/core/pcm.c l.64
------------------------------
	case SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE:
		{
			int device;

			if (get_user(device, (int __user *)arg))
				return -EFAULT;
			mutex_lock(&register_mutex);
			device = device < 0 ? 0 : device + 1;
			while (device < SNDRV_PCM_DEVICES) {
				if (snd_pcm_search(card, device))
					break;
				device++;
			}
			if (device == SNDRV_PCM_DEVICES)
				device = -1;
			mutex_unlock(&register_mutex);
			if (put_user(device, (int __user *)arg))
				return -EFAULT;
			return 0;
		}
------------------------------
because SNDRV_PCM_DEVICES is defined to 8 and do not change even if I selected
"Dynamic device file minor numbers" option.

Is there anything I missed ?



More information about the Alsa-devel mailing list