User avatar
jbeale
Posts: 3471
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

USB mic fails in 4.4.50 (NOW FIXED in 4.9.24)

Wed Apr 26, 2017 2:49 am

***UPDATE*** this is now fixed (but only for newer model RPi hardware), see below thread.

I found that a PS3 Eye Camera (usb webcam with mic) worked OK yesterday when I was using a 2016 build of Raspbian. Today I reinstalled with the current (2017) Rasbian Lite and it no longer works, arecord simply hangs. dmesg reports the same as it always did, and there is no error message. I'm using the same (old) RPi hardware, it's a board with 1 ethernet and 2 USB ports.

Code: Select all

Working: Linux rp4 4.4.13+ #894 Mon Jun 13 12:43:26 BST 2016 armv6l GNU/Linux
Not Working: Linux raspberrypi 4.4.50+ #970 Mon Feb 20 19:12:50 GMT 2017 armv6l GNU/Linux

[email protected]:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: CameraB409241 [USB Camera-B4.09.24.1], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
See also: viewtopic.php?f=45&t=171631&p=1153304#p1153304

EDIT: Confirmed. I downloaded yet another image, this one from 2016:
http://downloads.raspberrypi.org/raspbi ... 016-09-28/ 2016-09-23-raspbian-jessie.zip

and tried it again. Now arecord works once more, with no problem. In this case uname -a reports 4.4.21+ #911 Thu Sep 15 14:17:52 St 2016
so some change between then and now, seems to have killed this particular USB audio device. As there is no error message, I don't know how to troubleshoot this.
Last edited by jbeale on Sat Apr 29, 2017 10:04 pm, edited 2 times in total.

User avatar
DougieLawson
Posts: 35594
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: USB mic fails in 4.4.50 (was OK in 4.4.13 & 4.4.21)

Thu Apr 27, 2017 11:28 am

Three options
  1. sudo rpi-update (which will get you to the 4.9.24 kernel) see if that works. The next update to the stable kernel is likely to take it forwards to the 4.9.?? versions.
  2. Or try sudo apt-get update && sudo apt-get dist-upgrade which will include the 4.4.50 kernel.

    That will also install & log (in /var/log/apt/history.log /var/log/apt/term.log) all the packages that have changed between September and April.

    Then you can start by winding the kernel back to Sept 15, then forward one step at a time until you find the kernel update that shoots your USB device dead. You do that by picking up the commit ids from https://github.com/Hexxeh/rpi-firmware/commits/master and using sudo rpi-update f3ea581387825d5693bff075f800c00fe825c106; sudo reboot

    It'll be a long slow process to find the kernel update that breaks things. Once you find it open an issue at https://github.com/raspberrypi/firmware or https://github.com/raspberrypi/kernel depending whether it's the kernel or the bootcode that kills it (if in doubt open the issue against the kernel).

    This has the benefit that you'll know how far you can roll the kernel forwards and have a system that works. You'll know exactly which update contains the bug.
  3. The alternative is to open the issue now at https://github.com/raspberrypi/kernel and the RPF folks will work with you to find the bug or code regression and fix it for you. (That process works really well if you're prepared to download strange files from Google docs and reboot your Raspberry with it - I've been doing that this week for https://github.com/raspberrypi/firmware/issues/661.) It, probably, won't happen until Tuesday 2nd as there's a public holiday in the UK this weekend & Monday.
Option #2 will hit the nail on the head, but could take a very long time.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
Gavinmc42
Posts: 3474
Joined: Wed Aug 28, 2013 3:31 am

Re: USB mic fails in 4.4.50 (was OK in 4.4.13 & 4.4.21)

Thu Apr 27, 2017 1:04 pm

Interesting, on Mint with kernel 4.4.0 Audacity I could get the 4 channels from the eyecam.
Upgraded to latest 4.10.13 kernel, Audacity knows there is an eyecam but no I get audio.
Most of my Pi's run 4.9.+

unplug, replugging and dmesg gives this

[[ 30.237649] usbcore: registered new interface driver ov534
[ 30.253169] usb 1-6: current rate 2399016 is different from the runtime rate 16000
[ 30.255973] usb 1-6: 3:1: cannot get min/max values for control 2 (id 3)
[ 30.256918] usbcore: registered new interface driver snd-usb-audio
[ 30.503191] r8169 0000:02:01.0 enp2s1: link up
[ 30.503203] IPv6: ADDRCONF(NETDEV_CHANGE): enp2s1: link becomes ready
[ 34.552421] usb 1-6: current rate 34394 is different from the runtime rate 16000
[ 34.555043] usb 1-6: 3:1: cannot get min/max values for control 2 (id 3)
[ 34.560170] usb 1-6: current rate 62 is different from the runtime rate 16000
[ 34.562669] usb 1-6: 3:1: cannot get min/max values for control 2 (id 3)
[ 38.931549] random: crng init done
[ 317.890916] usb 1-6: current rate 2266646 is different from the runtime rate 16000
[ 419.237334] usb 1-6: current rate 810771 is different from the runtime rate 16000
[ 419.331459] usb 1-6: current rate 33186 is different from the runtime rate 16000
[ 419.334580] usb 1-6: current rate 778 is different from the runtime rate 16000
[ 419.338331] usb 1-6: current rate 30 is different from the runtime rate 16000
[ 421.271085] usb 1-6: current rate 15462 is different from the runtime rate 16000
[ 421.293208] usb 1-6: current rate 177 is different from the runtime rate 16000
[ 441.576090] usb 1-6: current rate 162263 is different from the runtime rate 16000
[ 443.006969] usb 1-6: current rate 11447 is different from the runtime rate 16000
[ 443.011716] usb 1-6: current rate 38 is different from the runtime rate 16000
[ 463.816977] usb 1-6: current rate 166442 is different from the runtime rate 16000
[ 467.614603] usb 1-6: current rate 30381 is different from the runtime rate 16000
[ 467.619852] usb 1-6: current rate 42 is different from the runtime rate 16000
[ 484.501986] usb 1-6: current rate 135057 is different from the runtime rate 16000
[ 515.286671] perf: interrupt took too long (2504 > 2500), lowering kernel.perf_event_max_sample_rate to 79750
[ 754.526348] usb 1-6: current rate 2160194 is different from the runtime rate 16000
[ 767.398604] usb 1-6: current rate 102978 is different from the runtime rate 16000
[ 788.505238] usb 1-6: current rate 168835 is different from the runtime rate 16000
[ 805.046620] usb 1-6: current rate 132331 is different from the runtime rate 16000
[ 881.506108] perf: interrupt took too long (3144 > 3130), lowering kernel.perf_event_max_sample_rate to 63500
[ 1275.848230] usb 1-6: USB disconnect, device number 4
[ 1285.900010] usb 1-5: new high-speed USB device number 5 using ehci-pci
[ 1286.050499] usb 1-5: New USB device found, idVendor=1415, idProduct=2000
[ 1286.050501] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1286.050503] usb 1-5: Product: USB Camera-B4.09.24.1
[ 1286.050505] usb 1-5: Manufacturer: OmniVision Technologies, Inc.
[ 1286.051832] gspca_main: ov534-2.14.0 probing 1415:2000
[ 1288.025126] usb 1-5: current rate 16995 is different from the runtime rate 16000
[ 1288.027747] usb 1-5: 3:1: cannot get min/max values for control 2 (id 3)
[ 1288.078251] usb 1-5: current rate 425 is different from the runtime rate 16000
[ 1288.080998] usb 1-5: 3:1: cannot get min/max values for control 2 (id 3)
[ 1288.085624] usb 1-5: current rate 59 is different from the runtime rate 16000
[ 1288.088232] usb 1-5: 3:1: cannot get min/max values for control 2 (id 3)
[ 1288.096500] retire_capture_urb: 30 callbacks suppressed

Could it be a kernel driver issue? But only the audio, Cheese worked on both kernels.
Never did get around to writing a sound detector using the Eyecam.

cat /proc/asound/cards finds the eyecam

Pulseaudio not Alsa any more?
Normally this would give me a file
arecord -f S16_LE -r 16000 -D hw:2,0 -d 5 testS16_LE.wav
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
jbeale
Posts: 3471
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: USB mic fails in 4.4.50 (was OK in 4.4.13 & 4.4.21)

Thu Apr 27, 2017 4:27 pm

