ctl api questions
Hi,
As you may know the hdsp has a variable number of channels depending on the sample rate. The card's internal routing is controlled by a matrix mixer. For convenience simple mixer ctls are defined at card initialization. When the number of channels change, I flag the .access field of the unused ctls with SNDRV_CTL_ELEM_READ and SNDRV_CTL_ELEM_INACTIVE. It seems to work fine with amixer (amixer controls doesn't show anymore the unused channels), but alsamixer gives the following error: function snd_mixer_load failed: Invalid argument. Any idea on what is going wrong ?
Another point: the matrix mixer is now (with patch II from Paul) read/write. In write mode it takes 3 parameters:
source,destination,gain. With the amixer patch I submitted some days ago it is possible to actually read it, passing source and destination channels as parameters to the cget option. In the driver, the return values use the same structure as the parameters. Should I respect the parameters index (returning the gain value in value[2]) or should I consider that return values start at value[0] ?
Thomas
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
At 11 Mar 2003 10:04:18 +0100,
Quoted 13 lines · Thomas Charbonnel
Hi,
As you may know the hdsp has a variable number of channels depending on the sample rate. The card's internal routing is controlled by a matrix mixer. For convenience simple mixer ctls are defined at card initialization. When the number of channels change, I flag the .access field of the unused ctls with
SNDRV_CTL_ELEM_READandSNDRV_CTL_ELEM_INACTIVE. It seems to work fine with amixer (amixer controls doesn't show anymore the unused channels), but alsamixer gives the following error: functionsnd_mixer_loadfailed: Invalid argument. Any idea on what is going wrong ?
Quoted 8 lines
Another point: the matrix mixer is now (with patch II from Paul) read/write. In write mode it takes 3 parameters:
source,destination,gain. With the amixer patch I submitted some days ago it is possible to actually read it, passing source and destination channels as parameters to the cget option. In the driver, the return values use the same structure as the parameters. Should I respect the parameters index (returning the gain value in value[2]) or should I consider that return values start at value[0] ?
IIRC, the indirect access is still not implemented as a standard way of control API.
i myself like it better than the linear addressing of thousands of mixer elements for the matrix mixer. but it's not the standard way, yet, and we need again a discussion to convince other people to allow that...
hence i'd like to propose to postpone this after 0.9.0-final release.
Takashi
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Quoted 11 lines · Thomas Charbonnel
Hi,
As you may know the hdsp has a variable number of channels depending on the sample rate. The card's internal routing is controlled by a matrix mixer. For convenience simple mixer ctls are defined at card initialization. When the number of channels change, I flag the .access field of the unused ctls with
SNDRV_CTL_ELEM_READandSNDRV_CTL_ELEM_INACTIVE. It seems to work fine with amixer (amixer controls doesn't show anymore the unused channels), but alsamixer gives the following error: functionsnd_mixer_loadfailed: Invalid argument. Any idea on what is going wrong ?
I don't know. Could you try to test this behaviour with the dummy driver (add the same controls as present in HDSP). We can debug then the user space problems.
Quoted 8 lines
Another point: the matrix mixer is now (with patch II from Paul) read/write. In write mode it takes 3 parameters:
source,destination,gain. With the amixer patch I submitted some days ago it is possible to actually read it, passing source and destination channels as parameters to the cget option. In the driver, the return values use the same structure as the parameters. Should I respect the parameters index (returning the gain value in value[2]) or should I consider that return values start at value[0] ?
Note that this behaviour is non-standard. You simply moved the addressing outside the sndrv_ctl_elem_id structure which is quite bad in the sense of common API. I think that it would be nice to invent some group controls represented inside the kernel space only with one structure rather than doing things which doesn't follow the API design.
For example, alsactl doesn't know about your addresing thus is impossible to save and restore the settings of this card via this universal utility.
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Quoted 9 lines
Quoted 8 lines
Another point: the matrix mixer is now (with patch II from Paul) read/write. In write mode it takes 3 parameters:
source,destination,gain. With the amixer patch I submitted some days ago it is possible to actually read it, passing source and destination channels as parameters to the cget option. In the driver, the return values use the same structure as the parameters. Should I respect the parameters index (returning the gain value in value[2]) or should I consider that return values start at value[0] ?
Quoted 5 lines
Note that this behaviour is non-standard. You simply moved the addressing outside the
sndrv_ctl_elem_idstructure which is quite bad in the sense of common API. I think that it would be nice to invent some group controls represented inside the kernel space only with one structure rather than doing things which doesn't follow the API design.
it would be nice, but the last time we discussed this, no viable solutions emerged, which is why the code still works this way.
ALSA is missing "standard" ways of doing a variety of things, and we can't not make this functionality available because its in a queue of other things that need "standardization".
Quoted 2 lines
For example, alsactl doesn't know about your addresing thus is impossible to save and restore the settings of this card via this universal utility.
but amixer+script can. in fact, amixer+script is actually more flexible than alsactl, and i have to admit that i find it a bit troubling that both these tools exist. is there something that amixer cannot do that alsactl can?
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en