[PATCH] add soundcard device and fix device_file handling
David Zeuthen
david at fubar.dk
Thu Mar 22 15:44:17 PDT 2007
On Wed, 2007-03-21 at 09:25 +0100, Danny Kukawka wrote:
> > Yeah, it's always good to check things since otherwise things might stop
> > working when/if we change the event dispatcher..
>
> As I already wrote: a check for != NULL is useless at the moment since this
> is a char array and can't be NULL. If this change you have to rewrite and check
> all code which is effected by the change. It make no sense to add code to
> prevent problems is may sometime get changed.
Of course it does; in fact that's the spirit of defensive programming;
add checks in every function and don't trust the caller even if for
internal API. I'm not really good at enforcing that but if you e.g. look
at D-Bus or glib code it's used extensively (and these checks can be
turned off too).
> As first we don't need to duplicate all the data for each ALSA or OSS device which is
> connected to this soundcard. If you want to know what the name or the card number of
> the ALSA/OSS device is you need only to check the parent device which is now the real
> soundcard. And you can add more info to a soundcard in the future and you don't want
> to add these (maybe usefull) info to each ALSA/OSS device again and again. At least
> it would massive reduce the sound device related code in HAL.
>
> Maybe it would break PulseAudio or any other Audio application that use HAL, but
> this is only something we should handle as we do with each other change: provide the
> old keys 12 months and document the change.
>
> IMO we should not call the the soundcard alsa_soundcard since this is not really
> alsa specific. You can IMO add also other sound card devices here if you want
> (is there any other sound system under Linux? Would the Solaris or FreeBSD system
> be that different that this would not fit?).
>
> Btw. This is nothing for 0.5.9.
[...]
> This was not my plan for 0.5.9, I would only start to discuss this. Btw. the change
> from alsa.* to sound.alsa.* would make also sense without !CONFIG_SYSFS_DEPRECATED
> because this don't need to depend on the sound card device. This devices are really
> similar devices and should be in the same namespace.
OK, can you submit the patch again when 0.5.9 is out? I really want to
get that out but I kept getting side tracked :-)
David
More information about the hal
mailing list