Skip to contentSkip to conversation

Control attribute

DISCUSSION Giuliano Pochini 2 participants 2 messages Nov 13, 2004 – Nov 14, 2004

lore
Share & tools
lore
#0 lore raw

Some ctl interface elements may change without an explicit request of the application. I know there is the SNDRV_CTL_ELEM_ACCESS_VOLATILE attribute, but it matching the behaviour of some control very well. My driver has two controls that are somewhat related: Sample clock source switch and Digital mode switch. They never change if nobody touches them, but if an app changes the digital mode also the clock source may change. For example if dmode is ADAT and clock source is ADAT and the user sets dmode=S/PDIF, the driver must switch the clock source to something compatible with the new dmode. Is SNDRV_CTL_ELEM_ACCESS_VOLATILE the right flag ? I don't think so, but there are no other suitable flags AFAIK.

--
Giuliano.

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#1 lore raw
Quoted 10 lines · Giuliano Pochini

Some ctl interface elements may change without an explicit request of the application. I know there is the SNDRV_CTL_ELEM_ACCESS_VOLATILE attribute, but it matching the behaviour of some control very well. My driver has two controls that are somewhat related: Sample clock source switch and Digital mode switch. They never change if nobody touches them, but if an app changes the digital mode also the clock source may change. For example if dmode is ADAT and clock source is ADAT and the user sets dmode=S/PDIF, the driver must switch the clock source to something compatible with the new dmode. Is SNDRV_CTL_ELEM_ACCESS_VOLATILE the right flag ? I don't think so, but there are no other suitable flags AFAIK.

If controls are somewhat related, they must take care about sending an event using snd_ctl_notify() function for related changed controls.

I don't think that these related controls needs a volatile flag which is defined mainly for changes invoked by hardware.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8