2010-06-26 11:33:07

by Shérab

[permalink] [raw]
Subject: PC Beeps not working with HDA Intel module

Dear all,

The problem is on a computer with an HDA Intel sound card, Intel G45
DEVCTG chip and appears will all version s of the kernel.

Running e.g.
beep 440
produces a beep whose audible frequency is very low, definitely not 440
Hz.

However, it is worth notiing that grub is able to produce a beep of the
right frequency at boot time.

Can this problem be fixed ?

Should you need any additional bit of information or testing, please ask.

Many thanks in advance for your help,
Sh?rab.


2010-07-05 06:11:46

by Takashi Iwai

[permalink] [raw]
Subject: Re: PC Beeps not working with HDA Intel module

At Sat, 26 Jun 2010 13:25:04 +0200,
Shérab wrote:
>
> Dear all,
>
> The problem is on a computer with an HDA Intel sound card, Intel G45
> DEVCTG chip and appears will all version s of the kernel.
>
> Running e.g.
> beep 440
> produces a beep whose audible frequency is very low, definitely not 440
> Hz.
>
> However, it is worth notiing that grub is able to produce a beep of the
> right frequency at boot time.
>
> Can this problem be fixed ?

There are a few ways.

If you build your kernel with SND_HDA_INPUT_BEEP_MODE=2, or set the
option of snd-hda-intel module beep_mode=2, you'll be able to switch
to the native beep from HD-audio codec digital beep via muting "Beep"
mixer switch.

Or, if the value above is 0, it'll be always the system-native beep.
This can be done also via writing sysfs codec hint, as documented in
HD-Audio.txt.

Alternatively, you can reload pcspkr module so that it grabs the beep
output again over snd-hda-intel, "modprobe -r pcspkr; modprobe pcspkr"


Takashi

2010-07-05 11:20:28

by Daniel J Blueman

[permalink] [raw]
Subject: re: PC Beeps not working with HDA Intel module

On Jun 26, 12:40 pm, Sh?rab <[email protected]> wrote:
> Dear all,
>
> The problem is on a computer with an HDA Intel sound card, Intel G45
> DEVCTG chip and appears will all version s of the kernel.
>
> Running e.g.
> beep 440
> produces a beep whose audible frequency is very low, definitely not 440
> Hz.
>
> However, it is worth notiing that grub is able to produce a beep of the
> right frequency at boot time.
>
> Can this problem be fixed ?
>
> Should you need any additional bit of information or testing, please ask.

I was finding the same with my Dell Studio 1557.

It may be worth using some printk calls [1] showing what frequency
value is sent to the codec, then checking with the codec datasheet -
we'll need to know which one, eg from 'dmesg' or 'alsa-info.sh' (from
http://www.alsa-project.org/alsa-info.sh).

We'll probably need to check the configuration registers of the beep
widget to check what divider it's using...

Thanks,
Daniel

--- [1]

diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c
index 29714c8..98d0d6c 100644
--- a/sound/pci/hda/hda_beep.c
+++ b/sound/pci/hda/hda_beep.c
@@ -69,6 +69,7 @@ static int beep_linear_tone(struct hda_beep *beep, int hz)
hz /= DIGBEEP_HZ_STEP;
hz = 255 - hz;
}
+ printk(KERN_ERR "HDA beep: linear value %d\n", hz);
return hz;
}

@@ -87,6 +88,7 @@ static int beep_standard_tone(struct hda_beep *beep, int hz)
return 0xff;
if (hz <= 0)
return 1;
+ printk(KERN_ERR "HDA beep: standard value %d\n", hz);
return hz;
}

--
Daniel J Blueman

2010-08-02 18:23:20

by Shérab

[permalink] [raw]
Subject: Re: PC Beeps not working with HDA Intel module

Dear Daniel,

Many thanks for your helpful e-mail and sorry for the delay, it was hard
to find the time for testing.

Daniel J Blueman (2010/07/05 12:20 +0100):
>
> On Jun 26, 12:40 pm, Sh?rab <[email protected]> wrote:
> > Dear all,
> >
> > The problem is on a computer with an HDA Intel sound card, Intel G45
> > DEVCTG chip and appears will all version s of the kernel.
> >
> > Running e.g.
> > beep 440
> > produces a beep whose audible frequency is very low, definitely not 440
> > Hz.
> >
> > However, it is worth notiing that grub is able to produce a beep of the
> > right frequency at boot time.
> >
> > Can this problem be fixed ?
> >
> > Should you need any additional bit of information or testing, please ask.
>
> I was finding the same with my Dell Studio 1557.

Good to know one is not alone.

> It may be worth using some printk calls [1] showing what frequency
> value is sent to the codec,

I applied your patch on top of
9fe6206f400646a2322096b56c59891d530e8d51

When a console bell is produced, one gets:
HDA beep: linear value 241

And running the command
beep 440
produces the following output:
HDA beep: linear value 248

Aso, the printk you added saying "printk(KERN_ERR "HDA beep: standard
value" never appears in the logs.
Was this result predictable ?
I thought that to each standard value one linear value would correspond,
or something like that.

> then checking with the codec datasheet -
> we'll need to know which one, eg from 'dmesg' or 'alsa-info.sh' (from
> http://www.alsa-project.org/alsa-info.sh).

I attach the bzipped alsa-info.txt, hope this will help you guys.

> We'll probably need to check the configuration registers of the beep
> widget to check what divider it's using...

That I don't know how to do, sorry. Any clue would be warmly
appreciated.

Thanks again,
Sh?rab.


Attachments:
(No filename) (1.79 kB)
alsa-info.txt.bz2 (5.82 kB)
Download all attachments

2010-08-02 21:41:44

by Daniel J Blueman

[permalink] [raw]
Subject: Re: PC Beeps not working with HDA Intel module

On 2 August 2010 19:14, Sh?rab <[email protected]> wrote:
> Dear Daniel,
>
> Many thanks for your helpful e-mail and sorry for the delay, it was hard
> to find the time for testing.
>
> Daniel J Blueman (2010/07/05 12:20 +0100):
>>
>> On Jun 26, 12:40 pm, Sh?rab <[email protected]> wrote:
>> > Dear all,
>> >
>> > The problem is on a computer with an HDA Intel sound card, Intel G45
>> > DEVCTG chip and appears will all version s of the kernel.
>> >
>> > Running e.g.
>> > beep 440
>> > produces a beep whose audible frequency is very low, definitely not 440
>> > Hz.
>> >
>> > However, it is worth notiing that grub is able to produce a beep of the
>> > right frequency at boot time.
>> >
>> > Can this problem be fixed ?
>> >
>> > Should you need any additional bit of information or testing, please ask.
>>
>> I was finding the same with my Dell Studio 1557.
>
> Good to know one is not alone.
>
>> It may be worth using some printk calls [1] showing what frequency
>> value is sent to the codec,
>
> I applied your patch on top of
> 9fe6206f400646a2322096b56c59891d530e8d51
>
> When a console bell is produced, one gets:
> HDA beep: linear value 241
>
> And running the command
> beep 440
> produces the following output:
> HDA beep: linear value 248
>
> Aso, the printk you added saying "printk(KERN_ERR "HDA beep: standard
> value" never appears in the logs.
> Was this result predictable ?
> I thought that to each standard value one linear value would correspond,
> or something like that.