PS3 Eye mic does work in Intel Ubuntu system w/ 4.4.0-1012-gke and Audacity can record all 4 audio channels.
PS3 Eye mic initially did not work in an Intel Ubuntu system w/ 4.8.0-49, although it appears in the arecord -l list
and I later did get Audacity to work with it. I changed defaults.ctl.card, defaults.pcm.card, defaults.pcm.device in /usr/share/alsa/alsa.conf but not sure if that was related.
I did NOT get arecord to work with PS3 Eye under kernel 4.8.0.

Here is Audacity recording four channels from PS3 Eye using Intel Ubuntu w/kernel 4.8.0: https://goo.gl/photos/mC6DPbVuuwVw8sTW6

Code: Select all

[email protected]:~$ uname -a
Linux john-desktop 4.8.0-49-generic #52~16.04.1-Ubuntu SMP Thu Apr 20 10:55:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

[email protected]:~$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: PCH [HDA Intel PCH], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: U0x14150x2000 [USB Device 0x1415:0x2000], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

[email protected]:~$ arecord -f S16_LE -r 16000 -D hw:2,0 -d 10 t5.wav
Recording WAVE 't5.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
arecord: set_params:1239: Channels count non available

User avatar
Gavinmc42
Posts: 3474
Joined: Wed Aug 28, 2013 3:31 am

Re: USB mic fails in 4.4.50 (was OK in 4.4.13 & 4.4.21)

Fri Apr 28, 2017 3:25 am

So not just a Raspbian problem?
Who wants to tell Linus?

