|
From: Helge H. <hel...@ai...> - 2005-06-07 10:02:21
|
Aivils wrote: >On Friday 03 June 2005 12:03, 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? >>>> >>>>The first sound card is /dev/dsp and the second is /dev/dsp1. I want >>>>display :0 to use /dev/dsp and display :1 to use /dev/dsp1. >>>> >>>>I've tried the instructions available at >>>>http://howtos.linux.com/howtos/XFree-Local-multi-user-HOWTO/automation_multy_snd-cards.shtml >>>>but I haven't been able to get them to work with gdm/Gnome. >>>> >>>> >>>> >>>> >>>Under Linux access to sound subsystem is little chaotic. >>>Any application use hers own sound driver. >>> >>>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. >> >>I use a different approach at home. The machine happens to have >>two soundcards, but I use only one of them currently. It has a trident >>chip, and that one support multiple users at the same time so no >>problems there. The two displays are side by side with the speakers >>on each side of both of them, so both get correct stereo sound from the >>same speaker set. >> >> > >Masterpiece must be an intelligent script for each /dev/input/eventXX >/dev/input/mouseXX /dev/sound/dspXX , where devices allways are links to >/chroot/XX/dev/input/mouse0 and so on. In case of input devices, >device files changed on unplug/plug in. > > There should be no problems with input devices. Each xserver can trivially have a different config file, specifying the correct mouse. It is only the sound devices that need to be different, and only because it is "too hard" getting every sound-using program to use the correct device. If someone actually have a setup where the contents of /dev/input/ _change_ over time, well, just make bind-mount /dev/input over /chroot/dev/input in order to see the same input devices everywhere. Sound devices aren't in /dev/input and can still be different. Helge Hafting |