[alsa-devel] code improvements in /sound/usb/mixer.c

Daniel Schürmann daschuer at mixxx.org
Thu Apr 25 08:23:28 CEST 2013


Hi Takashi, Hi alsa-devel.

in my last mail I had supposed scaling issues with mixer.c, but finally it
turns out that was just a debugging problem of myself.
I was struggled how types are handled in the code. I have some ideas for
improvement but I am not sure if it its worth the work since nothing is
broken.

1. get rid of convert_bytes_value(cval, value_set):
This function return any type in a integer container, which is confusing.

2. use type casts in convert_signed_value():
gcc knows perfecly how to convert types.

3. merge convert_signed_value() and snd_usb_combine_bytes() to get rid of
the intermediate integer variant.

---

I am currently working on a patch that introduces a get_ctl_value_range_v2.
I want to get rid of the three single queries for min max and rate.
Also here, nothing broken. Is it worth to do the work?


Kind regards

Daniel


More information about the Alsa-devel mailing list