[alsa-devel] Correct use of ak4114.c?
dustin at seznam.cz
dustin at seznam.cz
Fri Mar 30 12:24:39 CEST 2007
Hello,
while working on support for AK4114 in Audiotrak MI/ODI/O card, I used corresponding code from revo.c (and similarly from juli.c), calling function snd_ak4114_create. However, this function does not initialize array ak4114->kctls[idx], leading to consequent kernel oops after the periodically called snd_ak4114_check_rate_and_errors, specifically in function snd_ctl_notify called by snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4114->kctls[0]->id)
Temporarily I resolved the problem by commenting out the snd_ctl_notify calls. However, it seems author of ak4114.c intended to create the device with snd_ak4114_build instead which defines all the controls. I did not hit the problem until fixing the 4-wire communication in revo.c - that explaing why nobody had this problem with revo cards. I do not understand how the code can work in juli.c - perhaps I have overlooked something there.
My question: Is the correct way to add null pointer checks before snd_ctl_notify calls only, or to use snd_ak4114_build insted of snd_ak4114_create? If using snd_ak4114_build, where do I get the parameters ply_substream and cap_substream?
int snd_ak4114_build(struct ak4114 *ak4114,
struct snd_pcm_substream *playback_substream,
struct snd_pcm_substream *capture_substream);
Thanks for any suggestions.
Pavel.
More information about the Alsa-devel
mailing list