|
From: Helge H. <hel...@ai...> - 2005-06-07 10:00:44
|
Ken McCord wrote: > On Fri, 2005-06-03 at 11:03 +0200, Helge Hafting wrote: > >>Aivils wrote: >> >>>On Thursday 02 June 2005 04:27, Ken McCord wrote: >>> >>> >>>>I'm running a dual-head setup using Debian unstable + the x.org packages >>>>from Ubuntu. I have two sound cards, and I'd like to assign each of >>>>them >>>>to a specific X display. How can I do this? >>>> >> >> ><snip> > > >>> >>>Try out set up artsd under KDE or esd under GNOME . >>> >>>Even if these software sound mixers like artsd or esd runs >>>properly, then You cannot disable Java and Flash Player, >>>which uses sound device directly. >>>I open Java binary with hexedit and manulay replace >>>/dev/dsp with fake non-existing device file for silence. >>> >>> >>There is a way. >>One xserver can run in its own chroot. The two servers can have >>distinct /dev directories that way, where the two "dsp" files in the >>distinct directories have different device numbers and so >>refer to different sound devices. >>Make a copy of /dev in /chroot/dev. In there, make sure >>"dsp" refers to the second soundcard instead of the first. >> >>On a debian system "dsp" is a symlink to "dsp0". Change it to >>a link to "dsp1" instead. On other systems you may have to >>do something like "mv dsp1 dsp0". >> >>Whatever the solution is, do the same for all other sound-related >>files, such as "mixer" and so on. >> >> >>Now the chroot has a customized /dev. But what about all the >>other directories needed for normal operation, such as >>/bin, /usr, /var, /home and so on? >> >>The answer is to bind-mount them. Bind-mount every top-level >>directory except /dev into the chroot, and you should be fine. >>Then chroot into the /chroot directory, and start the second xserver. >>(Details: man mount, search for "bind") >> >>Having all those bind-mounts means you don't have to duplicate >>a single file (except for the contents of /dev). Both xservers will >>access the same files, so they should work and the users shouldn't >>be able to notice the difference. Except that they get distinct soundcards. >> >> >> ><snip> > > >>Helge Hafting >> >> > > I've played around with artsd and esd a bit more, and have been able > to get /dev/dsp and /dev/dsp1 working, > but there are problems. Using esd, you can't use Gnome's 'Enable > Sound Server Startup' in the 'Sound Preferences' dialog box as it > starts another copy of esd. I haven't been able to find where to set > any options for this server (ie use the options I want to start the > server). Logging off and on again is problematic, and I've also seen > times where my setting for ESPEAKER gets modified. > > The idea of running the chroot is interesting. But would I need to > chroot the xserver only, or parts of Gnome as well? You need to run anything that might use sound in the chroot. Thinking some more about it, the xserver itself is perhaps the one thing that won't need the chroot. (And neither will other server software, such as webserver, printer software and so on.) What you need to run in the chroot, is the stuff that controls the session and launch all other programs. That is, the window manager or whatever you use for starting your programs. If you're using xdm/gdm/ or kdm, run the instance that controls the "other" display in the chroot. Everything it starts up will then run in the chroot too, so it'll work no matter _who_ logs in. Note that chrooting "everything" isn't hard when you use bind mounts that gives you alle the same directories inside the chroot as outside, with the one exception for /dev. Everything should work the same way inside the chroot as outside. This chroot is not made for isolating software (as usually is the purpose of chroot) but to present the apps with a different /dev. Helge Hafting |