After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 525833 - [halaudiosrc] unable to get mic USB working with gnome-sound-properties
[halaudiosrc] unable to get mic USB working with gnome-sound-properties
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.x
Other Linux
: Normal normal
: 0.10.8
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-04-02 20:16 UTC by Michael Monreal
Modified: 2008-04-05 12:00 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Screenshot (202.86 KB, image/png)
2008-04-02 20:17 UTC, Michael Monreal
Details
Screenshot #2 (34.27 KB, image/png)
2008-04-02 20:25 UTC, Michael Monreal
Details
lshal (123.71 KB, text/plain)
2008-04-05 09:14 UTC, Michael Monreal
Details

Description Michael Monreal 2008-04-02 20:16:33 UTC
I have to choose ALSA and "USB Audio" in order to get my USB microphone to work. With gstreamer-properties, the audiosrc is correctly set to 

alsasrc device="hw:1,0"

which works great. In gnome-sound-properties however, I end up with this: 

halaudiosrc udi=/org/freedesktop/Hal/devices/usb_device_6f8_3005_noserial_if2_sound_card_0_alsa_capture_0

...when chosing "USB Audio".

Also, I get this output:

sound-properties-Message: Error running pipeline 'gconfaudiosrc ! audioconvert ! audioresample ! gconfaudiosink profile=chat': Could not open audio device for recording. [gstalsasrc.c(640): gst_alsasrc_open (): /pipeline0/gconfaudiosrc0/bin1/halaudiosrc0/bin2/alsasrc0:
Recording open error on device 'default:1': Invalid argument]

The "default:1" should probably be "hw:1,0".
Comment 1 Michael Monreal 2008-04-02 20:17:11 UTC
Created attachment 108502 [details]
Screenshot
Comment 2 Michael Monreal 2008-04-02 20:25:08 UTC
Created attachment 108503 [details]
Screenshot #2

This shows the very confusing dropdown, which merges sound systems (ALSA or OSS, each using default card, which is not mentioned) and devices using specific sound systems (which again, are not mentioned): "USB Audio" (ALSA), "AD198x" (OSS).

The selected choice is only available if I modify the audiosrc in gconf or use gstreamer-properties to change it.
Comment 3 Jens Granseuer 2008-04-04 17:25:35 UTC
Looks like a problem in halaudiosrc to me.
Comment 4 Michael Monreal 2008-04-04 17:40:25 UTC
Well, why is the capplet using halaudiosrc in the first place? With alsasrc device="hw:1,0" (as set by the gstreamer-properties) it works fine.
Comment 5 Tim-Philipp Müller 2008-04-04 19:51:02 UTC
Michael, could you attach the output of lshal?

 $ lshal > list.txt





Comment 6 Michael Monreal 2008-04-05 09:14:26 UTC
Created attachment 108656 [details]
lshal
Comment 7 Michael Monreal 2008-04-05 09:15:06 UTC
(In reply to comment #5)
> Michael, could you attach the output of lshal?

Sure.

Comment 8 Tim-Philipp Müller 2008-04-05 12:00:22 UTC
Right, this is caused by this code snippet in hal.c:

    if (device == 0) {
      /* handle default device specially to use
       * dmix, dsnoop, and softvol if appropriate */
      string = g_strdup_printf ("%s device=default:%d", element, card);
    } else {
      string =
          g_strdup_printf ("%s device=plughw:%d,%d", element, card, device);
    }


From bug #329106: "An additional change I've integrated is to use the "default:X" PCM/capture device instead of "plughw:X,Y" if device 0 is requested. This avoids the problem that dmix/dsnoop set-up by alsa-lib get ignored."

It seems to me that this makes a lot of assumptions about the exact alsa setup, and is generally dodgy. DMix should be advertised as an option alongside direct hardware access instead of things being changed under the hood here. We can't assume that there's a default device set up or that it points to dmix.

Anyway, I think the best quick-fix/hack is to only change the device string in the above way for playback devices, but not for capture devices:

 2008-04-05  Tim-Philipp Müller  <tim at centricular dot net>

        * ext/hal/hal.c: (gst_hal_get_alsa_element):
          Don't munge device string to 'default:x' for capture devices.
          Fixes #525833.