From: John Feeney <jfeeney@redhat.com> Subject: [RHEL5.1 PATCH] regression: Audio playback does not work Date: Mon, 13 Aug 2007 19:30:38 -0400 Bugzilla: 250269 Message-Id: <46C0E99E.703@redhat.com> Changelog: [sound] Audio playback does not work bz250269 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=250269 PPORT: RHEL51: Audio playback does not work on Converse Description of problem: This is a regression due to the upgrade of the ALSA drivers to 1.0.14. When the ALSA snd_hda_intel driver attempted to read the codecs, it would fail to do so and report "azx_get_response timeout". Along with the timeout messages, "no codecs initialized" would be reported. The driver would load but it would not provide devices. When aplay is invoked, a "cannot find card" error would be reported and there would be no sound. Solution: The solution is to replace the hard-coded values for the number of pins in the codec so the number is calculated. When the erroneous value (14 for stac9205) is replaced so it is calculated (12), extraneous write operations are not attempted so there is no timing out. No timing out means the azx_codec_create() returns successfully. Note: the 1.0.14 patch did not add the hard-coded values, it added the code to use the hard-coded values to establish the number of times to read the codecs. Upstream status: The upstream patch can be found: Linus' tree commit: a4eed138add1018846d17e813560b0c7c0ae8e01 ALSA] hda-codec - Fix number of pin widgets with STAC codecs Use ARRAY_SIZE() to calculate the number of pin widgets for each codec chip. This also fixes a typo in STAC9205 code that gives a wrong number (14 instead of 12), which resulted in fatal communication errors. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz> Testing: I applied the patch to the RHEL-5 source, built rpms with brew, and tested the fix successfully. I sending the RPMs to Dell for testing. Still awaiting results. Will update when the results are known. Acks would be appreciated. Thanks. --- linux-2.6.18.noarch/sound/pci/hda/patch_sigmatel.c.orig +++ linux-2.6.18.noarch/sound/pci/hda/patch_sigmatel.c @@ -1783,7 +1783,7 @@ static int patch_stac9200(struct hda_cod return -ENOMEM; codec->spec = spec; - spec->num_pins = 8; + spec->num_pins = ARRAY_SIZE(stac9200_pin_nids); spec->pin_nids = stac9200_pin_nids; spec->board_config = snd_hda_check_board_config(codec, STAC_9200_MODELS, stac9200_models, @@ -1833,7 +1833,7 @@ static int patch_stac925x(struct hda_cod return -ENOMEM; codec->spec = spec; - spec->num_pins = 8; + spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); spec->pin_nids = stac925x_pin_nids; spec->board_config = snd_hda_check_board_config(codec, STAC_925x_MODELS, stac925x_models, @@ -1893,7 +1893,7 @@ static int patch_stac922x(struct hda_cod return -ENOMEM; codec->spec = spec; - spec->num_pins = 10; + spec->num_pins = ARRAY_SIZE(stac922x_pin_nids); spec->pin_nids = stac922x_pin_nids; spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS, stac922x_models, @@ -1969,7 +1969,7 @@ static int patch_stac927x(struct hda_cod return -ENOMEM; codec->spec = spec; - spec->num_pins = 14; + spec->num_pins = ARRAY_SIZE(stac927x_pin_nids); spec->pin_nids = stac927x_pin_nids; spec->board_config = snd_hda_check_board_config(codec, STAC_927X_MODELS, stac927x_models, @@ -2046,7 +2046,7 @@ static int patch_stac9205(struct hda_cod return -ENOMEM; codec->spec = spec; - spec->num_pins = 14; + spec->num_pins = ARRAY_SIZE(stac9205_pin_nids); spec->pin_nids = stac9205_pin_nids; spec->board_config = snd_hda_check_board_config(codec, STAC_9205_MODELS, stac9205_models,