Pavel Roskin | 1 Aug 2011 05:39
Picon

EeePC 1005PE microphone is "stereo only", silent in mono

Hello!

I have discovered that the microphone on my ASUS EeePC 1005PE only  
works in stereo.  If recording in mono, the result is inaudible.  When  
I open the stereo recording in audacity, I see that the two channels  
are in counterphase.  If I convert stereo to mono in audacity, I get a  
straight line, and it's inaudible when played.

The driver itself requires stereo recording:

$ arecord --rate 44100 -D hw:0 -f S16_LE --channels 1 >test.wav
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
arecord: set_params:1065: Channels count non available

However, pulse audio doesn't enforce it.  So it's possible to record a  
mono file through pulse audio, and it's inaudible.  Some programs  
simply assume a mono microphone and thus get no sound.

I can work it around by setting the level on one of the channels to  
100% and to 0% on the other in alsamixer.  However, the GNOME volume  
manager removes that imbalance when adjusting the input level.  I  
would prefer to have a robust solution.  Perhaps one of the channels  
should be inverted.  Or maybe the difference between the channels  
should be reported as mono input.  I don't really care about stereo  
input.

I'm using Linux 3.0 on Fedora 15.  I checked out and tested the master  
branch of sound-2.6.git, and it has the same problem.

It looks like the problem is known.  I found this comment in alc882_quirks.c:
(Continue reading)

Mark Brown | 1 Aug 2011 07:12
Favicon
Gravatar

[PATCH 2/2] ASoC: Support separate left and right channel dcs_codes values

Some devices can have performance optimized by setting different offsets
for left and right channels.

Signed-off-by: Mark Brown <broonie <at> opensource.wolfsonmicro.com>
---
 sound/soc/codecs/wm8993.c  |    3 ++-
 sound/soc/codecs/wm8994.c  |    3 ++-
 sound/soc/codecs/wm_hubs.c |   13 +++++++------
 sound/soc/codecs/wm_hubs.h |    3 ++-
 4 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/sound/soc/codecs/wm8993.c b/sound/soc/codecs/wm8993.c
index 19fc081..eec8e14 100644
--- a/sound/soc/codecs/wm8993.c
+++ b/sound/soc/codecs/wm8993.c
 <at>  <at>  -1437,7 +1437,8  <at>  <at>  static int wm8993_probe(struct snd_soc_codec *codec)
 	int ret, i, val;

 	wm8993->hubs_data.hp_startup_mode = 1;
-	wm8993->hubs_data.dcs_codes = -2;
+	wm8993->hubs_data.dcs_codes_l = -2;
+	wm8993->hubs_data.dcs_codes_r = -2;
 	wm8993->hubs_data.series_startup = 1;

 	ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_I2C);
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index e1e9aca..d3c4f80 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
 <at>  <at>  -2960,7 +2960,8  <at>  <at>  static int wm8994_codec_probe(struct snd_soc_codec *codec)
(Continue reading)

Mark Brown | 1 Aug 2011 07:12
Favicon
Gravatar

[PATCH 1/2] ASoC: Implement new DC servo readback mode for late WM8994 revisions

Later WM8994 devices implement a new DC servo readback mode with the
register used to access the offset moved to register 0x59. Implement
support for this and enable it on the appropriate devices.

Signed-off-by: Mark Brown <broonie <at> opensource.wolfsonmicro.com>
---
 include/linux/mfd/wm8994/registers.h |    1 +
 sound/soc/codecs/wm8994.c            |    3 ++-
 sound/soc/codecs/wm_hubs.c           |   19 +++++++++++++++----
 3 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/include/linux/mfd/wm8994/registers.h b/include/linux/mfd/wm8994/registers.h
index f3ee842..6152914 100644
--- a/include/linux/mfd/wm8994/registers.h
+++ b/include/linux/mfd/wm8994/registers.h
 <at>  <at>  -72,6 +72,7  <at>  <at> 
 #define WM8994_DC_SERVO_2                       0x55
 #define WM8994_DC_SERVO_4                       0x57
 #define WM8994_DC_SERVO_READBACK                0x58
+#define WM8994_DC_SERVO_4E			0x59
 #define WM8994_ANALOGUE_HP_1                    0x60
 #define WM8958_MIC_DETECT_1                     0xD0
 #define WM8958_MIC_DETECT_2                     0xD1
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index cc8222c..e1e9aca 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
 <at>  <at>  -107,6 +107,7  <at>  <at>  static int wm8994_volatile(struct snd_soc_codec *codec, unsigned int reg)
 	case WM8994_LDO_2:
 	case WM8958_DSP2_EXECCONTROL:
