From: Takashi Iwai Subject: Re: Volume per voices [Feature Request] Date: Fri, 29 Jul 2005 13:23:09 +0200 Message-ID: References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Giuliano Pochini Cc: Clemens Ladisch , Jaroslav Kysela , Dino Puller , alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Thu, 28 Jul 2005 19:51:16 +0200 (CEST), Giuliano Pochini wrote: > > > > In my driver we have A analog channels and D digital channels. The > > > driver registers a "PCM Playback Volume" control as an array of > > > A+D integers, where each element is the gain (-128..+6) of each > > > channel, but they don't map directly to the PCM channels because > > > the driver exports analog and digital channels as two separate > > > devices (this feature can be removed easily). So pcmvol[0..A-1] > > > controls the volume of hw:0,0 and pcmvol[A..A+D-1] controls the > > > volume of hw:0,1. Furthermore, the user can open hw:0,0,x to > > > address the xth channel. > > > > As far as I can see, no driver actually uses the subdevice (substream) > > field for PCM substreams; probably because this would require a > > separate control for each substream instead of using an array. > > My case is even more compicated because one ctl controls the volume of two > devices. A callback that gets snd_pcm_substream_t* and returns {int numid, > firstindex, lastindex} or sort of would make things much simpler wrt hw > controls. In case there are both hw volume and softvol, which has > priority ? :) Returning a list of controls would be simplest as the lowlevel API. The higher level API decides which control to use, for example, while h/w specific apps can use the lowlevel API to get certain controls directly. Takashi ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf