alsasrc to choose sound card

hi, I add a usb sound card on jetson TX2 and there are two sound cards: tegra-hda and usb-audio. If I use ‘gst-launch-1.0 alsasrc ! audioconvert ! alsasink’, it uses the default sound card ‘tegra-hda’. How to configure to use another sound card ‘usb-audio’? Thank you very much.

Hello!

You should be able to do this either via the ‘Sound settings’ under the Ubuntu desktop or by using the ‘pacmd’ utility.

The following command will show you the list of available sinks, note the ‘*’ in front of the ‘index’ indicates the current default. The following is what I see on a Jetson-TK1 …

$ pacmd list-sinks | grep "index:\|name:"
  * index: 0
        name: <alsa_output.platform-tegra-snd-rt5639.0.analog-stereo>
    index: 1
        name: <alsa_output.platform-tegra30-hda.hdmi-stereo>
    index: 2
        name: <alsa_output.usb-C-Media_INC._USB_Sound_Device-00-Device.analog-stereo>

Set the default sink to the USB audio device …

pacmd set-default-sink alsa_output.usb-C-Media_INC._USB_Sound_Device-00-Device.analog-stereo

Check the default audio device …

$ $ pacmd list-sinks | grep "index:\|name:"
    index: 0
        name: <alsa_output.platform-tegra-snd-rt5639.0.analog-stereo>
    index: 1
        name: <alsa_output.platform-tegra30-hda.hdmi-stereo>
  * index: 2
        name: <alsa_output.usb-C-Media_INC._USB_Sound_Device-00-Device.analog-stereo>

Regards,
Jon

Thank you.It works for choosing output sound card. And how to configure to choose input sound card for alsasrc? Thank you very much.

Yes sorry, I see you are using both sink and source. Do the same as in comment #2, but use ‘pacmd list-sources’ and ‘pacmd set-default-source’.

Regards,
Jon