So I stared at the straces and source code, and decoded ioctls for two
hours, without being able to pinpoint the problem. However, I learned
where the problem can *not* be, and have some more tests for you.

 * arecord opens and configures (with ioctls) the sound device just
fine; however, when it actually tries to read data from it
(SNDRV_PCM_IOCTL_READI_FRAMES, through aplay/aplay.c, pcm_read() ->
snd_pcm_readi()) it fails. This rules out any permission problem.

 * The strace does not provide sufficient information to show whether
the sound device was configured with the same parameters in both cases
(SNDRV_PCM_IOCTL_HW_PARAMS only gets a pointer passed which is not
decoded). However, it is pretty unlikely that this is the reason.

 * hald itself and its callouts do not *ever* open /dev/snd/*. It opens
/proc/asound/cards and .../info to get device properties when a new
sound device is found, but do not keep open any FDs. I strongly doubt
that hald itself is the cause for this. To verify this, please do these
two tests:

   - sudo killall hald
   - tail -f /proc/asound/card*/pcm*/info /proc/asound/cards   # this will keep 
those files permanently open
   - arecord ... 

   I expect that this will still work. If not, then opening those files
(as hal does temporarily) is the cause, but it is unlikely.

  - sudo /etc/init.d/hal start
  - log out of GNOME session, ctrl-alt-f1, log into terminal
  - killall -15 -1    # this will kill *all* your running applications
  - sudo /etc/init.d/gdm stop
  - arecord ...

  If arecord still fails here, please stop hal and test arecord again.
This will tell us whether it is hald itself, or something in the desktop
that listens to hal to pick up the new sound device, and grab it.

The latter is my best suspicion so far. It might be the mixer applet,
however, that does not actually talk to hal. It might pick it up by
something in between. Does arecord start working again if you keep hal
running, have a running GNOME session, but "killall mixer_applet2"?

Thanks!

-- 
Built-in microphone on Lenovo USB webcam doesn't work when hald is running
https://bugs.launchpad.net/bugs/310760
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to