I looked into this further, and on my Dell Studio 15 (with similar IDT
codec), I get value 248 written with the linear calculation. The
datasheet [http://www.idt.com/products/getDoc.cfm?docID=18716251] has
conflicting information: page 28 tells us the HD Audio spec 'standard'
calculation is used (ie freq=48000/4*val), but page 165 tells the
linear calculation is used (ie freq=48000*(257-val)/1024).

A handy app on my phone tells me the frequency produced is 48.4Hz.
Well, 48000/4*248~=48, so it is clear Linux is using the wrong
calculation method.

Testing with value 27 (ie 48000/4*27~=440), we hear the expected tone:
$ sudo ./hda-verb /dev/snd/hwC0D0 0x1c SET_BEEP_CONTROL 27
(of course, your beep widget may not be 0x1c)

The problem is the assumption in patch_sigmatel.c:stac92xx_parse_auto_config():

/* setup digital beep controls and input device */
#ifdef CONFIG_SND_HDA_INPUT_BEEP
if (spec->digbeep_nid > 0) {
hda_nid_t nid = spec->digbeep_nid;
unsigned int caps;

err = stac92xx_auto_create_beep_ctls(codec, nid);
if (err < 0)
return err;
err = snd_hda_attach_beep_device(codec, nid);
if (err < 0)
return err;
if (codec->beep) {
/* IDT/STAC codecs have linear beep tone parameter */
codec->beep->linear_tone = 1;
/* if no beep switch is available, make its own one */
caps = query_amp_caps(codec, nid, HDA_OUTPUT);
if (!(caps & AC_AMPCAP_MUTE)) {
err = stac92xx_beep_switch_ctl(codec);
if (err < 0)
return err;
}
}
}
#endif

So, linear calculation is used for all SigmaTel/IDT codecs.

Takashi, is then (eg) a white-list the best way to select linear
calculation, as clearly IDT have reverted to the spec?

Thanks,
Daniel
--
Daniel J Blueman

2010-08-02 21:44:29

by Takashi Iwai

[permalink] [raw]
Subject: Re: PC Beeps not working with HDA Intel module

At Mon, 2 Aug 2010 22:41:40 +0100,
Daniel J Blueman wrote:
>
> On 2 August 2010 19:14, Shérab <[email protected]> wrote:
> > Dear Daniel,
> >
> > Many thanks for your helpful e-mail and sorry for the delay, it was hard
> > to find the time for testing.
> >
> > Daniel J Blueman (2010/07/05 12:20 +0100):
> >>
> >> On Jun 26, 12:40 pm, Shérab <[email protected]> wrote:
> >> > Dear all,
> >> >
> >> > The problem is on a computer with an HDA Intel sound card, Intel G45
> >> > DEVCTG chip and appears will all version s of the kernel.
> >> >
> >> > Running e.g.
> >> > beep 440
> >> > produces a beep whose audible frequency is very low, definitely not 440
> >> > Hz.
> >> >
> >> > However, it is worth notiing that grub is able to produce a beep of the
> >> > right frequency at boot time.
> >> >
> >> > Can this problem be fixed ?
> >> >
> >> > Should you need any additional bit of information or testing, please ask.
> >>
> >> I was finding the same with my Dell Studio 1557.
> >
> > Good to know one is not alone.
> >
> >> It may be worth using some printk calls [1] showing what frequency
> >> value is sent to the codec,
> >
> > I applied your patch on top of
> > 9fe6206f400646a2322096b56c59891d530e8d51
> >
> > When a console bell is produced, one gets:
> > HDA beep: linear value 241
> >
> > And running the command
> > beep 440
> > produces the following output:
> > HDA beep: linear value 248
> >
> > Aso, the printk you added saying "printk(KERN_ERR "HDA beep: standard
> > value" never appears in the logs.
> > Was this result predictable ?
> > I thought that to each standard value one linear value would correspond,
> > or something like that.
>
> I looked into this further, and on my Dell Studio 15 (with similar IDT
> codec), I get value 248 written with the linear calculation. The
> datasheet [http://www.idt.com/products/getDoc.cfm?docID=18716251] has
> conflicting information: page 28 tells us the HD Audio spec 'standard'
> calculation is used (ie freq=48000/4*val), but page 165 tells the
> linear calculation is used (ie freq=48000*(257-val)/1024).
>
> A handy app on my phone tells me the frequency produced is 48.4Hz.
> Well, 48000/4*248~=48, so it is clear Linux is using the wrong
> calculation method.
>
> Testing with value 27 (ie 48000/4*27~=440), we hear the expected tone:
> $ sudo ./hda-verb /dev/snd/hwC0D0 0x1c SET_BEEP_CONTROL 27
> (of course, your beep widget may not be 0x1c)
>
> The problem is the assumption in patch_sigmatel.c:stac92xx_parse_auto_config():
>
> /* setup digital beep controls and input device */
> #ifdef CONFIG_SND_HDA_INPUT_BEEP
> if (spec->digbeep_nid > 0) {
> hda_nid_t nid = spec->digbeep_nid;
> unsigned int caps;
>
> err = stac92xx_auto_create_beep_ctls(codec, nid);
> if (err < 0)
> return err;
> err = snd_hda_attach_beep_device(codec, nid);
> if (err < 0)
> return err;
> if (codec->beep) {
> /* IDT/STAC codecs have linear beep tone parameter */
> codec->beep->linear_tone = 1;
> /* if no beep switch is available, make its own one */
> caps = query_amp_caps(codec, nid, HDA_OUTPUT);
> if (!(caps & AC_AMPCAP_MUTE)) {
> err = stac92xx_beep_switch_ctl(codec);
> if (err < 0)
> return err;
> }
> }
> }
> #endif
>
> So, linear calculation is used for all SigmaTel/IDT codecs.
>
> Takashi, is then (eg) a white-list the best way to select linear
> calculation, as clearly IDT have reverted to the spec?

We may add a new field in stac_spec, set it in each patch_*(), and
just copy it to codec->beep->linear_tone at the place above.


thanks,

Takashi

2010-08-03 08:17:49

by Shérab

[permalink] [raw]
Subject: Re: PC Beeps not working with HDA Intel module

Dear Daniel and Takashi,

First of all many thanks to both of you for your so prompt and so
efficient reply ! Quite impressive.

Daniel J Blueman (2010/08/02 22:41 +0100):
> Testing with value 27 (ie 48000/4*27~=440), we hear the expected tone:
> $ sudo ./hda-verb /dev/snd/hwC0D0 0x1c SET_BEEP_CONTROL 27
> (of course, your beep widget may not be 0x1c)

I don't know and don't even know what beep widget means, I'm sorry.
If you can explain and also tell me where to find this hda-verb program
you are using, I am willing to test if that's your wish.

> The problem is the assumption in patch_sigmatel.c:stac92xx_parse_auto_config():

[...]

So is there anything more I can/should do now ?

Thanks !
Sh?rab.

2010-08-03 09:02:37

by Daniel J Blueman

[permalink] [raw]
Subject: Re: PC Beeps not working with HDA Intel module

On 3 August 2010 09:17, Sh?rab <[email protected]> wrote:
> Dear Daniel and Takashi,
>
> First of all many thanks to both of you for your so prompt and so
> efficient reply ! Quite impressive.
>
> Daniel J Blueman (2010/08/02 22:41 +0100):
>> Testing with value 27 (ie 48000/4*27~=440), we hear the expected tone:
>> $ sudo ./hda-verb /dev/snd/hwC0D0 0x1c SET_BEEP_CONTROL 27
>> (of course, your beep widget may not be 0x1c)
>
> I don't know and don't even know what beep widget means, I'm sorry.
> If you can explain and also tell me where to find this hda-verb program
> you are using, I am willing to test if that's your wish.

hda-verb is at:
http://ftp1.kernel.org/pub/linux/kernel/people/tiwai/misc/hda-verb/hda-verb-0.3.tar.bz2

>From your alsa-info.sh, your beep widget (ie device) is at 0x26.

>> The problem is the assumption in patch_sigmatel.c:stac92xx_parse_auto_config():
>
> [...]
>
> So is there anything more I can/should do now ?

Nothing further, as we know the source of the issue.

Thanks,
Daniel
--
Daniel J Blueman

2010-08-03 10:09:18

by Daniel J Blueman

[permalink] [raw]
Subject: Re: PC Beeps not working with HDA Intel module

On 3 August 2010 10:02, Daniel J Blueman <[email protected]> wrote:
> On 3 August 2010 09:17, Sh?rab <[email protected]> wrote:
>> Dear Daniel and Takashi,
>>
>> First of all many thanks to both of you for your so prompt and so
>> efficient reply ! Quite impressive.
>>
>> Daniel J Blueman (2010/08/02 22:41 +0100):
>>> Testing with value 27 (ie 48000/4*27~=440), we hear the expected tone:
>>> $ sudo ./hda-verb /dev/snd/hwC0D0 0x1c SET_BEEP_CONTROL 27
>>> (of course, your beep widget may not be 0x1c)
>>
>> I don't know and don't even know what beep widget means, I'm sorry.
>> If you can explain and also tell me where to find this hda-verb program
>> you are using, I am willing to test if that's your wish.
>
> hda-verb is at:
> http://ftp1.kernel.org/pub/linux/kernel/people/tiwai/misc/hda-verb/hda-verb-0.3.tar.bz2
>
> From your alsa-info.sh, your beep widget (ie device) is at 0x26.
>
>>> The problem is the assumption in patch_sigmatel.c:stac92xx_parse_auto_config():
>>
>> [...]
>>
>> So is there anything more I can/should do now ?
>
> Nothing further, as we know the source of the issue.

Ok, this patch works for me; I've modified it with the ground-truth we
have (thus there are likely other codecs to fix up later). Sh?rab, can
you test from your end?

Fix HDA beep frequency on IDT 92HD73xx and 92HD71Bxx codecs.

Signed-off-by: Daniel J Blueman <[email protected]>

diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index f1e7bab..b8d730c 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -202,6 +202,7 @@ struct sigmatel_spec {
unsigned int spdif_mute: 1;
unsigned int check_volume_offset:1;
unsigned int auto_mic:1;
+ unsigned int linear_tone_beep:1;

/* gpio lines */
unsigned int eapd_mask;
@@ -3802,7 +3803,7 @@ static int stac92xx_parse_auto_config(struct
hda_codec *codec, hda_nid_t dig_out
return err;
if (codec->beep) {
/* IDT/STAC codecs have linear beep tone parameter */
- codec->beep->linear_tone = 1;
+ codec->beep->linear_tone = spec->linear_tone_beep;
/* if no beep switch is available, make its own one */
caps = query_amp_caps(codec, nid, HDA_OUTPUT);
if (!(caps & AC_AMPCAP_MUTE)) {
@@ -5005,6 +5006,7 @@ static int patch_stac9200(struct hda_codec *codec)

codec->no_trigger_sense = 1;
codec->spec = spec;
+ spec->linear_tone_beep = 1;
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,
@@ -5068,6 +5070,7 @@ static int patch_stac925x(struct hda_codec *codec)

codec->no_trigger_sense = 1;
codec->spec = spec;
+ spec->linear_tone_beep = 1;
spec->num_pins = ARRAY_SIZE(stac925x_pin_nids);
spec->pin_nids = stac925x_pin_nids;

@@ -5153,6 +5156,7 @@ static int patch_stac92hd73xx(struct hda_codec *codec)

codec->no_trigger_sense = 1;
codec->spec = spec;
+ spec->linear_tone_beep = 0;
codec->slave_dig_outs = stac92hd73xx_slave_dig_outs;
spec->num_pins = ARRAY_SIZE(stac92hd73xx_pin_nids);
spec->pin_nids = stac92hd73xx_pin_nids;
@@ -5300,6 +5304,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)

codec->no_trigger_sense = 1;
codec->spec = spec;
+ spec->linear_tone_beep = 1;
codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs;
spec->digbeep_nid = 0x21;
spec->mux_nids = stac92hd83xxx_mux_nids;
@@ -5522,6 +5527,7 @@ static int patch_stac92hd71bxx(struct hda_codec *codec)

codec->no_trigger_sense = 1;
codec->spec = spec;
+ spec->linear_tone_beep = 0;
codec->patch_ops = stac92xx_patch_ops;
spec->num_pins = STAC92HD71BXX_NUM_PINS;
switch (codec->vendor_id) {
@@ -5779,6 +5785,7 @@ static int patch_stac922x(struct hda_codec *codec)

codec->no_trigger_sense = 1;
codec->spec = spec;
+ spec->linear_tone_beep = 1;
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,
@@ -5883,6 +5890,7 @@ static int patch_stac927x(struct hda_codec *codec)

codec->no_trigger_sense = 1;
codec->spec = spec;
+ spec->linear_tone_beep = 1;
codec->slave_dig_outs = stac927x_slave_dig_outs;
spec->num_pins = ARRAY_SIZE(stac927x_pin_nids);
spec->pin_nids = stac927x_pin_nids;
@@ -6018,6 +6026,7 @@ static int patch_stac9205(struct hda_codec *codec)

codec->no_trigger_sense = 1;
codec->spec = spec;
+ spec->linear_tone_beep = 1;
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,
@@ -6174,6 +6183,7 @@ static int patch_stac9872(struct hda_codec *codec)
return -ENOMEM;
codec->no_trigger_sense = 1;
codec->spec = spec;
+ spec->linear_tone_beep = 1;
spec->num_pins = ARRAY_SIZE(stac9872_pin_nids);
spec->pin_nids = stac9872_pin_nids;

--
Daniel J Blueman

2010-08-03 10:59:41

by Takashi Iwai

[permalink] [raw]
Subject: Re: PC Beeps not working with HDA Intel module

At Tue, 3 Aug 2010 11:09:13 +0100,
Daniel J Blueman wrote:
>
> On 3 August 2010 10:02, Daniel J Blueman <[email protected]> wrote:
> > On 3 August 2010 09:17, Shérab <[email protected]> wrote:
> >> Dear Daniel and Takashi,
> >>
> >> First of all many thanks to both of you for your so prompt and so
> >> efficient reply ! Quite impressive.
> >>
> >> Daniel J Blueman (2010/08/02 22:41 +0100):
> >>> Testing with value 27 (ie 48000/4*27~=440), we hear the expected tone:
> >>> $ sudo ./hda-verb /dev/snd/hwC0D0 0x1c SET_BEEP_CONTROL 27
> >>> (of course, your beep widget may not be 0x1c)
> >>
> >> I don't know and don't even know what beep widget means, I'm sorry.
> >> If you can explain and also tell me where to find this hda-verb program
> >> you are using, I am willing to test if that's your wish.
> >
> > hda-verb is at:
> > http://ftp1.kernel.org/pub/linux/kernel/people/tiwai/misc/hda-verb/hda-verb-0.3.tar.bz2
> >
> > From your alsa-info.sh, your beep widget (ie device) is at 0x26.
> >
> >>> The problem is the assumption in patch_sigmatel.c:stac92xx_parse_auto_config():
> >>
> >> [...]
> >>
> >> So is there anything more I can/should do now ?
> >
> > Nothing further, as we know the source of the issue.
>
> Ok, this patch works for me; I've modified it with the ground-truth we
> have (thus there are likely other codecs to fix up later). Shérab, can
> you test from your end?
>
> Fix HDA beep frequency on IDT 92HD73xx and 92HD71Bxx codecs.
>
> Signed-off-by: Daniel J Blueman <[email protected]>

FWIW, I applied this now to sound git tree.


thanks,

Takashi


>
> diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
> index f1e7bab..b8d730c 100644
> --- a/sound/pci/hda/patch_sigmatel.c
> +++ b/sound/pci/hda/patch_sigmatel.c
> @@ -202,6 +202,7 @@ struct sigmatel_spec {
> unsigned int spdif_mute: 1;
> unsigned int check_volume_offset:1;
> unsigned int auto_mic:1;
> + unsigned int linear_tone_beep:1;
>
> /* gpio lines */
> unsigned int eapd_mask;
> @@ -3802,7 +3803,7 @@ static int stac92xx_parse_auto_config(struct
> hda_codec *codec, hda_nid_t dig_out
> return err;
> if (codec->beep) {
> /* IDT/STAC codecs have linear beep tone parameter */
> - codec->beep->linear_tone = 1;
> + codec->beep->linear_tone = spec->linear_tone_beep;
> /* if no beep switch is available, make its own one */
> caps = query_amp_caps(codec, nid, HDA_OUTPUT);
> if (!(caps & AC_AMPCAP_MUTE)) {
> @@ -5005,6 +5006,7 @@ static int patch_stac9200(struct hda_codec *codec)
>
> codec->no_trigger_sense = 1;
> codec->spec = spec;
> + spec->linear_tone_beep = 1;
> 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,
> @@ -5068,6 +5070,7 @@ static int patch_stac925x(struct hda_codec *codec)
>
> codec->no_trigger_sense = 1;
> codec->spec = spec;
> + spec->linear_tone_beep = 1;
> spec->num_pins = ARRAY_SIZE(stac925x_pin_nids);
> spec->pin_nids = stac925x_pin_nids;
>
> @@ -5153,6 +5156,7 @@ static int patch_stac92hd73xx(struct hda_codec *codec)
>
> codec->no_trigger_sense = 1;
> codec->spec = spec;
> + spec->linear_tone_beep = 0;
> codec->slave_dig_outs = stac92hd73xx_slave_dig_outs;
> spec->num_pins = ARRAY_SIZE(stac92hd73xx_pin_nids);
> spec->pin_nids = stac92hd73xx_pin_nids;
> @@ -5300,6 +5304,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
>
> codec->no_trigger_sense = 1;
> codec->spec = spec;
> + spec->linear_tone_beep = 1;
> codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs;
> spec->digbeep_nid = 0x21;
> spec->mux_nids = stac92hd83xxx_mux_nids;
> @@ -5522,6 +5527,7 @@ static int patch_stac92hd71bxx(struct hda_codec *codec)
>
> codec->no_trigger_sense = 1;
> codec->spec = spec;
> + spec->linear_tone_beep = 0;
> codec->patch_ops = stac92xx_patch_ops;
> spec->num_pins = STAC92HD71BXX_NUM_PINS;
> switch (codec->vendor_id) {
> @@ -5779,6 +5785,7 @@ static int patch_stac922x(struct hda_codec *codec)
>
> codec->no_trigger_sense = 1;
> codec->spec = spec;
> + spec->linear_tone_beep = 1;
> 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,
> @@ -5883,6 +5890,7 @@ static int patch_stac927x(struct hda_codec *codec)
>
> codec->no_trigger_sense = 1;
> codec->spec = spec;
> + spec->linear_tone_beep = 1;
> codec->slave_dig_outs = stac927x_slave_dig_outs;
> spec->num_pins = ARRAY_SIZE(stac927x_pin_nids);
> spec->pin_nids = stac927x_pin_nids;
> @@ -6018,6 +6026,7 @@ static int patch_stac9205(struct hda_codec *codec)
>
> codec->no_trigger_sense = 1;
> codec->spec = spec;
> + spec->linear_tone_beep = 1;
> 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,
> @@ -6174,6 +6183,7 @@ static int patch_stac9872(struct hda_codec *codec)
> return -ENOMEM;
> codec->no_trigger_sense = 1;
> codec->spec = spec;
> + spec->linear_tone_beep = 1;
> spec->num_pins = ARRAY_SIZE(stac9872_pin_nids);
> spec->pin_nids = stac9872_pin_nids;
>
> --
> Daniel J Blueman
>

2010-08-03 11:41:07

by Shérab

[permalink] [raw]
Subject: Re: PC Beeps not working with HDA Intel module

Hi again Daniel & all,

> Ok, this patch works for me; I've modified it with the ground-truth we
> have (thus there are likely other codecs to fix up later). Sh?rab, can
> you test from your end?

Yeah it works perfectly, thanks !

One other question: the PC Beep controller in Alsa can take only four
values: 0%, 33%, 66% and 100%. What I find strange is that even when
it's at 0%, there is a beep, whose volume seems a bit strong to me. It
becomes stronger and stronger with the other values, which is normal,
but 0% seems to be non-equivalent to muting the control, I'm wondering
whether this is normal.
I'm also a bit disapointed that this control can take only those values,
for I'd appreciate to have an even softer beep, between the current 0%
and nothing at all.
Any insight would be very appreciated.

Best wishes,
Sh?rab, so happy to have recovered his beloved console bell.

2010-08-03 11:42:36

by Shérab

[permalink] [raw]
Subject: Re: PC Beeps not working with HDA Intel module

Takashi Iwai (2010/08/03 12:59 +0200):
> FWIW, I applied this now to sound git tree.

Thanks so much Takashi !
Will be nice to have this integrated to the next kernel.
Sh?rab.