diff --git a/libsndio/sioctl.c b/libsndio/sioctl.c index 8bff8de..b624288 100644 --- a/libsndio/sioctl.c +++ b/libsndio/sioctl.c @@ -45,9 +45,9 @@ sioctl_open(const char *str, unsigned int mode, int nbio) if (hdl != NULL) return hdl; #if defined(USE_SUN_MIXER) - return _sioctl_sun_open("rsnd/0", mode, nbio); + return _sioctl_sun_open("rsnd/default", mode, nbio); #elif defined(USE_ALSA_MIXER) - return _sioctl_alsa_open("rsnd/0", mode, nbio); + return _sioctl_alsa_open("rsnd/default", mode, nbio); #else return NULL; #endif diff --git a/libsndio/sioctl_sun.c b/libsndio/sioctl_sun.c index f7ec7ce..bd1fc7f 100644 --- a/libsndio/sioctl_sun.c +++ b/libsndio/sioctl_sun.c @@ -294,10 +294,14 @@ sioctl_sun_getfd(const char *str, unsigned int mode, int nbio) DPRINTF("sioctl_sun_getfd: %s: '/' expected\n", str); return -1; } - p = _sndio_parsenum(p, &devnum, 255); - if (p == NULL || *p != '\0') { - DPRINTF("sioctl_sun_getfd: %s: number expected after '/'\n", str); - return -1; + if (strcmp(p, "default") == 0) { + devnum = 0; + } else { + p = _sndio_parsenum(p, &devnum, 255); + if (p == NULL || *p != '\0') { + DPRINTF("sioctl_sun_getfd: %s: number expected after '/'\n", str); + return -1; + } } snprintf(path, sizeof(path), DEVPATH_PREFIX "%u", devnum); if (mode == (SIOCTL_READ | SIOCTL_WRITE))