On Mon, Oct 25, 2004 at 06:15:38PM +0200, Pander wrote:
> The sound on my PowerBook G4 was working quit oke until I upgraded to 
> from 2.6.8.1 to 2.6.9. Think there is something wrong with the loading 
> of the modules.
What exactly is the problem. Can you try:

diff -ubw --exclude='*.orig' --exclude='*.o' --exclude='*.ko' --exclude='*.cmd' 
--exclude='*.o' --exclude=CVS/ --exclude=.svn -Naur 
linux-2.6.9-rc2.orig/sound/ppc/pmac.c linux-2.6.9-rc2/sound/ppc/pmac.c
--- linux-2.6.9-rc2.orig/sound/ppc/pmac.c       2004-09-15 09:24:29.000000000 
+0200
+++ linux-2.6.9-rc2/sound/ppc/pmac.c    2004-09-21 16:58:38.966902040 +0200
@@ -50,8 +50,8 @@
        44100, 29400, 22050, 17640, 14700, 11025, 8820, 7350
 };
 /* fixed frequency table for tumbler */
-static int tumbler_freqs[1] = {
-       44100
+static int tumbler_freqs[2] = {
+       48000, 44100
 };
 
 /*
@@ -488,12 +488,14 @@
        snd_pcm_runtime_t *runtime = subs->runtime;
        int i, j, fflags;
        static int typical_freqs[] = {
+               48000,
                44100,
                22050,
                11025,
                0,
        };
        static int typical_freq_flags[] = {
+               SNDRV_PCM_RATE_48000,
                SNDRV_PCM_RATE_44100,
                SNDRV_PCM_RATE_22050,
                SNDRV_PCM_RATE_11025,
@@ -647,7 +649,7 @@
 
        pcm->private_data = chip;
        pcm->private_free = pmac_pcm_free;
-       pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX;
+       pcm->info_flags = 0;
        strcpy(pcm->name, chip->card->shortname);
        chip->pcm = pcm;
 
diff -ubw --exclude='*.orig' --exclude='*.o' --exclude='*.ko' --exclude='*.cmd' 
--exclude='*.o' --exclude=CVS/ --exclude=.svn -Naur 
linux-2.6.9-rc2.orig/sound/ppc/tumbler.c linux-2.6.9-rc2/sound/ppc/tumbler.c
--- linux-2.6.9-rc2.orig/sound/ppc/tumbler.c    2004-09-15 09:24:29.000000000 
+0200
+++ linux-2.6.9-rc2/sound/ppc/tumbler.c 2004-09-21 16:58:38.970901432 +0200
@@ -762,6 +762,12 @@
        DEFINE_MONO("Tone Control - Treble", treble),
        DEFINE_MONO("PCM Playback Volume", pcm),
        { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+         .name = "DRC Switch",
+         .info = snd_pmac_boolean_mono_info,
+         .get = tumbler_get_drc_switch,
+         .put = tumbler_put_drc_switch
+       },
+       { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
          .name = "DRC Range",
          .info = tumbler_info_drc_value,
          .get = tumbler_get_drc_value,
@@ -788,6 +794,12 @@
        DEFINE_SNAPPER_MONO("Tone Control - Bass", bass),
        DEFINE_SNAPPER_MONO("Tone Control - Treble", treble),
        { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+         .name = "DRC Switch",
+         .info = snd_pmac_boolean_mono_info,
+         .get = tumbler_get_drc_switch,
+         .put = tumbler_put_drc_switch
+       },
+       { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
          .name = "DRC Range",
          .info = tumbler_info_drc_value,
          .get = tumbler_get_drc_value,
@@ -817,14 +829,6 @@
        .put = tumbler_put_mute_switch,
        .private_value = TUMBLER_MUTE_AMP,
 };
-static snd_kcontrol_new_t tumbler_drc_sw __initdata = {
-       .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
-       .name = "DRC Switch",
-       .info = snd_pmac_boolean_mono_info,
-       .get = tumbler_get_drc_switch,
-       .put = tumbler_put_drc_switch
-};
-
 
 #ifdef PMAC_SUPPORT_AUTOMUTE
 /*
@@ -846,29 +850,6 @@
        }
 }
 
-static struct work_struct device_change;
-
-static void
-device_change_handler(void *self)
-{
-       pmac_t *chip = (pmac_t*) self;
-       pmac_tumbler_t *mix;
-
-       if (!chip)
-               return;
-
-       mix = chip->mixer_data;
-
-       /* first set the DRC so the speaker do not explode -ReneR */
-       if (chip->model == PMAC_TUMBLER)
-               tumbler_set_drc(mix);
-       else
-               snapper_set_drc(mix);
-
-       /* reset the master volume so the correct amplification is applied */
-       tumbler_set_master_volume(mix);
-}
-
 static void tumbler_update_automute(pmac_t *chip, int do_notify)
 {
        if (chip->auto_mute) {
@@ -878,25 +859,14 @@
                        /* mute speaker */
                        check_mute(chip, &mix->amp_mute, 1, do_notify, 
chip->speaker_sw_ctl);
                        check_mute(chip, &mix->hp_mute, 0, do_notify, 
chip->master_sw_ctl);
-                       mix->drc_enable = 0;
-
                } else {
                        /* unmute speaker */
                        check_mute(chip, &mix->amp_mute, 0, do_notify, 
chip->speaker_sw_ctl);
                        check_mute(chip, &mix->hp_mute, 1, do_notify, 
chip->master_sw_ctl);
-                       mix->drc_enable = 1;
                }
-               if (do_notify) {
+               if (do_notify)
                        snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
                                       &chip->hp_detect_ctl->id);
-                       snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
-                                      &chip->drc_sw_ctl->id);
-               }
-
-               /* finally we need to schedule an update of the mixer values
-                  (master and DRC are enough for now) -ReneR */
-               schedule_work(&device_change);
-
        }
 }
 #endif /* PMAC_SUPPORT_AUTOMUTE */
@@ -1147,17 +1117,11 @@
        chip->speaker_sw_ctl = snd_ctl_new1(&tumbler_speaker_sw, chip);
        if ((err = snd_ctl_add(chip->card, chip->speaker_sw_ctl)) < 0)
                return err;
-       chip->drc_sw_ctl = snd_ctl_new1(&tumbler_drc_sw, chip);
-       if ((err = snd_ctl_add(chip->card, chip->drc_sw_ctl)) < 0)
-               return err;
-
 
 #ifdef CONFIG_PMAC_PBOOK
        chip->resume = tumbler_resume;
 #endif
 
-       INIT_WORK(&device_change, device_change_handler, (void *)chip);
-
 #ifdef PMAC_SUPPORT_AUTOMUTE
        if (mix->headphone_irq >=0 && (err = snd_pmac_add_automute(chip)) < 0)
                return err;

It reverts some of the recent changes which broke volume adjustment on
my pbook.
 -- Guido

Reply via email to