[alsa-devel] Alsa 1.0.15rc2 and oops with Dell M1210
![](https://secure.gravatar.com/avatar/a33b7a5942a33afbdd10108df1be7385.jpg?s=120&d=mm&r=g)
Seems that the spec->input_mux contains no item at all. So system maybe crash in the snd_hda_input_mux_info() when try to copy the items[].label,which is null pointer.
May you replace the function stac92xx_mux_enum_info() in alsa-driver-1.0.15rc2/alsa-kernel/pci/hda/patch_sigmatel.c ?
static int stac92xx_mux_enum_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct sigmatel_spec *spec = codec->spec; printk("spec->input_mux->num_items is %d \n",spec->input_mux->num_items); if(!spec->input_mux->num_items) return 0; return snd_hda_input_mux_info(spec->input_mux, uinfo); }
Does it still crash? What's the number of num_items?
The pin_config for M1210 didn't include any input pin. I wonder why.
![](https://secure.gravatar.com/avatar/10fbe5c96127bb205bc90372576a4461.jpg?s=120&d=mm&r=g)
On Saturday 29 September 2007 06:07:17 zhejiang wrote:
Seems that the spec->input_mux contains no item at all. So system maybe crash in the snd_hda_input_mux_info() when try to copy the items[].label,which is null pointer.
May you replace the function stac92xx_mux_enum_info() in alsa-driver-1.0.15rc2/alsa-kernel/pci/hda/patch_sigmatel.c ?
static int stac92xx_mux_enum_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct sigmatel_spec *spec = codec->spec; printk("spec->input_mux->num_items is %d \n",spec->input_mux->num_items); if(!spec->input_mux->num_items) return 0; return snd_hda_input_mux_info(spec->input_mux, uinfo); }
Does it still crash? What's the number of num_items?
Thanks, I will try to enter in contact with the reporter and see what's going on (I don't have direct access to the hardware) and try this. And later I saw too I was wrong as the problem isn't input_mux as it's set to private_imux.
The pin_config for M1210 didn't include any input pin. I wonder why.
Probably it's the reason for the bug, as 5stack model doesn't give problems on the same hardware.
-- []'s Herton
![](https://secure.gravatar.com/avatar/10fbe5c96127bb205bc90372576a4461.jpg?s=120&d=mm&r=g)
Em Saturday 29 September 2007 18:53:29 Herton Ronaldo Krzesinski escreveu:
On Saturday 29 September 2007 06:07:17 zhejiang wrote:
Seems that the spec->input_mux contains no item at all. So system maybe crash in the snd_hda_input_mux_info() when try to copy the items[].label,which is null pointer.
May you replace the function stac92xx_mux_enum_info() in alsa-driver-1.0.15rc2/alsa-kernel/pci/hda/patch_sigmatel.c ?
static int stac92xx_mux_enum_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct sigmatel_spec *spec = codec->spec; printk("spec->input_mux->num_items is %d \n",spec->input_mux->num_items); if(!spec->input_mux->num_items) return 0; return snd_hda_input_mux_info(spec->input_mux, uinfo); }
Does it still crash? What's the number of num_items?
I received feedback from the reporter: spec->input_mux->num_items is 0
Also sound works fine, no more crashes.
-- []'s Herton
![](https://secure.gravatar.com/avatar/5b19e9d0e834ea10ef75803718ad564b.jpg?s=120&d=mm&r=g)
At Wed, 3 Oct 2007 16:58:35 -0300, Herton Ronaldo Krzesinski wrote:
Em Saturday 29 September 2007 18:53:29 Herton Ronaldo Krzesinski escreveu:
On Saturday 29 September 2007 06:07:17 zhejiang wrote:
Seems that the spec->input_mux contains no item at all. So system maybe crash in the snd_hda_input_mux_info() when try to copy the items[].label,which is null pointer.
May you replace the function stac92xx_mux_enum_info() in alsa-driver-1.0.15rc2/alsa-kernel/pci/hda/patch_sigmatel.c ?
static int stac92xx_mux_enum_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct sigmatel_spec *spec = codec->spec; printk("spec->input_mux->num_items is %d \n",spec->input_mux->num_items); if(!spec->input_mux->num_items) return 0; return snd_hda_input_mux_info(spec->input_mux, uinfo); }
Does it still crash? What's the number of num_items?
I received feedback from the reporter: spec->input_mux->num_items is 0
Also sound works fine, no more crashes.
OK, then could you check whether the patch below fixes the problem? Such a check should be done in the common routine.
Thanks,
Takashi
diff -r a4cf3aa3dc5b pci/hda/hda_codec.c --- a/pci/hda/hda_codec.c Tue Oct 09 10:34:06 2007 +0200 +++ b/pci/hda/hda_codec.c Tue Oct 09 11:53:39 2007 +0200 @@ -2341,6 +2341,8 @@ int snd_hda_input_mux_info(const struct uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; uinfo->count = 1; uinfo->value.enumerated.items = imux->num_items; + if (!imux->num_items) + return 0; index = uinfo->value.enumerated.item; if (index >= imux->num_items) index = imux->num_items - 1; @@ -2356,6 +2358,8 @@ int snd_hda_input_mux_put(struct hda_cod { unsigned int idx;
+ if (!imux->num_items) + return 0; idx = ucontrol->value.enumerated.item[0]; if (idx >= imux->num_items) idx = imux->num_items - 1;
![](https://secure.gravatar.com/avatar/10fbe5c96127bb205bc90372576a4461.jpg?s=120&d=mm&r=g)
Em Tuesday 09 October 2007 06:55:32 Takashi Iwai escreveu:
At Wed, 3 Oct 2007 16:58:35 -0300,
Herton Ronaldo Krzesinski wrote:
Em Saturday 29 September 2007 18:53:29 Herton Ronaldo Krzesinski escreveu:
On Saturday 29 September 2007 06:07:17 zhejiang wrote:
Seems that the spec->input_mux contains no item at all. So system maybe crash in the snd_hda_input_mux_info() when try to copy the items[].label,which is null pointer.
May you replace the function stac92xx_mux_enum_info() in alsa-driver-1.0.15rc2/alsa-kernel/pci/hda/patch_sigmatel.c ?
static int stac92xx_mux_enum_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct sigmatel_spec *spec = codec->spec; printk("spec->input_mux->num_items is %d \n",spec->input_mux->num_items); if(!spec->input_mux->num_items) return 0; return snd_hda_input_mux_info(spec->input_mux, uinfo); }
Does it still crash? What's the number of num_items?
I received feedback from the reporter: spec->input_mux->num_items is 0
Also sound works fine, no more crashes.
OK, then could you check whether the patch below fixes the problem? Such a check should be done in the common routine.
Yes, the patch was reported to me as working fine, thanks.
Thanks,
Takashi
diff -r a4cf3aa3dc5b pci/hda/hda_codec.c --- a/pci/hda/hda_codec.c Tue Oct 09 10:34:06 2007 +0200 +++ b/pci/hda/hda_codec.c Tue Oct 09 11:53:39 2007 +0200 @@ -2341,6 +2341,8 @@ int snd_hda_input_mux_info(const struct uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; uinfo->count = 1; uinfo->value.enumerated.items = imux->num_items;
- if (!imux->num_items)
index = uinfo->value.enumerated.item; if (index >= imux->num_items) index = imux->num_items - 1;return 0;
@@ -2356,6 +2358,8 @@ int snd_hda_input_mux_put(struct hda_cod { unsigned int idx;
- if (!imux->num_items)
idx = ucontrol->value.enumerated.item[0]; if (idx >= imux->num_items) idx = imux->num_items - 1;return 0;
-- []'s Herton
participants (3)
-
Herton Ronaldo Krzesinski
-
Takashi Iwai
-
zhejiang