[alsa-devel] [PATCH] alsa-lib: issues in snd_seq_change_bit and some enhancements

Aldrin Martoq amartoq at dcc.uchile.cl
Thu Feb 21 08:08:32 CET 2008


Hello hackers,

I found two issues in sequencer part of alsa-lib while working with the
python binding:
1) snd_seq_change_bit is not working as expected.
2) There is no sane way to clear the event_filter of
snd_seq_client_info_t structure. Because the structure is opaque, we
cannot memset to zero because the user doesn't know the size of the
bitmap.

The first attached patch is a demo of both issues. For 1) please apply
snd_seq_change_bit.txt patch. For 2) I propose to clear the bitmap if
NULL is passed, see snd_seq_client_info_set_event_filter.txt patch.



Also, I think it makes no sense that the bitmap is returned or expected
to be given in both snd_seq_client_info_{set,get}_event_filter; the
client_info structure is opaque and the alsa-lib user can't/shouldn't
known the bitmap size. The only sane way is to use the middle interface
function snd_seq_set_client_event_filter(), but it only can be used for
an opened sequencer's client_info.

So, the last patch is a proposal for changing this:
- mark as deprecated both snd_seq_client_info_{set,get}_event_filter
- snd_seq_client_info_event_filter_clear() clears the event_filter
- snd_seq_client_info_event_filter_add() add an event to the event
filter
- snd_seq_client_info_event_filter_del() removes an event from the event
filter
- snd_seq_client_info_event_filter_check() test if an event is present
in the filtering

Any comments? Thanks!



-- 
Aldrin Martoq <amartoq at dcc.uchile.cl>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: event_filter.txt
Type: text/x-patch
Size: 2927 bytes
Desc: not available
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20080221/845dabc6/attachment-0004.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snd_seq_change_bit.txt
Type: text/x-patch
Size: 374 bytes
Desc: not available
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20080221/845dabc6/attachment-0005.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snd_seq_client_info_set_event_filter.txt
Type: text/x-patch
Size: 543 bytes
Desc: not available
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20080221/845dabc6/attachment-0006.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: proposed.txt
Type: text/x-patch
Size: 11584 bytes
Desc: not available
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20080221/845dabc6/attachment-0007.diff 


More information about the Alsa-devel mailing list