* Re: [PATCH] ALSA: hda - Add digital BEEP generator support for Realtek codecs.
@ 2009-02-03 14:28 Kusanagi Kouichi
2009-02-03 14:36 ` Takashi Iwai
0 siblings, 1 reply; 12+ messages in thread
From: Kusanagi Kouichi @ 2009-02-03 14:28 UTC (permalink / raw)
To: alsa-devel
Sorry for the late reply.
On Mon, Nov 17, 2008 at 17:53:34PM +0100, Takashi Iwai wrote:
> Thanks for the patch. Do these beep widgets have the mute amp bits?
> If not, we'd likely need to add mute switches as well (otherwise it
> gets too annoying) controlling on software. Check patch_sigmatel.c in
> the latest master branch or topic/fix/hda branch of sound git tree:
> git://git.kernel.org/pub/scm/linux/kernel/tiwai/sound-2.6.git
Every codec can mute beep.
> Another concern is that I don't want to add the digital beep control
> unconditionally. On many devices, the beep is implemented in the old
> good analog way. We'd need to add the check of analog/digital beep in
> a new spec field and in the preset table not to duplicate beep
> controls on these.
I don't think such a check is needed. I presume that analog beep in
is disabled while digital beep generetor is being used.
Furthermore, keyboard bell rings only one device even if both
HDA Digital PCBeep and PC Speaker have been registered.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ALSA: hda - Add digital BEEP generator support for Realtek codecs.
2009-02-03 14:28 [PATCH] ALSA: hda - Add digital BEEP generator support for Realtek codecs Kusanagi Kouichi
@ 2009-02-03 14:36 ` Takashi Iwai
2009-02-04 8:37 ` Kusanagi Kouichi
0 siblings, 1 reply; 12+ messages in thread
From: Takashi Iwai @ 2009-02-03 14:36 UTC (permalink / raw)
To: Kusanagi Kouichi; +Cc: alsa-devel
At Tue, 3 Feb 2009 23:28:51 +0900,
Kusanagi Kouichi wrote:
>
> Sorry for the late reply.
>
> On Mon, Nov 17, 2008 at 17:53:34PM +0100, Takashi Iwai wrote:
> > Thanks for the patch. Do these beep widgets have the mute amp bits?
> > If not, we'd likely need to add mute switches as well (otherwise it
> > gets too annoying) controlling on software. Check patch_sigmatel.c in
> > the latest master branch or topic/fix/hda branch of sound git tree:
> > git://git.kernel.org/pub/scm/linux/kernel/tiwai/sound-2.6.git
>
> Every codec can mute beep.
Then it's fine.
> > Another concern is that I don't want to add the digital beep control
> > unconditionally. On many devices, the beep is implemented in the old
> > good analog way. We'd need to add the check of analog/digital beep in
> > a new spec field and in the preset table not to duplicate beep
> > controls on these.
>
> I don't think such a check is needed. I presume that analog beep in
> is disabled while digital beep generetor is being used.
> Furthermore, keyboard bell rings only one device even if both
> HDA Digital PCBeep and PC Speaker have been registered.
However it's just annoying to have multiple controls for the very same
purpose. If the digital beep works more reliably overall, let's get
rid of all existing analog beep stuff. Having both makes no sense.
(Well, I don't remember exactly your patch so I suppose your patch
doesn't remove the analog beep stuff... Anyway reposting the patch
and checking it's still applicable to the latest driver code would be
helpful :)
thanks,
Takashi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ALSA: hda - Add digital BEEP generator support for Realtek codecs.
2009-02-03 14:36 ` Takashi Iwai
@ 2009-02-04 8:37 ` Kusanagi Kouichi
2009-02-04 11:17 ` Takashi Iwai
0 siblings, 1 reply; 12+ messages in thread
From: Kusanagi Kouichi @ 2009-02-04 8:37 UTC (permalink / raw)
To: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 1335 bytes --]
On Tue, Feb 03, 2009 at 03:36:20PM +0100, Takashi Iwai wrote:
> > > Another concern is that I don't want to add the digital beep control
> > > unconditionally. On many devices, the beep is implemented in the old
> > > good analog way. We'd need to add the check of analog/digital beep in
> > > a new spec field and in the preset table not to duplicate beep
> > > controls on these.
> >
> > I don't think such a check is needed. I presume that analog beep in
> > is disabled while digital beep generetor is being used.
> > Furthermore, keyboard bell rings only one device even if both
> > HDA Digital PCBeep and PC Speaker have been registered.
>
> However it's just annoying to have multiple controls for the very same
> purpose. If the digital beep works more reliably overall, let's get
> rid of all existing analog beep stuff. Having both makes no sense.
>
> (Well, I don't remember exactly your patch so I suppose your patch
> doesn't remove the analog beep stuff... Anyway reposting the patch
> and checking it's still applicable to the latest driver code would be
> helpful :)
Ah! I see the point. There is no duplicated control because I didn't
add any new controls. Existing beep control controls digital beep, too.
Analog beep and digital beep look to be routed through the same path.
Updated patch is attached.
[-- Attachment #2: realtek_beep.diff --]
[-- Type: text/plain, Size: 3840 bytes --]
diff --git a/sound/pci/hda/hda_beep.h b/sound/pci/hda/hda_beep.h
index b9679f0..51bf6a5 100644
--- a/sound/pci/hda/hda_beep.h
+++ b/sound/pci/hda/hda_beep.h
@@ -39,7 +39,7 @@ struct hda_beep {
int snd_hda_attach_beep_device(struct hda_codec *codec, int nid);
void snd_hda_detach_beep_device(struct hda_codec *codec);
#else
-#define snd_hda_attach_beep_device(...)
+#define snd_hda_attach_beep_device(...) 0
#define snd_hda_detach_beep_device(...)
#endif
#endif
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 7884a4e..956b327 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -30,6 +30,7 @@
#include <sound/core.h>
#include "hda_codec.h"
#include "hda_local.h"
+#include "hda_beep.h"
#define ALC880_FRONT_EVENT 0x01
#define ALC880_DCVOL_EVENT 0x02
@@ -3160,6 +3161,7 @@ static void alc_free(struct hda_codec *codec)
alc_free_kctls(codec);
kfree(spec);
+ snd_hda_detach_beep_device(codec);
codec->spec = NULL; /* to be sure */
}
@@ -4328,6 +4330,12 @@ static int patch_alc880(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x1);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC880_AUTO)
setup_preset(spec, &alc880_presets[board_config]);
@@ -5855,6 +5863,12 @@ static int patch_alc260(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x1);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC260_AUTO)
setup_preset(spec, &alc260_presets[board_config]);
@@ -7050,6 +7064,12 @@ static int patch_alc882(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x1);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC882_AUTO)
setup_preset(spec, &alc882_presets[board_config]);
@@ -9024,6 +9044,12 @@ static int patch_alc883(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x1);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC883_AUTO)
setup_preset(spec, &alc883_presets[board_config]);
@@ -10844,6 +10870,12 @@ static int patch_alc262(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x1);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC262_AUTO)
setup_preset(spec, &alc262_presets[board_config]);
@@ -11896,6 +11928,12 @@ static int patch_alc268(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x1);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC268_AUTO)
setup_preset(spec, &alc268_presets[board_config]);
@@ -12730,6 +12768,12 @@ static int patch_alc269(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x1);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC269_AUTO)
setup_preset(spec, &alc269_presets[board_config]);
@@ -13823,6 +13867,12 @@ static int patch_alc861(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x23);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC861_AUTO)
setup_preset(spec, &alc861_presets[board_config]);
@@ -14769,6 +14819,12 @@ static int patch_alc861vd(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x23);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC861VD_AUTO)
setup_preset(spec, &alc861vd_presets[board_config]);
@@ -16578,6 +16634,12 @@ static int patch_alc662(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x1);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC662_AUTO)
setup_preset(spec, &alc662_presets[board_config]);
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH] ALSA: hda - Add digital BEEP generator support for Realtek codecs.
2009-02-04 8:37 ` Kusanagi Kouichi
@ 2009-02-04 11:17 ` Takashi Iwai
2009-02-04 14:20 ` Kusanagi Kouichi
0 siblings, 1 reply; 12+ messages in thread
From: Takashi Iwai @ 2009-02-04 11:17 UTC (permalink / raw)
To: Kusanagi Kouichi; +Cc: alsa-devel
At Wed, 4 Feb 2009 17:37:51 +0900,
Kusanagi Kouichi wrote:
>
> On Tue, Feb 03, 2009 at 03:36:20PM +0100, Takashi Iwai wrote:
> > > > Another concern is that I don't want to add the digital beep control
> > > > unconditionally. On many devices, the beep is implemented in the old
> > > > good analog way. We'd need to add the check of analog/digital beep in
> > > > a new spec field and in the preset table not to duplicate beep
> > > > controls on these.
> > >
> > > I don't think such a check is needed. I presume that analog beep in
> > > is disabled while digital beep generetor is being used.
> > > Furthermore, keyboard bell rings only one device even if both
> > > HDA Digital PCBeep and PC Speaker have been registered.
> >
> > However it's just annoying to have multiple controls for the very same
> > purpose. If the digital beep works more reliably overall, let's get
> > rid of all existing analog beep stuff. Having both makes no sense.
> >
> > (Well, I don't remember exactly your patch so I suppose your patch
> > doesn't remove the analog beep stuff... Anyway reposting the patch
> > and checking it's still applicable to the latest driver code would be
> > helpful :)
>
> Ah! I see the point. There is no duplicated control because I didn't
> add any new controls. Existing beep control controls digital beep, too.
> Analog beep and digital beep look to be routed through the same path.
Fair enough.
Though, there is still one problem -- not all models enabled the
analog beep path. So, the next step is to create beep controls in all
possible situations.
But I'm going to apply your patch as now.
Could you repost the patch with a proper summary, a changelog text and
your sign-off so that I can apply it as is?
thanks,
Takashi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ALSA: hda - Add digital BEEP generator support for Realtek codecs.
2009-02-04 11:17 ` Takashi Iwai
@ 2009-02-04 14:20 ` Kusanagi Kouichi
2009-02-04 14:44 ` Takashi Iwai
0 siblings, 1 reply; 12+ messages in thread
From: Kusanagi Kouichi @ 2009-02-04 14:20 UTC (permalink / raw)
To: alsa-devel
On Wed, Feb 04, 2009 at 12:17:14PM +0100, Takashi Iwai wrote:
> Fair enough.
>
> Though, there is still one problem -- not all models enabled the
> analog beep path. So, the next step is to create beep controls in all
> possible situations.
I'll try later.
> But I'm going to apply your patch as now.
> Could you repost the patch with a proper summary, a changelog text and
> your sign-off so that I can apply it as is?
Sure. I'll send the patch. Thank you.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ALSA: hda - Add digital BEEP generator support for Realtek codecs.
2009-02-04 14:20 ` Kusanagi Kouichi
@ 2009-02-04 14:44 ` Takashi Iwai
2009-02-06 16:25 ` Takashi Iwai
0 siblings, 1 reply; 12+ messages in thread
From: Takashi Iwai @ 2009-02-04 14:44 UTC (permalink / raw)
To: Kusanagi Kouichi; +Cc: alsa-devel
At Wed, 4 Feb 2009 23:20:12 +0900,
Kusanagi Kouichi wrote:
>
> On Wed, Feb 04, 2009 at 12:17:14PM +0100, Takashi Iwai wrote:
> > Fair enough.
> >
> > Though, there is still one problem -- not all models enabled the
> > analog beep path. So, the next step is to create beep controls in all
> > possible situations.
>
> I'll try later.
This can be a separate (additional) patch. Let's get the first patch
into the main tree so that one can work on further issues.
thanks,
Takashi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ALSA: hda - Add digital BEEP generator support for Realtek codecs.
2009-02-04 14:44 ` Takashi Iwai
@ 2009-02-06 16:25 ` Takashi Iwai
2009-02-07 10:40 ` Kusanagi Kouichi
0 siblings, 1 reply; 12+ messages in thread
From: Takashi Iwai @ 2009-02-06 16:25 UTC (permalink / raw)
To: Kusanagi Kouichi; +Cc: alsa-devel
At Wed, 04 Feb 2009 15:44:12 +0100,
I wrote:
>
> At Wed, 4 Feb 2009 23:20:12 +0900,
> Kusanagi Kouichi wrote:
> >
> > On Wed, Feb 04, 2009 at 12:17:14PM +0100, Takashi Iwai wrote:
> > > Fair enough.
> > >
> > > Though, there is still one problem -- not all models enabled the
> > > analog beep path. So, the next step is to create beep controls in all
> > > possible situations.
> >
> > I'll try later.
>
> This can be a separate (additional) patch. Let's get the first patch
> into the main tree so that one can work on further issues.
... and now fixed on sound git tree.
Takashi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ALSA: hda - Add digital BEEP generator support for Realtek codecs.
2009-02-06 16:25 ` Takashi Iwai
@ 2009-02-07 10:40 ` Kusanagi Kouichi
2009-02-07 11:54 ` Takashi Iwai
0 siblings, 1 reply; 12+ messages in thread
From: Kusanagi Kouichi @ 2009-02-07 10:40 UTC (permalink / raw)
To: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 790 bytes --]
On Fri, Feb 06, 2009 at 05:25:13PM +0100, Takashi Iwai wrote:
> At Wed, 04 Feb 2009 15:44:12 +0100,
> I wrote:
> >
> > At Wed, 4 Feb 2009 23:20:12 +0900,
> > Kusanagi Kouichi wrote:
> > >
> > > On Wed, Feb 04, 2009 at 12:17:14PM +0100, Takashi Iwai wrote:
> > > > Fair enough.
> > > >
> > > > Though, there is still one problem -- not all models enabled the
> > > > analog beep path. So, the next step is to create beep controls in all
> > > > possible situations.
> > >
> > > I'll try later.
> >
> > This can be a separate (additional) patch. Let's get the first patch
> > into the main tree so that one can work on further issues.
>
> ... and now fixed on sound git tree.
Some models for alc268 still seems to lack a beep control.
Is it OK to add a beep control unconditionally?
[-- Attachment #2: 0001-hda-Add-mising-beep-controls-for-realtek-alc268-cod.patch --]
[-- Type: text/plain, Size: 1438 bytes --]
>From 184d1a1b1c3976a8a76b2f3b40ad02992b44db48 Mon Sep 17 00:00:00 2001
From: Kusanagi Kouichi <slash@ma.neweb.ne.jp>
Date: Sat, 7 Feb 2009 19:30:05 +0900
Subject: [PATCH] hda: Add mising beep controls for realtek alc268 codec.
So far, some models didn't add a beep control since they don't use
analog beep in.
Signed-off-by: Kusanagi Kouichi <slash@ma.neweb.ne.jp>
---
sound/pci/hda/patch_realtek.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index f594a09..2fa26f9 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -11887,7 +11887,7 @@ static struct snd_pci_quirk alc268_cfg_tbl[] = {
static struct alc_config_preset alc268_presets[] = {
[ALC267_QUANTA_IL1] = {
- .mixers = { alc267_quanta_il1_mixer },
+ .mixers = { alc267_quanta_il1_mixer, alc268_beep_mixer },
.init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
alc267_quanta_il1_verbs },
.num_dacs = ARRAY_SIZE(alc268_dac_nids),
@@ -11969,7 +11969,7 @@ static struct alc_config_preset alc268_presets[] = {
},
[ALC268_ACER_ASPIRE_ONE] = {
.mixers = { alc268_acer_aspire_one_mixer,
- alc268_capture_alt_mixer },
+ alc268_capture_alt_mixer, alc268_beep_mixer },
.init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
alc268_acer_aspire_one_verbs },
.num_dacs = ARRAY_SIZE(alc268_dac_nids),
--
1.5.6.5
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH] ALSA: hda - Add digital BEEP generator support for Realtek codecs.
2009-02-07 10:40 ` Kusanagi Kouichi
@ 2009-02-07 11:54 ` Takashi Iwai
2009-02-10 14:53 ` Takashi Iwai
0 siblings, 1 reply; 12+ messages in thread
From: Takashi Iwai @ 2009-02-07 11:54 UTC (permalink / raw)
To: Kusanagi Kouichi; +Cc: alsa-devel
At Sat, 7 Feb 2009 19:40:52 +0900,
Kusanagi Kouichi wrote:
>
> On Fri, Feb 06, 2009 at 05:25:13PM +0100, Takashi Iwai wrote:
> > At Wed, 04 Feb 2009 15:44:12 +0100,
> > I wrote:
> > >
> > > At Wed, 4 Feb 2009 23:20:12 +0900,
> > > Kusanagi Kouichi wrote:
> > > >
> > > > On Wed, Feb 04, 2009 at 12:17:14PM +0100, Takashi Iwai wrote:
> > > > > Fair enough.
> > > > >
> > > > > Though, there is still one problem -- not all models enabled the
> > > > > analog beep path. So, the next step is to create beep controls in all
> > > > > possible situations.
> > > >
> > > > I'll try later.
> > >
> > > This can be a separate (additional) patch. Let's get the first patch
> > > into the main tree so that one can work on further issues.
> >
> > ... and now fixed on sound git tree.
>
> Some models for alc268 still seems to lack a beep control.
> Is it OK to add a beep control unconditionally?
The question is whether it works.
In your previous patch, patch_alc268() is untouched and has no
digital beep hook yet.
I'll check a machine with ALC268 later.
thanks,
Takashi
> [2 0001-hda-Add-mising-beep-controls-for-realtek-alc268-cod.patch <text/plain; us-ascii (7bit)>]
> >From 184d1a1b1c3976a8a76b2f3b40ad02992b44db48 Mon Sep 17 00:00:00 2001
> From: Kusanagi Kouichi <slash@ma.neweb.ne.jp>
> Date: Sat, 7 Feb 2009 19:30:05 +0900
> Subject: [PATCH] hda: Add mising beep controls for realtek alc268 codec.
>
> So far, some models didn't add a beep control since they don't use
> analog beep in.
>
> Signed-off-by: Kusanagi Kouichi <slash@ma.neweb.ne.jp>
> ---
> sound/pci/hda/patch_realtek.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
> index f594a09..2fa26f9 100644
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
> @@ -11887,7 +11887,7 @@ static struct snd_pci_quirk alc268_cfg_tbl[] = {
>
> static struct alc_config_preset alc268_presets[] = {
> [ALC267_QUANTA_IL1] = {
> - .mixers = { alc267_quanta_il1_mixer },
> + .mixers = { alc267_quanta_il1_mixer, alc268_beep_mixer },
> .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
> alc267_quanta_il1_verbs },
> .num_dacs = ARRAY_SIZE(alc268_dac_nids),
> @@ -11969,7 +11969,7 @@ static struct alc_config_preset alc268_presets[] = {
> },
> [ALC268_ACER_ASPIRE_ONE] = {
> .mixers = { alc268_acer_aspire_one_mixer,
> - alc268_capture_alt_mixer },
> + alc268_capture_alt_mixer, alc268_beep_mixer },
> .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
> alc268_acer_aspire_one_verbs },
> .num_dacs = ARRAY_SIZE(alc268_dac_nids),
> --
> 1.5.6.5
>
> [3 <text/plain; us-ascii (7bit)>]
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] ALSA: hda - Add digital BEEP generator support for Realtek codecs.
2009-02-07 11:54 ` Takashi Iwai
@ 2009-02-10 14:53 ` Takashi Iwai
0 siblings, 0 replies; 12+ messages in thread
From: Takashi Iwai @ 2009-02-10 14:53 UTC (permalink / raw)
To: Kusanagi Kouichi; +Cc: alsa-devel
At Sat, 07 Feb 2009 12:54:25 +0100,
I wrote:
>
> At Sat, 7 Feb 2009 19:40:52 +0900,
> Kusanagi Kouichi wrote:
> >
> > On Fri, Feb 06, 2009 at 05:25:13PM +0100, Takashi Iwai wrote:
> > > At Wed, 04 Feb 2009 15:44:12 +0100,
> > > I wrote:
> > > >
> > > > At Wed, 4 Feb 2009 23:20:12 +0900,
> > > > Kusanagi Kouichi wrote:
> > > > >
> > > > > On Wed, Feb 04, 2009 at 12:17:14PM +0100, Takashi Iwai wrote:
> > > > > > Fair enough.
> > > > > >
> > > > > > Though, there is still one problem -- not all models enabled the
> > > > > > analog beep path. So, the next step is to create beep controls in all
> > > > > > possible situations.
> > > > >
> > > > > I'll try later.
> > > >
> > > > This can be a separate (additional) patch. Let's get the first patch
> > > > into the main tree so that one can work on further issues.
> > >
> > > ... and now fixed on sound git tree.
> >
> > Some models for alc268 still seems to lack a beep control.
> > Is it OK to add a beep control unconditionally?
>
> The question is whether it works.
> In your previous patch, patch_alc268() is untouched and has no
> digital beep hook yet.
>
> I'll check a machine with ALC268 later.
As it seems working, I fixed the issue on sound git tree now.
Takashi
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] ALSA: hda - Add digital BEEP generator support for Realtek codecs.
@ 2008-11-15 6:20 Kusanagi Kouichi
2008-11-17 16:53 ` Takashi Iwai
0 siblings, 1 reply; 12+ messages in thread
From: Kusanagi Kouichi @ 2008-11-15 6:20 UTC (permalink / raw)
To: alsa-devel; +Cc: linux-kernel
Add digital BEEP generator support for Realtek codecs.
Signed-off-by: Kusanagi Kouichi <slash@ma.neweb.ne.jp>
---
sound/pci/hda/hda_beep.h | 2 +-
sound/pci/hda/patch_realtek.c | 62 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 63 insertions(+), 1 deletions(-)
diff --git a/sound/pci/hda/hda_beep.h b/sound/pci/hda/hda_beep.h
index de4036e..b483779 100644
--- a/sound/pci/hda/hda_beep.h
+++ b/sound/pci/hda/hda_beep.h
@@ -38,7 +38,7 @@ struct hda_beep {
int snd_hda_attach_beep_device(struct hda_codec *codec, int nid);
void snd_hda_detach_beep_device(struct hda_codec *codec);
#else
-#define snd_hda_attach_beep_device(...)
+#define snd_hda_attach_beep_device(...) 0
#define snd_hda_detach_beep_device(...)
#endif
#endif
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index a378c01..d586600 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -31,6 +31,7 @@
#include "hda_codec.h"
#include "hda_local.h"
#include "hda_patch.h"
+#include "hda_beep.h"
#define ALC880_FRONT_EVENT 0x01
#define ALC880_DCVOL_EVENT 0x02
@@ -2788,6 +2789,7 @@ static void alc_free(struct hda_codec *codec)
kfree(spec->kctl_alloc);
}
kfree(spec);
+ snd_hda_detach_beep_device(codec);
codec->spec = NULL; /* to be sure */
}
@@ -3960,6 +3962,12 @@ static int patch_alc880(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x1);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC880_AUTO)
setup_preset(spec, &alc880_presets[board_config]);
@@ -5558,6 +5566,12 @@ static int patch_alc260(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x1);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC260_AUTO)
setup_preset(spec, &alc260_presets[board_config]);
@@ -6811,6 +6825,12 @@ static int patch_alc882(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x1);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC882_AUTO)
setup_preset(spec, &alc882_presets[board_config]);
@@ -8916,6 +8936,12 @@ static int patch_alc883(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x1);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC883_AUTO)
setup_preset(spec, &alc883_presets[board_config]);
@@ -10739,6 +10765,12 @@ static int patch_alc262(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x1);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC262_AUTO)
setup_preset(spec, &alc262_presets[board_config]);
@@ -11752,6 +11784,12 @@ static int patch_alc268(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x1);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC268_AUTO)
setup_preset(spec, &alc268_presets[board_config]);
@@ -12458,6 +12496,12 @@ static int patch_alc269(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x1);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC269_AUTO)
setup_preset(spec, &alc269_presets[board_config]);
@@ -13624,6 +13668,12 @@ static int patch_alc861(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x23);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC861_AUTO)
setup_preset(spec, &alc861_presets[board_config]);
@@ -14578,6 +14628,12 @@ static int patch_alc861vd(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x23);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC861VD_AUTO)
setup_preset(spec, &alc861vd_presets[board_config]);
@@ -16412,6 +16468,12 @@ static int patch_alc662(struct hda_codec *codec)
}
}
+ err = snd_hda_attach_beep_device(codec, 0x1);
+ if (err < 0) {
+ alc_free(codec);
+ return err;
+ }
+
if (board_config != ALC662_AUTO)
setup_preset(spec, &alc662_presets[board_config]);
--
1.5.6.5
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH] ALSA: hda - Add digital BEEP generator support for Realtek codecs.
2008-11-15 6:20 Kusanagi Kouichi
@ 2008-11-17 16:53 ` Takashi Iwai
0 siblings, 0 replies; 12+ messages in thread
From: Takashi Iwai @ 2008-11-17 16:53 UTC (permalink / raw)
To: Kusanagi Kouichi; +Cc: alsa-devel, linux-kernel
At Sat, 15 Nov 2008 15:20:14 +0900,
Kusanagi Kouichi wrote:
>
> Add digital BEEP generator support for Realtek codecs.
>
> Signed-off-by: Kusanagi Kouichi <slash@ma.neweb.ne.jp>
Thanks for the patch. Do these beep widgets have the mute amp bits?
If not, we'd likely need to add mute switches as well (otherwise it
gets too annoying) controlling on software. Check patch_sigmatel.c in
the latest master branch or topic/fix/hda branch of sound git tree:
git://git.kernel.org/pub/scm/linux/kernel/tiwai/sound-2.6.git
Another concern is that I don't want to add the digital beep control
unconditionally. On many devices, the beep is implemented in the old
good analog way. We'd need to add the check of analog/digital beep in
a new spec field and in the preset table not to duplicate beep
controls on these.
thanks,
Takashi
> ---
> sound/pci/hda/hda_beep.h | 2 +-
> sound/pci/hda/patch_realtek.c | 62 +++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 63 insertions(+), 1 deletions(-)
>
> diff --git a/sound/pci/hda/hda_beep.h b/sound/pci/hda/hda_beep.h
> index de4036e..b483779 100644
> --- a/sound/pci/hda/hda_beep.h
> +++ b/sound/pci/hda/hda_beep.h
> @@ -38,7 +38,7 @@ struct hda_beep {
> int snd_hda_attach_beep_device(struct hda_codec *codec, int nid);
> void snd_hda_detach_beep_device(struct hda_codec *codec);
> #else
> -#define snd_hda_attach_beep_device(...)
> +#define snd_hda_attach_beep_device(...) 0
> #define snd_hda_detach_beep_device(...)
> #endif
> #endif
> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
> index a378c01..d586600 100644
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
> @@ -31,6 +31,7 @@
> #include "hda_codec.h"
> #include "hda_local.h"
> #include "hda_patch.h"
> +#include "hda_beep.h"
>
> #define ALC880_FRONT_EVENT 0x01
> #define ALC880_DCVOL_EVENT 0x02
> @@ -2788,6 +2789,7 @@ static void alc_free(struct hda_codec *codec)
> kfree(spec->kctl_alloc);
> }
> kfree(spec);
> + snd_hda_detach_beep_device(codec);
> codec->spec = NULL; /* to be sure */
> }
>
> @@ -3960,6 +3962,12 @@ static int patch_alc880(struct hda_codec *codec)
> }
> }
>
> + err = snd_hda_attach_beep_device(codec, 0x1);
> + if (err < 0) {
> + alc_free(codec);
> + return err;
> + }
> +
> if (board_config != ALC880_AUTO)
> setup_preset(spec, &alc880_presets[board_config]);
>
> @@ -5558,6 +5566,12 @@ static int patch_alc260(struct hda_codec *codec)
> }
> }
>
> + err = snd_hda_attach_beep_device(codec, 0x1);
> + if (err < 0) {
> + alc_free(codec);
> + return err;
> + }
> +
> if (board_config != ALC260_AUTO)
> setup_preset(spec, &alc260_presets[board_config]);
>
> @@ -6811,6 +6825,12 @@ static int patch_alc882(struct hda_codec *codec)
> }
> }
>
> + err = snd_hda_attach_beep_device(codec, 0x1);
> + if (err < 0) {
> + alc_free(codec);
> + return err;
> + }
> +
> if (board_config != ALC882_AUTO)
> setup_preset(spec, &alc882_presets[board_config]);
>
> @@ -8916,6 +8936,12 @@ static int patch_alc883(struct hda_codec *codec)
> }
> }
>
> + err = snd_hda_attach_beep_device(codec, 0x1);
> + if (err < 0) {
> + alc_free(codec);
> + return err;
> + }
> +
> if (board_config != ALC883_AUTO)
> setup_preset(spec, &alc883_presets[board_config]);
>
> @@ -10739,6 +10765,12 @@ static int patch_alc262(struct hda_codec *codec)
> }
> }
>
> + err = snd_hda_attach_beep_device(codec, 0x1);
> + if (err < 0) {
> + alc_free(codec);
> + return err;
> + }
> +
> if (board_config != ALC262_AUTO)
> setup_preset(spec, &alc262_presets[board_config]);
>
> @@ -11752,6 +11784,12 @@ static int patch_alc268(struct hda_codec *codec)
> }
> }
>
> + err = snd_hda_attach_beep_device(codec, 0x1);
> + if (err < 0) {
> + alc_free(codec);
> + return err;
> + }
> +
> if (board_config != ALC268_AUTO)
> setup_preset(spec, &alc268_presets[board_config]);
>
> @@ -12458,6 +12496,12 @@ static int patch_alc269(struct hda_codec *codec)
> }
> }
>
> + err = snd_hda_attach_beep_device(codec, 0x1);
> + if (err < 0) {
> + alc_free(codec);
> + return err;
> + }
> +
> if (board_config != ALC269_AUTO)
> setup_preset(spec, &alc269_presets[board_config]);
>
> @@ -13624,6 +13668,12 @@ static int patch_alc861(struct hda_codec *codec)
> }
> }
>
> + err = snd_hda_attach_beep_device(codec, 0x23);
> + if (err < 0) {
> + alc_free(codec);
> + return err;
> + }
> +
> if (board_config != ALC861_AUTO)
> setup_preset(spec, &alc861_presets[board_config]);
>
> @@ -14578,6 +14628,12 @@ static int patch_alc861vd(struct hda_codec *codec)
> }
> }
>
> + err = snd_hda_attach_beep_device(codec, 0x23);
> + if (err < 0) {
> + alc_free(codec);
> + return err;
> + }
> +
> if (board_config != ALC861VD_AUTO)
> setup_preset(spec, &alc861vd_presets[board_config]);
>
> @@ -16412,6 +16468,12 @@ static int patch_alc662(struct hda_codec *codec)
> }
> }
>
> + err = snd_hda_attach_beep_device(codec, 0x1);
> + if (err < 0) {
> + alc_free(codec);
> + return err;
> + }
> +
> if (board_config != ALC662_AUTO)
> setup_preset(spec, &alc662_presets[board_config]);
>
> --
> 1.5.6.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2009-02-10 14:54 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-03 14:28 [PATCH] ALSA: hda - Add digital BEEP generator support for Realtek codecs Kusanagi Kouichi
2009-02-03 14:36 ` Takashi Iwai
2009-02-04 8:37 ` Kusanagi Kouichi
2009-02-04 11:17 ` Takashi Iwai
2009-02-04 14:20 ` Kusanagi Kouichi
2009-02-04 14:44 ` Takashi Iwai
2009-02-06 16:25 ` Takashi Iwai
2009-02-07 10:40 ` Kusanagi Kouichi
2009-02-07 11:54 ` Takashi Iwai
2009-02-10 14:53 ` Takashi Iwai
-- strict thread matches above, loose matches on Subject: below --
2008-11-15 6:20 Kusanagi Kouichi
2008-11-17 16:53 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox