LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-31-2015, 03:38 AM   #1
*Dark Dragon*
Member
 
Registered: Apr 2005
Distribution: Debian Testing + KDE
Posts: 53

Rep: Reputation: 17
Question Chrome refuses to use my mic for Google online voice recognition (asoundrc issue)


My problem is that default microphone works perfectly for everything except for Google voice recognition. When trying to use microphone at google.com (so I can enter search query without typing) I get this error: "Please check your microphone". I get similar error at dictation.io (I of course double checked that I have allowed microphone use). If I remove my ~/.asoundrc, stop JACK and restart Chrome, then online voice recognition works. But I cannot figure out what I need to change in my ~/.asoundrc (I have many good reasons why I need to use JACK all the time).

I tried to record my voice online at http://applove.in/online-voice-recorder/ and it worked as expected (with JACK and my ~/.asoundrc). So, Google Chrome definitely can access my "Default" microphone. This is what puzzles me the most: if something is wrong with my ~/.asoundrc, how come I can use my microphone for everything without issues except for online voice recognition? I use Google Chrome 32.0.1678.0.

Does somebody have an idea what else could I try or what could be wrong?
Attached Files
File Type: txt asoundrc.txt (1.2 KB, 75 views)
 
Old 07-31-2015, 03:32 PM   #2
*Dark Dragon*
Member
 
Registered: Apr 2005
Distribution: Debian Testing + KDE
Posts: 53

Original Poster
Rep: Reputation: 17
If I run Chrome from command-line, it prints some errors, which are usually harmless, so I did not pay any attention to them at first. However, when I tried to search for "Not implemented reached in virtual std::string media::AudioManagerBase::GetDefaultOutputDeviceID()" I have found this: https://github.com/atom/electron/issues/271 (the reason why I ignored this error at first is because it is printed even if I use ALSA directly without custom asoundrc and JACK). In there somebody says "there are quite a lot of the people who fixed that by tweaking ALSA settings. In general you should create default ALSA device or install pulseaudio".

In my asoundrc I have:
Code:
pcm.!default {
  type plug
  slave.pcm "aloopDuplex" }
But for some reason this is not enough for Chrome. I also tried to create non-default ALSA device by specifying something else instead of "!default", but then I can see it in aplay -L but not in Chrome.

Currently I think this is what happening: when I record my voice online at http://applove.in/online-voice-recorder/, Chrome uses Default sound device linked to pcm.!default (as expected). But when I try voice recognition, for some reason Chrome links Default device to something else (hw:0,0 maybe) and that of course fails. Perhaps this is what the error "Not implemented ... GetDefaultOutputDeviceID" means - that Chrome sometimes uses hardcoded "Default" ignoring pcm.!default? Also, "online-voice-recorder" fails too if I choose anything but "Default", including "Loopback PCM Default Audio Device".

If Chrome generally requires microphone to be hw:0,0 for "Default" device, is it possible to remap somehow my real card (hw:0) and loopback device (hw:1) so that loopback device would be hw:0? Alternatively, is it possible to create non-default ALSA device which would be visible in Chrome (not just aplay -L)? Perhaps somebody can suggest something I could try?
 
Old 07-31-2015, 11:54 PM   #3
*Dark Dragon*
Member
 
Registered: Apr 2005
Distribution: Debian Testing + KDE
Posts: 53

Original Poster
Rep: Reputation: 17
I have tried upgrading Chrome to 44.0.2403.125, but this did not change anything at all except in terminal output I see no errors. I still can record my voice online but cannot use voice recognition. It seems Chrome still tries to use wrong device (ignoring what defined as pcm.!default) when I attempt to use it, and I do not how to create non-default ALSA device it can see. This is what I have tried:
Code:
pcm.new_audio_device {
  type plug
  hint.description "New Audio Device"
  slave.pcm "aloopDuplex" }
But even after restart Chrome does not see it. But I can see it with aplay -L and I can record with it using "arecord -f dat -D new_audio_device > /tmp/test.wav" command.

Some of listed devices in chrome are silent (with them I get error like "No speech was detected. Please try again" instead of "Please ensure that a microphone is connected to your computer" at dictation.io), so if I could specify ALSA device with my microphone it probably would work. I just cannot figure out how to add more ALSA devices to Chrome (or how to force it use real default device in all cases).

Are there somebody here who uses Chrome with manually created non-default ALSA device or who have some ideas what else to try? I would appreciate any suggestions...

Last edited by *Dark Dragon*; 08-01-2015 at 12:01 AM.
 
Old 08-05-2015, 12:30 PM   #4
*Dark Dragon*
Member
 
Registered: Apr 2005
Distribution: Debian Testing + KDE
Posts: 53

Original Poster
Rep: Reputation: 17
I ended up installing PulseAudio. As suggested in here, I have installed pusleaudio-jack module (sudo apt-get install pulseaudio-module-jack) and then in Claudia (from KXStudio) I have connected PulseAudio Sink and Source modules instead of alsa_in and alsa_out. Also, in pavucontrol I can choose if necessary which device to use as my microphone in Chrome (or Chromium). In my ~/.asoundrc I have the following:
Code:
pcm.pulse {
  type pulse }
ctl.pulse {
  type pulse }

pcm.!default {
  type pulse }
ctl.!default {
  type pulse }
P.S. My impression so far that almost nobody uses ALSA directly these days. I guess this is why ALSA support was dropped in Skype and is half-broken in both Chrome and Chromium. In the past PulseAudio was horrible (few years ago), this is why I have not considered trying it again at first. I guess things have changed since then, because so far PusleAudio seems to work with JACK without issues for me.

Last edited by *Dark Dragon*; 08-05-2015 at 12:34 PM.
 
Old 08-05-2015, 12:46 PM   #5
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
Alsa is used natively, although things like java are setup to use pulseaudio by default. I would imagine that chrome expects S16_LE, not your S32_LE in your .asoundrc. When there is no .asoundrc it defaults to the soundcard indexed to 0. Pulse over jack is how I roll most times. But I also have autospawn = no for pulse so I can stop it and use other setups. If you want to use alsa natively that's an option plus a minimal .asoundrc to set the default index number.

.asoundrc
Code:
defaults.pcm.card 1
If you want to use the NOT 0 cards microphone. But without pulse, most if not all browsers don't play well with jack.
 
1 members found this post helpful.
  


Reply

Tags
alsa, asoundrc, chrome, jack



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Speech recognition hack turns Google Chrome into advanced bugging device LXer Syndicated Linux News 0 01-23-2014 11:41 AM
Issue installing Google Hangouts plugin in Chrome SimonPalmieri Slackware 2 12-11-2013 01:49 AM
Google Chrome refuses to use CM106 Like Sound Device __spc__ Linux - Laptop and Netbook 0 09-15-2013 03:18 AM
Linux Voice Recognition that really works with your usb mic:) !!! :) patrick295767 General 11 09-22-2012 10:44 AM
voice recognition georgekjolly Programming 2 10-25-2005 02:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration