LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Microphone problems, arecord will not work (https://www.linuxquestions.org/questions/slackware-14/microphone-problems-arecord-will-not-work-4175560686/)

Miranden 12-04-2015 07:19 PM

Microphone problems, arecord will not work
 
Hi,

I am having an issue getting my microphone to work so that I can record sound. I have been trying to do a screencast, and no method I used (several ffmpeg variations, recordmydesktop) would give me working audio. Other audio playback works fine.

I tried to test the mic with arecord, and got an error. Here is some information:

Code:

bash-4.2# arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC269VB Analog [ALC269VB Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Code:

bash-4.2# arecord -d 10 test.wav
ALSA lib pcm_dmix.c:961:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
arecord: main:722: audio open error: Invalid argument

Code:

bash-4.2# cat /etc/asound.conf
    pcm.!default {
            type hw
            card 0
    }
    ctl.!default {
            type hw
            card 0
    }
    pcm.!default {
            type plug
            slave.pcm "softvol"
    }
    pcm.softvol {
            type softvol
            slave {
                    pcm "dmix"
            }
            control {
                    name "Pre-Amp"
                    card 0
            }
            min_dB -5.0
            max_dB 20.0
            resolution 6
    }

Code:

bash-4.2# lspci             
00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
00:04.0 Signal processing controller: Intel Corporation 3rd Gen Core Processor Thermal Subsystem (rev 09)
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)
00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4)
00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4)
00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)
00:1f.6 Signal processing controller: Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller (rev 04)
02:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24)

I googled the dmix error and got a few results, but I did not see anything I could decipher about my exact situation. I seem to be out of my depth with audio, as this is the first time I have dealt with such an issue. Help would be much appreciated.

Thank you in advance.

allend 12-05-2015 01:39 AM

A few things for you to try.
Run 'alsamixer' and check that the microphone is unmuted and that the microphone and capture levels are raised. (I start by pushing them all the way up, then backing off as appropriate.)
For recording, I find that I need to specify the plughw device.
Code:

arecord -d 5 -D plughw:0,0 foobar.wav
You may also want to try moving that /etc/asound.conf out of the way, then rebooting.

_peter 12-05-2015 08:30 AM

it should just work. I use it all the time like this
Code:

arecord -vv -f dat -t raw | oggenc - -q=10 -r -R48000 -o audio.ogg
As allend said, starts from a pristine /etc/asound.conf and adjust the capture levels with alsamixer. Within alsamixer press space bar to enable the capture channel.

Your capture device seems a bit different (PCH) than mine and the reference to the module snd_pcm_dmix_open in the error message is weird.

Code:

arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC272 Analog [ALC272 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 2: ALC272 Alt Analog [ALC272 Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0


Miranden 12-05-2015 08:08 PM

Thanks guys. I should have tried moving that asound.conf earlier. I did it, and that stopped the error, but I still am not able to record. The below gave me two 10 second files with no sound.

I tried playing both my test files with various media players with no success. I'm not sure it's related, but on a side note I discovered that vlc will not play audio at all. I'm using Alien's build and it has worked fine in the past.

Code:

bash-4.2$ arecord -vv -d 10 mytest.wav
Recording WAVE 'mytest.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
Plug PCM: Rate conversion PCM (48000, sformat=U8)
Converter: linear-interpolation
Protocol version: 10002
Its setup is:
  stream      : CAPTURE
  access      : RW_INTERLEAVED
  format      : U8
  subformat    : STD
  channels    : 1
  rate        : 8000
  exact rate  : 8000 (8000/1)
  msbits      : 8
  buffer_size  : 2730
  period_size  : 170
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 170
  period_event : 0
  start_threshold  : 1
  stop_threshold  : 2730
  silence_threshold: 0
  silence_size : 0
  boundary    : 768426686420090880
Slave: Route conversion PCM (sformat=S32_LE)
  Transformation table:
    0 <- 0
Its setup is:
  stream      : CAPTURE
  access      : MMAP_INTERLEAVED
  format      : U8
  subformat    : STD
  channels    : 1
  rate        : 48000
  exact rate  : 48000 (48000/1)
  msbits      : 8
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 6
  stop_threshold  : 16384
  silence_threshold: 0
  silence_size : 0
  boundary    : 4611686018427387904
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  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 6
  stop_threshold  : 16384
  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  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 6
  stop_threshold  : 16384
  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  : 16384
  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
#+                                                | 00%
bash-4.2$ aplay mytest.wav
Playing WAVE 'mytest.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
bash-4.2$
bash-4.2$
bash-4.2$ arecord -d 10 -D plughw:0,0 test2.wav
Recording WAVE 'test2.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
bash-4.2$ aplay test2.wav
Playing WAVE 'test2.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
bash-4.2$

I forgot to mention before that I am on a multilib 14.1 system.

Miranden 12-05-2015 08:10 PM

Oh, the relevant alsamixer levels are all at max too. The only thing is, many releases ago I added the asound.conf to enable pre-amp functionality because my laptop sound is too weak without it. However, even when I removed it, the pre-amp remained. In fact, as you can see, I have 2. I wonder why this is? Did alsamixer change defaults? But why 2 pre-amps? My asound.conf is renamed and moved to my home directory.

screenshot: http://postimg.org/image/cgxgf217j/

_peter 12-06-2015 03:33 AM

hi Miranden,
on your alsamixer snapshot from you last post the capture channel looks muted to me.
Go back to alsamixer, move to this channel and press space bar to unmute it.

Miranden 12-06-2015 04:58 AM

Oh, wow, you're right! I had no idea those little dashed lines by that control meant it was muted. I didn't even notice them. I guess you can tell I don't do much recording!

I feel like an idiot. But a happy one at least, since I can finally get this done. Thanks for the help!

Miranden 12-06-2015 05:10 AM

Alright, this is off topic, but I just have to admit, this is not the first time something like this has happened to me. I once had a TV that suddenly stopped making sound, so I took it apart and tried to figure out what the problem was. I had no success. Finally I called a friend (who happens to be an electrical engineer at SpaceX), and he set to the task. Neither of us had any clue what was wrong. After several hours, just as we were about to give up, we discovered, hidden on the back, a small push button toggle that said "speakers."

So it figures. Maybe this time I will learn my lesson!


All times are GMT -5. The time now is 08:26 PM.