On Friday 21 March 2008 12:53:40 Hannu Savolainen wrote: > Btw, you may also periodically (every 5-10 sec) check state of the > SNDCTL_MIXERINFO->enabled field for all existing mixers. This field will > change to false when an USB (or whatever) mixer is unplugged and back to > true when the device gets replugged. If the mixer is not enabled then > the tab for it could be disabled. > > However this probably makes things far too complicated. The program will > probably call some mixer ioctl before next poll and just exit because > the call returned ENXIO. Another approach is to check availability of a > mixer device if any ioctl call suddenly returns ENXIO.
The other ossxmix polling function only poll the currently shown mixer device - so ossxmix can't wait for ENXIO. It has to use a separate polling function to check whether the other devices are still alive, or more devices were added. There's an interesting condiion where a device is added but another one is removed within the 5 second polling. I don't have the hardware to test, but if I understand correctly: A) Removing a mixer device does not affect the numbering of the remaining devices unless 'ossdevlinks -r' is run. B) The newly added device does not use the same number as the old one. C) SYSINFO->nummixers is incremented anyway after this is done, since the old number remain as a 'ghost'. Yours, Yair K. _______________________________________________ oss-devel mailing list oss-devel@mailman.opensound.com http://mailman.opensound.com/mailman/listinfo/oss-devel