From: Takashi Iwai Subject: Re: Alsa-OSS so-called 'Duplex-bug' Date: Tue, 20 Jun 2006 11:56:48 +0200 Message-ID: References: <200606191515.28395.alan@horstmann.fsworld.co.uk> <200606192210.12889.gineera@aspect135.co.uk> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <200606192210.12889.gineera@aspect135.co.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: Alan Horstmann Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Mon, 19 Jun 2006 22:12:57 +0100, Alan Horstmann wrote: > > > > I have devised an > > > alternative using the existing SNDCTL_DSP_CHANNELS, by passing 'channels' > > > calculated as (playback_channels + 256 * capture_channels) so that in > > > effect the first 8 bits are playback, the 2nd 8 bits are capture. The > > > result is compatible with the existing, as numbers < 255 are treated in > > > the existing way, setting playback and capture the same if the > > > sub-streams are active. Thus it has simply added an enhanced mode. > > > > > > Diff is attached; I wonder what your thoughts are on this?? I have been > > > able to very simply patch portaudio to use this facility and the system > > > now works great. > > > > I don't think it's a right solution. This simply introduces an > > incompatibility with the existing OSS ioctl... > > The 'enhanced' alsa-emulation I created is backwards compatible; it enables > aware apps to work-around the limitation of the emulation. But if sent > commands as-if standard, does exactly what it would have done. However, > where the app needs to set separate record and playback channels for a duplex > mode, there is extra capability. It would be used only for duplex when > (capture_channels != playback_channels) This would not be necessary with > original OSS, although also it would not work. None-the-less I can > understand your reluctance, it is just that a solution seems necessary. > > Another alternative would be for ALSA to create at least two devices, one for > all playback channels, the other for all capture, eg /dsp0 and /adsp0 or > something else. It would then be more like the raws OSS in its behaviour. > That would also solve the problems here. Obviously a full implementation as > per attached description would also be fine! It's easy over aoss. Having the following pcm.dsp0 { type asym playback.pcm "plughw" } pcm.dsp1 { type asym capture.pcm "plughw" } would give you /dev/dsp0 for playback and /dev/dsp1 for capture. You can replace "plughw" whatever you like, of course. Takashi