Comment 38 for bug 310760

Revision history for this message
Etienne Goyer (etienne-goyer-outlands) wrote :

Leann,

I did try your solution above, and it does work to a certain extent. With the HAL policy file you propose, the microphone work just fine: you can record sound using arecord, Sound Recorder, etc. However, once the camera have been used once, the microphone stop working.

Step to reproduce:

1. Create the /etc/hal/fdi/policy/ignore-17ef7802.fdi as Leann explained above. Restart hald or reboot.

2. With the webcam plugged in, try recording sound using arecord, such as:

    arecord -Dhw:1,0 -d 3 -f cd -t wav test.wav

You may also use Sound recorder. You can use the webcam microphone at will, it works continuously.

3. Use an application that access the camera, such as VLC or MPlayer. For example:

    vlc v4l:// :v4l-vdev="/dev/video0"

or:

    mplayer tv:// -tv driver=v4l

Notice that, in both example above, we are not even have to be using the webcam mic. If we do specify the webcam microphone (ie, using argument :v4l-adev="/dev/dsp1" to vlc), sound is captured just fine from the webcam microphone.

4. Try arecord again, and notice you get the IO error:

ubuntu@ubuntu-laptop:~$ arecord -Dhw:1,0 -d 3 -f cd -t wav test.wav
Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
arecord: pcm_read:1347: read error: Input/output error

5. If you unplug/replug the camera, state is reset so that the microphone just fine until the camera is accessed, at which point you get the IO error (just like above).

So, it seems like the webcam microphone work just fine until the camera is accessed, after which the microphone stop working. Maybe the camera driver (gspca) leave the device in a state broken in such a way that the microphone is not usable? It may also explain why the microphone would not work when hald is running; perhaps hald is opening/querying the camera in a way that break the microphone function of the device. It would also explain why unplugging/replugging the webcam "fix" the microphone (at least, until the camera is accessed).