tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

mixer ioctls on sound devices



I've been tracking down a problem with the Linux Citrix ICA client killing sound if the volume in changed in a Windows session. I traced this to it trying to alter mixer settings on /dev/dsp (a.k.a. /dev/sound0) instead of /dev/mixer0. It was getting EINVAL and then shutting down its sound. It therefore appears that Linux semantics are to pass through mixer ioctls if performed on /dev/sound0. We need to support this at some level.
A cheap workaround is:

--- sys/dev/audio.c     30 Jan 2008 12:28:35 -0000      1.1
+++ sys/dev/audio.c     30 Jan 2008 12:29:49 -0000      1.2
@@ -1067,9 +1067,10 @@
        case AUDIO_DEVICE:
        case AUDIOCTL_DEVICE:
                error = audio_ioctl(sc, cmd, addr, flag, l);
-               break;
+               if (error == EINVAL)
+                       /* FALLTHROUGH */
        case MIXER_DEVICE:
-               error = mixer_ioctl(sc, cmd, addr, flag, l);
+                       error = mixer_ioctl(sc, cmd, addr, flag, l);
                break;
        default:
                error = ENXIO;

However, it might be felt that this is not the right place to do this pass through (i.e. should we natively support mixer operations on /dev/sound0?). Perhaps it should be in compat/ossaudio/ossaudio.c or even compat/linux/common/linux_ioctl.c. Or perhaps audio_ioctl should return EPASSTHROUGH in such a situation.

Opinions?

--
Stephen




Home | Main Index | Thread Index | Old Index