Might have to bring forwards my plan to do a baremetal interface to the Eyecam :(
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

tvjon
Posts: 708
Joined: Mon Jan 07, 2013 9:11 am

Re: USB mic fails in 4.4.50 (was OK in 4.4.13 & 4.4.21)

Fri Apr 28, 2017 8:07 am

Rpi-update today to 4.9.24-v7+ kernel fixes recording from the ps3cam that jsbeale has, using his 1 line mp3 test.

This works for full Jessie & Jessie-lite (10.04.17 image).

Alsamixer still fails to show with "invalid argument".

User avatar
jbeale
Posts: 3471
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: USB mic fails in 4.4.50 (was OK in 4.4.13 & 4.4.21)

Fri Apr 28, 2017 1:59 pm

Thanks for that update about the newer kernel; great news! Note, as far as I know, alsamixer has never worked with the PS3 Eye. Even on the earlier systems where arecord works, alsamixer fails with the same error message. I assume it is not compatible with input devices having more than 2 channels ?

Note: on the 4.4.21 kernel with Raspbian, I was able to use pulseaudio, with:

Code: Select all

sudo apt install pavucontrol
pulseaudio -D
pavucontrol
and a Volume Control window appeared, and under "Input Devices" listed is "Sony Playstation Eye Analog 4-channel Input" with four separate volume sliders. However, after that I was unable to use arecord which failed with "device busy", so clearly I don't know what I'm doing.
Last edited by jbeale on Fri Apr 28, 2017 2:30 pm, edited 3 times in total.

fruitoftheloom
Posts: 20196
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: USB mic fails in 4.4.50 (was OK in 4.4.13 & 4.4.21)

Fri Apr 28, 2017 2:02 pm

jbeale wrote:Thanks for that update about the newer kernel; great news! Note, as far as I know, alsamixer has never worked with the PS3 Eye. Even on the earlier systems where arecord works, alsamixer fails with the same error message. I assume it is not compatible with input devices having more than 2 channels ?
The Stable Kernel is now 4.9.24

viewtopic.php?f=29&t=167934&start=225#p1154550
adieu

Asus CS10 Chromebit / HP Envy 4500 Wireless Printer / Raspberry Pi Model 2B v1.1 / RealVNC Software...

User avatar
jbeale
Posts: 3471
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: USB mic fails in 4.4.50 (was OK in 4.4.13 & 4.4.21)

Fri Apr 28, 2017 8:21 pm

tvjon wrote:Rpi-update today to 4.9.24-v7+ kernel fixes recording from the ps3cam that jsbeale has, using his 1 line mp3 test.
This works for full Jessie & Jessie-lite (10.04.17 image). Alsamixer still fails to show with "invalid argument".
Thank you tvjon! I am happy to confirm that after sudo apt-get update && sudo apt-get upgrade on an RPi-2 running Raspbian 8.0 (jessie), and then reboot I see kernel 4.9.24-v7+ #993 SMP Wed Apr 26 18:01:23 BST 2017 and this works with the PS3 Eye audio, both with Audacity and a simple command line like arecord -D plughw:1 -d 5 test.wav

UPDATE: This does NOT work on an older (single-cpu) RPi (original model), where 'arecord' still just hangs up trying to record. Then I moved the same uSD card to a RPi-3 and ran the same command, and it worked fine. Wonder if there is some subtlety about the USB hardware between older & newer models?

TEST on RPi 1 model B

Code: Select all

[email protected]:~ $ uname -a
Linux rp45 4.9.24+ #993 Wed Apr 26 17:56:54 BST 2017 armv6l GNU/Linux
[email protected]:~ $  arecord -D plughw:1 -d 5 test.wav
Recording WAVE 'test.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
<...waits forever without recording on RPi 1 >
TEST on RPi 3

Code: Select all

[email protected]:~ $ uname -a
Linux rp45 4.9.24-v7+ #993 SMP Wed Apr 26 18:01:23 BST 2017 armv7l GNU/Linux
[email protected]:~ $ arecord -D plughw:1 -d 5 test.wav
Recording WAVE 'test.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
[email protected]:~ $   # (on the RPi3, it worked fine)
As you say, alsamixer is unchanged and still fails when selecting the PS3 Eye device with "cannot load mixer controls: Invalid argument" presumably due to incapacity to deal with 4 input channels. However this doesn't stop me from recording with it, so I'm good for now.

Massi
Posts: 1691
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: USB mic fails in 4.4.50 (NOW FIXED in 4.9.24)

Tue Dec 25, 2018 6:27 am

well, i've just noticed that on a 3a+ il works flawlessly and forever at first boot or if you unplug/plug it
BUT
it will not work upon reboot.
on the other side, it always works with a 2B
can't understand this

royleith
Posts: 25
Joined: Sun Jul 01, 2012 2:39 pm

Re: USB mic fails in 4.4.50 (NOW FIXED in 4.9.24)

Tue Dec 25, 2018 8:22 am

I have upgraded to Stretch and I have found that alsa is broken. In fact, no devices work including the analogue Line Out. I have a Pi 3 B (with latest Stretch image) with a Cirrus Logic card, a Pi Zero with a PHat Dac and a Pi Zero Plus, again with a PHat Dac.

The Cirrus Logic card has microphones, Line In, Line Out, SPDIF In, SPDIF Out and the ability to route white noise or a tone to any output including the Raspi system audio.

On all three Pis, the cards work correctly with earlier SD card images. The Pi 3 B and the Pi Zero will not route system sounds to the Raspi analogue out port or either of the sound cards. The Pi Zero Plus works correctly. asound is working correctly on the Cirrus Logic card and switches routings and can pass white noise and a tone to Line Out. However the system Record and Play paths do not route to the device.

In all three cases aplay -l shows the installed card and alsamixer shows the devices and all the controls. However, on the Pis that don't work, sound always goes to HDMI, no matter what the audio preferences or config.txt settings.

The Pi Zero is affected and the Pi Zero Plus is not.

Pi Zero (with PHat Dac aka 'Hifi-Berry' not working)
uname -a
Linux raspberrypi 4.14.79+ #1159 Sun Nov 4 17:28:08 GMT 2018 armv6l GNU/Linux

Pi Zero Plus (with PHat Dac aka 'Hifi-Berry' working)
uname -a
Linux raspberrypi 4.14.71+ #1145 Fri Sep 21 15:06:38 BST 2018 armv6l GNU/Linux

So, it appears that something went wrong between 4.14.71 and 4.14.79. I notice that the kernels quoted in this thread are considerably earlier and so I think this problem has been in the making for some time. I assume it is just a matter of time before you hit the problem on all Raspi hardware.

It affects both input and output ports including the Raspi's analogue-out port and any sound modules. My thread 'ALSA Working Fine but Not Controlling Audio' give a fuller picture. The thread 'rpi3 usb microphone on stretch' shows that USB connected 'cards' are equally affected. In this case, it was a USB connected microphone.

Return to “Troubleshooting”