You are not logged in.

#1 2012-04-10 22:55:31

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Make internal mic usable

I should admit I don't really feel I've got to grips at all with how sound works in Linux (or generally).

What I think I'm doing/have done:
- using ALSA (I tried PulseAudio but couldn't get it to work)
- unmuted channels etc. using alsamixer
- got ALSA to save sound settings and to restore on reboot using asound.state
- got sound from internal speakers to work OK for playback e.g. KDE plays sounds, Skype has audio, even music seems to work
- persuaded Skype not to mute sound or disable microphone
- got volume control and mute buttons on keyboard to work (OK - I didn't really have to do anything to get this to work, it just worked)
- got the internal microphone to record sound which I can then play back
--- this works with e.g.

arecord -d 5 /tmp/test.wav
aplay /tmp/test.wav

- got the internal microphone to record sound when using Skype and to send audio to person at other end of call

What I need to do and can't get to work:
- make microphone work properly
Whether I test with arecord/aplay or I speak to somebody via Skype, the result is unusable. Somebody at the other end of the line today said they could hear me - just about given the sound of the jet engine. Needless to say, there was no jet engine in my office at the time. The noisiest thing (apart from me) was my laptop's (relatively quiet) fan.

Reading the docs for hd-audio, I set Digital Capture Volume to exactly 50%. I also tried setting mic analog boost to 0. This makes both me and the jet engine much quieter but doesn't solve the basic problem of the jet engine.

Because I don't really understand how this stuff works, I tried setting Digital Capture Volume to 0. That gets rid of both the jet engine and me. I also tried setting the Capture to 0. Again, that pretty much got rid of both of us.

The wiki for Skype suggests some Skype specific things but I don't think this is a Skype issue because arecord/aplay has the same problem. For example https://wiki.archlinux.org/index.php/Sk … -bit_OS.29 sounds like a similar problem but (1) is Skype specific, and (2) seems to apply only to PulseAudio.

In configuring sound, I found the following (from /proc as explained in the wiki, I think, and certainly in the hd-audio docs):

       Codec: Conexant CX20590
       Codec: Intel CougarPoint HDMI

The docs for hd-audio don't list CX20590 and at the moment I'm letting ALSA figure things out for itself.

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: CONEXANT Analog [CONEXANT Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

In KDE, I get a really long list of devices though I suspect most of them are simply the same device over and over with slightly different names. Phonon is using the GStreamer backend. The VLC backend is also installed.

In the system settings panel for phonon and for recording, KDE lists two devices in this order (topmost preferred):
HDA Intel PCH (CONEXANT Analog)
   1. ALSA: x-phonon:CARD=0,DEV=0
   2. ALSA: plughw:CARD=0,DEV=0
HDA Intel PCH, CONEXANT Analog (Default Audio Device)
   1. ALSA: default:CARD=PCH
   2. ALSA: sysdefault:CARD=PCH

lspci:

00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)
        Subsystem: Lenovo Device 21ed
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 42
        Region 0: Memory at d1600000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: [50] Power Management version 2
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+
                Address: 00000000fee0f00c  Data: 41c1
        Capabilities: [70] Express (v1) Root Complex Integrated Endpoint, MSI 00
                DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
                        ExtTag- RBE- FLReset+
                DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                        RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
                        MaxPayload 128 bytes, MaxReadReq 128 bytes
                DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
                LnkCap: Port #0, Speed unknown, Width x0, ASPM unknown, Latency L0 <64ns, L1 <1us
                        ClockPM- Surprise- LLActRep- BwNot-
                LnkCtl: ASPM Disabled; Disabled- Retrain- CommClk-
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed unknown, Width x0, TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
        Capabilities: [100 v1] Virtual Channel
                Caps:   LPEVC=0 RefClk=100ns PATEntryBits=1
                Arb:    Fixed- WRR32- WRR64- WRR128-
                Ctrl:   ArbSelect=Fixed
                Status: InProgress-
                VC0:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
                        Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
                        Ctrl:   Enable+ ID=0 ArbSelect=Fixed TC/VC=01
                        Status: NegoPending- InProgress-
                VC1:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
                        Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
                        Ctrl:   Enable+ ID=1 ArbSelect=Fixed TC/VC=22
                        Status: NegoPending- InProgress-
        Capabilities: [130 v1] Root Complex Link
                Desc:   PortNumber=0f ComponentID=00 EltType=Config
                Link0:  Desc:   TargetPort=00 TargetComponent=00 AssocRCRB- LinkType=MemMapped LinkValid+
                        Addr:   00000000fed1c000
        Kernel driver in use: HDA Intel

Can anybody point me in a useful direction?

EDIT: changed title to try to make it more informative - I really badly need help with this!

Last edited by cfr (2012-04-12 14:25:01)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#2 2012-04-11 02:14:35

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Make internal mic usable

I finally found some hint about this although it seems to concern a different laptop and I'm not sure it is the same problem. The test command given didn't work on mine but an adapted version did:

arecord -vv -f S16_LE -c 2  /tmp/new.wav

This produces a recording which is significantly more bearable although by no means noise free. It also gives me this output:

Recording WAVE '/tmp/new.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Stereo
Plug PCM: Rate conversion PCM (48000, sformat=S32_LE)
Converter: libspeex (builtin)
Protocol version: 10002
Its setup is:
  stream       : CAPTURE
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 8000
  exact rate   : 8000 (8000/1)
  msbits       : 16
  buffer_size  : 1365
  period_size  : 170
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 170
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 1365
  silence_threshold: 0
  silence_size : 0
  boundary     : 768426686420090880
Slave: Soft volume PCM
Control: Digital Capture Volume
min_dB: -30
max_dB: 30
resolution: 121
Its setup is:
  stream       : CAPTURE
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 8192
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 6
  stop_threshold   : 8192
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
Slave: Direct Snoop PCM
Its setup is:
  stream       : CAPTURE
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 8192
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 6
  stop_threshold   : 8192
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
Hardware PCM card 0 'HDA Intel PCH' device 0 subdevice 0
Its setup is:
  stream       : CAPTURE
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 8192
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : ENABLE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 4611686018427387904
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
  appl_ptr     : 0
  hw_ptr       : 0
## +                                               | 04%

So I guess a few questions. I don't really know what this does but is there a way to improve the recording further? Regardless of the answer to that, is there a way of getting an application such as Skype to do something similar? I guess it doesn't use arecord in any straightforward way and I don't see anywhere obvious to configure options which might correspond to this.

I know I'm telling arecord to use 16bit Little Endian format and to use both channels of the capture device. (I tend to read man pages before running command of the net to at least check what I can. I wasn't sure about the bit which didn't work but it was meant to name a device and since this is a different machine, I'm not surprised if that didn't work right - although it didn't give an error which made that obvious...) But I don't see anything like that in Skype's configuration panels?

EDIT: I have a feeling that on mine, the original suggestion:

arecord -vv -f S16_LE -c 2 -D hw:0,0 new.wav

tried to use a different device than the microphone which didn't work very well.

EDIT: I realise that I forgot to include the following. I'm not sure if it is relevant since it is not exactly that my sound doesn't work - just a bit of it doesn't work right. But in any case:

$ lsmod | grep snd
snd_hda_codec_hdmi     22092  1 
snd_hda_codec_conexant    46694  1 
snd_hda_intel          22122  2 
snd_hda_codec          79309  3 snd_hda_intel,snd_hda_codec_conexant,snd_hda_codec_hdmi
snd_hwdep               6357  1 snd_hda_codec
snd_pcm                74496  3 snd_hda_codec,snd_hda_intel,snd_hda_codec_hdmi
snd_page_alloc          7185  2 snd_pcm,snd_hda_intel
snd_timer              19544  1 snd_pcm
snd                    58362  12 thinkpad_acpi,snd_timer,snd_pcm,snd_hwdep,snd_hda_codec,snd_hda_intel,snd_hda_codec_conexant,snd_hda_codec_hdmi
soundcore               6210  1 snd

$ ls -l /dev/snd/
total 0
drwxr-xr-x  2 root root       80 Apr 10 14:21 by-path/
crw-rw----+ 1 root audio 116,  7 Apr 10 14:21 controlC0
crw-rw----+ 1 root audio 116,  8 Apr 10 14:21 controlC29
crw-rw----+ 1 root audio 116,  6 Apr 10 14:21 hwC0D0
crw-rw----+ 1 root audio 116,  5 Apr 10 14:21 hwC0D3
crw-rw----+ 1 root audio 116,  4 Apr 11 03:04 pcmC0D0c
crw-rw----+ 1 root audio 116,  3 Apr 11 03:05 pcmC0D0p
crw-rw----+ 1 root audio 116,  2 Apr 10 14:21 pcmC0D3p
crw-rw----  1 root audio 116,  1 Apr 10 14:21 seq
crw-rw----+ 1 root audio 116, 33 Apr 10 14:21 timer

I notice I've got some "hw..." and the by-path/ entry whereas the wiki does not. Not sure what that means, though...

Last edited by cfr (2012-04-11 02:27:26)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2012-04-11 16:02:18

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Make internal mic usable

So I found this thread: https://bbs.archlinux.org/viewtopic.php?id=125803. That seems to describe a similar problem? Maybe? But I'm not sure if I can use the solution or how to do so given that I'm not (I think) using PulseAudio? Is there an equivalent way of configuring ALSA?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#4 2012-04-12 00:37:30

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Make internal mic usable

I take back the claim about it being more bearable - I think it is just that I managed to make everything quieter but if I make me louder, the jet engine is just as noisy.

So I'm just as stuck...


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2012-04-12 23:02:40

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Make internal mic usable

So I found https://bbs.archlinux.org/viewtopic.php?id=65244 which suggests running alsaconf to create /etc/modprobe.d/sound.conf. I don't have a /etc/modprobe.d/sound.conf so I thought maybe I should try this. However, I don't seem to have alsaconf.

I looked at /var/abs/extra/alsa-utils/ thinking maybe alsaconf doesn't exist any more. However, there's still a patch file there for alsaconf which suggests it should. However the file list for the pacman package doesn't list it so it obviously isn't part of alsa-utils as packaged.

Is there some alternative command I could use? Or am I meant to install something else in addition to alsa-utils to get alsaconf?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#6 2012-09-10 07:16:34

dw
Member
From: Vienna, Austria
Registered: 2006-11-25
Posts: 160

Re: Make internal mic usable

hi cfr, i am experiencing exactly the same issues as you do.

i am very interested to know if did you manage to solve this problem?

Offline

#7 2012-09-10 22:53:07

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Make internal mic usable

@dw,
Thank you very much for responding. I'm afraid I have still not managed to solve this problem and I kind of ran out of ideas when nobody had anything to suggest. I am still definitely interested in solving it if anybody can suggest a possibly fruitful diagnostic avenue to explore.

Do you have similar hardware to mine? I'm sure this should be solvable as the microphone is supposed to work pretty well (for a built in mic) on this machine but I'm damned if I've been able to figure it out to date...


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#8 2012-11-11 10:37:18

robotrobert
Member
Registered: 2011-10-29
Posts: 16

Re: Make internal mic usable

@cfr Any solutions yet?

Last edited by robotrobert (2012-11-11 11:17:53)

Offline

#9 2012-11-11 11:28:05

burninggramma
Member
Registered: 2012-11-11
Posts: 8

Re: Make internal mic usable

@cfr

I did had the same exact issue and I am on a x120e ( love dat machine btw ). I solved it in a workaround and TBH I am not sure that when a new ALSA version comes out will I need to do it again, but it worked for me, so let me summarize:

Basically I could not configure my device trough ALSA and alsamixer enough because ( for my knowledge ) it does not give an interface to configure /var/lib/alsa/asound.state entries, but only some of the values of these entries. First of all make a safe copy from this file, if something goes wrong you can copy it back.

I do have a fedora distro on my machine and because its configuring you much things my microphone was doing fine there. So I went ahead and grabbed all of the
entries ( control.<int> ) which had to do anything with "Mic":

egrep Mic /var/lib/alsa/asound.state

Then I copied into same file under my arch distro, but very important that I removed all the "Mic" entries from the original and I fixed the control.<int> numbering to match the new order and numbers.

If you haven't got other distros on your machine you can make a bootable image on a pendrive I think if you succesfully installed an arch on x121e you know the thunder [:
The point is to load a linux which using ALSA ( in my case it was fedora ) in a way that your mic works perfectly and get the config from there. I know it is not an elegant solution but I DO wanted to make it work, let me know if anybody have a more elegant solution or any comment on my thinking.

Let me know what happend!

Offline

#10 2012-11-11 16:40:01

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Make internal mic usable

@robotrobert,

No progress, I'm afraid, but burninggramma's approach sounds like a possibility. (Thanks, burninggramma!)

It does seem like it shouldn't be necessary but given the length of time this thread has existed and given the complete lack of other suggestions, it seems that it might be the only practical way to get this working in Arch. I'm slightly surprised it worked because I think Fedora uses pulseaudio. It would be interesting to know if burninggramma is using pulseaudio in Arch.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#11 2012-11-11 17:31:33

burninggramma
Member
Registered: 2012-11-11
Posts: 8

Re: Make internal mic usable

cfr wrote:

@robotrobert,

No progress, I'm afraid, but burninggramma's approach sounds like a possibility. (Thanks, burninggramma!)

It does seem like it shouldn't be necessary but given the length of time this thread has existed and given the complete lack of other suggestions, it seems that it might be the only practical way to get this working in Arch. I'm slightly surprised it worked because I think Fedora uses pulseaudio. It would be interesting to know if burninggramma is using pulseaudio in Arch.

Nah, just pure ALSA+Alsamixer on Arch. Anyways PulseAudio is one layer over alsa, here is a good illustration which I really like.

Last edited by burninggramma (2012-11-11 17:32:06)

Offline

Board footer

Powered by FluxBB