1

I cannot get gstreamer on raspbian (buster) to play through a usb-audio device, despite other players (vlc, aplay) being able to do so. but i need gstreamer because of its API access, for mpd players like gmpc.

this post is related to many others i've found (listed below), but i've exhausted the resources mentioned there, so i and want to report on experiments i've done, still without success.

Following suggestions here i find:

  • lsusb

    Bus 001 Device 005: ID 0781:558c SanDisk Corp. 
    Bus 001 Device 004: ID 0d8c:013c C-Media Electronics, Inc. CM108 Audio Controller
    Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
    Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    
  • aplay -l

    **** List of PLAYBACK Hardware Devices ****
    card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
    Subdevices: 7/7
    Subdevice #0: subdevice #0
    Subdevice #1: subdevice #1
    Subdevice #2: subdevice #2
    Subdevice #3: subdevice #3
    Subdevice #4: subdevice #4
    Subdevice #5: subdevice #5
    Subdevice #6: subdevice #6
    card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 IEC958/HDMI [bcm2835 IEC958/HDMI]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 0: ALSA [bcm2835 ALSA], device 2: bcm2835 IEC958/HDMI1 [bcm2835 IEC958/HDMI1]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    
  • cat /proc/asound/modules

    0 snd_bcm2835
    1 snd_usb_audio
    
  • cat /proc/asound/cards

    0 [ALSA           ]: bcm2835_alsa - bcm2835 ALSA
                         bcm2835 ALSA
    1 [Device         ]: USB-Audio - USB PnP Sound Device
                         USB PnP Sound Device at usb-3f980000.usb-1.2, full speed
    

and so i've editted my /usr/share/alsa/alsa.conf to look like:

    defaults.ctl.card 1 # 0
    defaults.pcm.card 1 # 0

The image below captures my understanding of the various alternative paths from sound files to audio output.

enter image description here

(i see mentions of pulseaudio around others; does it impact gstreamer? should i include it in the picture?)

i've tried 7 different experiments, and also varied touchscreen vs. HDMI display options. Result summary:

enter image description here

the vlc experiments show that it is able to get to usb-audio in both cases. aplay with the touchscreen is also able to send sound to usb-audio. (my current guess is that aplay is missing some mp3 codec and barfing out noise?)

clearly there are lower-level (kernel? raspbian?) resource paths that i don't know about. how can i make gstreamer consume whatever resource it is that vlc and `aplay are able to use to get to usb-audio?

resources

rikb
  • 111
  • 2
  • I'm having similar issues using a USB sound card on Raspberry Pi OS (Buster). It doesn't seem to matter what I do, gst-launch-1.0 hangs. – wryan Feb 05 '22 at 16:42

0 Answers0