Nov 232017
 

I bought a pair of cheap USB headphones yesterday so I could test out whether my sound issue on my computer was due to my sound card, or another issue.

The issue I after plugging them in however, was that I could not easily switch the sound output to the USB headphones.
I don’t run pulseaudio, so I was left with playing with configuration files to try and switch the audio over.

If I had been running pulseaudio, I’m sure this blog post would have been much shorter!

After a lot of Googling, I finally worked out how to make it work.

First thing I had to do was discover what hardware id the USB headphones had gotten. The easiest way to do that is to run aplay -l from a terminal.

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 3: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0

As you can see, I have quite a few audio output devices in this list. But the one I’m interested in is the last one – Card 3. This is my USB headphones.

Next is to modify my ~/.asoundrc file to set the default hardware device to the correct one.
Since my USB headset is card 3, I’ve used the following lines to set the default device.

defaults.pcm.!card 3
defaults.ctl.!card 3

After saving the file, I opened up Firefox and could listen to YouTube without any audio stuttering through my pair of cheap USB headphones…seems like my onboard audio has some issues.

Share

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)