(Continue reading)

Mark Brown | 1 Aug 2011 06:53
Favicon
Gravatar

[PATCH] ASoC: Trivial formatting fix in soc-core.c

Utterly trivial but it annoys me.

Signed-off-by: Mark Brown <broonie <at> opensource.wolfsonmicro.com>
---
 sound/soc/soc-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 83ad8ca..e2ce248 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
 <at>  <at>  -105,7 +105,7  <at>  <at>  static int format_register_str(struct snd_soc_codec *codec,
 	if (wordsize + regsize + 2 + 1 != len)
 		return -EINVAL;

-	ret = snd_soc_read(codec , reg);
+	ret = snd_soc_read(codec, reg);
 	if (ret < 0) {
 		memset(regbuf, 'X', regsize);
 		regbuf[regsize] = '\0';
--

-- 
1.7.5.4

Takashi Iwai | 1 Aug 2011 10:50
Picon

Re: EeePC 1005PE microphone is "stereo only", silent in mono

At Sun, 31 Jul 2011 23:39:45 -0400,
Pavel Roskin wrote:
> 
> Hello!
> 
> I have discovered that the microphone on my ASUS EeePC 1005PE only  
> works in stereo.  If recording in mono, the result is inaudible.  When  
> I open the stereo recording in audacity, I see that the two channels  
> are in counterphase.  If I convert stereo to mono in audacity, I get a  
> straight line, and it's inaudible when played.
> 
> The driver itself requires stereo recording:
> 
> $ arecord --rate 44100 -D hw:0 -f S16_LE --channels 1 >test.wav
> Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
> arecord: set_params:1065: Channels count non available
> 
> However, pulse audio doesn't enforce it.  So it's possible to record a  
> mono file through pulse audio, and it's inaudible.  Some programs  
> simply assume a mono microphone and thus get no sound.
> 
> I can work it around by setting the level on one of the channels to  
> 100% and to 0% on the other in alsamixer.  However, the GNOME volume  
> manager removes that imbalance when adjusting the input level.  I  
> would prefer to have a robust solution.  Perhaps one of the channels  
> should be inverted.  Or maybe the difference between the channels  
> should be reported as mono input.  I don't really care about stereo  
> input.
> 
> I'm using Linux 3.0 on Fedora 15.  I checked out and tested the master  
(Continue reading)

Takashi Iwai | 1 Aug 2011 11:04
Picon

Re: [PATCH] Sound: AudioScience HPI: Don't leak firmware if mem alloc fails

At Sun, 31 Jul 2011 23:16:43 +0200 (CEST),
Jesper Juhl wrote:
> 
> On Fri, 29 Jul 2011, Jesper Juhl wrote:
> 
> > On Fri, 29 Jul 2011, Takashi Iwai wrote:
> > 
> > > At Thu, 28 Jul 2011 21:48:27 +0200 (CEST),
> > > Jesper Juhl wrote:
> > > > 
> > > > We leak the memory allocated to 'firmware' when we fail to
> > > > release_firmware() after a kmalloc() failure in hpi_dsp_code_open().
> > > > This patch should take care of the leak.
> > > > 
> > > > Signed-off-by: Jesper Juhl <jj <at> chaosbits.net>
> > > > ---
> > > >  sound/pci/asihpi/hpidspcd.c |    4 +++-
> > > >  1 files changed, 3 insertions(+), 1 deletions(-)
> > > > 
> > > > 	Build tested only.
> > > > 
> > > > diff --git a/sound/pci/asihpi/hpidspcd.c b/sound/pci/asihpi/hpidspcd.c
> > > > index 3a7afa3..8d261ef 100644
> > > > --- a/sound/pci/asihpi/hpidspcd.c
> > > > +++ b/sound/pci/asihpi/hpidspcd.c
> > > >  <at>  <at>  -85,8 +85,10  <at>  <at>  short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code,
> > > >  
> > > >  	HPI_DEBUG_LOG(DEBUG, "dsp code %s opened\n", fw_name);
> > > >  	dsp_code->pvt = kmalloc(sizeof(*dsp_code->pvt), GFP_KERNEL);
> > > > -	if (!dsp_code->pvt)
(Continue reading)

Clemens Ladisch | 1 Aug 2011 11:28
Picon
Gravatar

Re: Copy ALSA buffer to the buffer allocated in my driver.

`/ET!-i1S!-i wrote:
> 1. I guess pulse audio inturn calls Alsa and  i want to write a Alsa driver.

But the sound cards on the networked PCs already have drivers.

> The problem i am facing is receiving Alsa buffer to my buffer

Your driver's buffer _is_ the ALSA buffer.

> and updating the buffer position to middle layer.

The hardware position is returned by the pointer callback.
The software position should be of no concern to the driver.

> 2. Is it substream->runtime->dma_area or substream->dma_buffer.area holds
> the audio data? What is the difference between them?

These fields are controlled by your driver, although typically they are
set by ALSA helper functions.

substream->dma_buffer is the preallocated buffer; if your driver doesn't
do preallocation, it is not set.  The actual buffer, if it exists and is
accessible by the CPU from kernel space, is in substream->runtime->dma_area.

Regards,
Clemens
K900 | 1 Aug 2011 11:30
Picon
Gravatar

Some more on MSI GX740 and HDA Intel (bug 5321)

Sorry for disappearing last time, I've been quite busy at the time.
But I managed to find a bit more on my laptop's sound card and how to
make it work. I've found two nodes that actually produce (some) sound
when connected to a mixer. 0x1b pin complex is connected to front
speakers and 0x16 to the center/LFE thingy. However, I can only get
sound from them when I connect them to 0x0c and 0x0e mixers, that both
(why?) output the sound from front channels. So, there's no mixer that
outputs rear or LFE channels. To be honest, I don't understand
anything further than this, so can someone please help me :) I'll try
to be around on IRC most of the time. Also, my JID is k900 <at> neko.im.

// Note: it seems my last mail was lost somewhere. Correct me if I'm wrong.
Dong Aisheng | 1 Aug 2011 13:38
Favicon

[PATCH 1/1] ASoC: core: cache index fix

For codecs whose reg_cache_step is not 1, the original cache io
code may fetch a wrong value since it does not check the
reg_cache_step and remainly use the reg as index to fetch value
from cache.

This patch provides help functions for conversion between cache index
and register index and the cache io functions will use them in right
place to ensure to fetch a correct register value.

Signed-off-by: Dong Aisheng <b29396 <at> freescale.com>
Cc: Mark Brown <broonie <at> opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg <at> ti.com>
Cc: Sascha Hauer <s.hauer <at> pengutronix.de>
Cc: Wolfram Sang <w.sang <at> pengutronix.de>
---
 include/sound/soc.h   |    4 ++
 sound/soc/soc-cache.c |  117 +++++++++++++++++++++++++++++++++++++------------
 sound/soc/soc-core.c  |   15 +++---
 sound/soc/soc-io.c    |   10 +++-
 4 files changed, 107 insertions(+), 39 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index aa19f5a..b70789d 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
 <at>  <at>  -306,6 +306,10  <at>  <at>  int snd_soc_cache_write(struct snd_soc_codec *codec,
 			unsigned int reg, unsigned int value);
 int snd_soc_cache_read(struct snd_soc_codec *codec,
 		       unsigned int reg, unsigned int *value);
+int snd_soc_cache_reg_to_idx(struct snd_soc_codec *codec,
(Continue reading)

Dong Aisheng | 1 Aug 2011 13:41
Favicon

[PATCH 1/1] ASoC: sgtl5000: add one missed cache reg

Signed-off-by: Dong Aisheng <b29396 <at> freescale.com>
Signed-off-by: Zeng Zhaoming <zhaoming.zeng <at> freescale.com>
Cc: Mark Brown <broonie <at> opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg <at> ti.com>
Cc: Sascha Hauer <s.hauer <at> pengutronix.de>
---
 sound/soc/codecs/sgtl5000.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index 76258f2..5a0d8e4 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
 <at>  <at>  -49,6 +49,7  <at>  <at>  static const u16 sgtl5000_regs[SGTL5000_MAX_REG_OFFSET >> 1] =  {
 	0x0000, /* 0x0016, reserved */
 	0x0000, /* 0x0018, reserved */
 	0x0000, /* 0x001A, reserved */
+	0x0000, /* 0x001C, reserved */
 	0x0000, /* 0x001E, reserved */
 	0x0000, /* 0x0020, CHIP_ANA_ADC_CTRL */
 	0x1818, /* 0x0022, CHIP_ANA_HP_CTRL */
--

-- 
1.7.0.4


Gmane