Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[s] USB-soundcard not detected by alsa after kernel upgrade
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1343
Location: Sweden

PostPosted: Wed Jan 17, 2018 2:18 pm    Post subject: [s] USB-soundcard not detected by alsa after kernel upgrade Reply with quote

I have audio working just fine on 4.12, but when upgrading to 4.14, all audio disappears.

Pulling and plugging the usb-soundcard back in yields:

Code:
kernel: [  356.972556] usb 3-12: USB disconnect, device number 5
kernel: [  358.329144] usb 3-12: new full-speed USB device number 6 using xhci_hcd
kernel: [  358.456068] usb 3-12: New USB device found, idVendor=0b05, idProduct=17a0
kernel: [  358.456071] usb 3-12: New USB device strings: Mfr=3, Product=1, SerialNumber=0
kernel: [  358.456073] usb 3-12: Product: USB Advanced Audio Device
kernel: [  358.456074] usb 3-12: Manufacturer: C-Media Electronics Inc.
kernel: [  358.457198] input: C-Media Electronics Inc. USB Advanced Audio Device as /devices/pci0000:00/0000:00:14.0/usb3/3-12/3-12:1.3/0003:0B05:17A0.0005/input/input8
kernel: [  358.509309] hid-generic 0003:0B05:17A0.0005: input,hidraw3: USB HID v1.00 Device [C-Media Electronics Inc. USB Advanced Audio Device] on usb-0000:00:14.0-12/input3
mtp-probe: checking bus 3, device 6: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-12"
mtp-probe: bus: 3, device: 6 was not an MTP device


So the kernel appears to correctly identify the card. However at higher levels the card doesn't appear to exist.
Code:
# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server

Code:
# ls /sys/class/sound/
seq  sequencer  sequencer2  timer


Last edited by Letharion on Tue Jul 17, 2018 7:07 am; edited 3 times in total
Back to top
View user's profile Send private message
blopsalot
Apprentice
Apprentice


Joined: 28 Jan 2017
Posts: 231

PostPosted: Wed Jan 17, 2018 3:52 pm    Post subject: Reply with quote

have you updated alsa and pulseaudio too? i don't know if it's normal for USB audio, but that looks like it's only loading an input portion of the device? I just compile audio device driver as module and let udev load it.
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1343
Location: Sweden

PostPosted: Thu Jan 18, 2018 7:51 am    Post subject: Reply with quote

blopsalot wrote:
have you updated alsa and pulseaudio too? i don't know if it's normal for USB audio, but that looks like it's only loading an input portion of the device? I just compile audio device driver as module and let udev load it.


I haven't recompiled any particular packages, but I suppose it could be worthwhile trying. ALSA is mostly in the kernel, right? So that would be upgraded as part of that.

Here's the kernel log when it works. The mtp-probe bit is missing, not sure what that means or if it's important.

Code:
kernel: [    1.625965] usb 3-12: new full-speed USB device number 5 using xhci_hcd
kernel: [    1.754780] usb 3-12: New USB device found, idVendor=0b05, idProduct=17a0
kernel: [    1.755320] usb 3-12: New USB device strings: Mfr=3, Product=1, SerialNumber=0
kernel: [    1.755790] usb 3-12: Product: USB Advanced Audio Device
kernel: [    1.756250] usb 3-12: Manufacturer: C-Media Electronics Inc.
kernel: [    1.757347] input: C-Media Electronics Inc. USB Advanced Audio Device as /devices/pci0000:00/0000:00:14.0/usb3/3-12/3-12:1.3/0003:0B05:17A0.0004/input/input7
kernel: [    1.810065] hid-generic 0003:0B05:17A0.0004: input,hidraw3: USB HID v1.00 Device [C-Media Electronics Inc. USB Advanced Audio Device] on usb-0000:00:14.0-12/input3


Code:
# ls /sys/class/sound/
audio2  card0  card2  controlC0  controlC2  dsp2  hwC0D0  mixer   mixer2  pcmC2D0c  pcmC3D0p  sequencer   timer
audio3  card1  card3  controlC1  controlC3  dsp3  hwC1D0  mixer1  mixer3  pcmC3D0c  seq       sequencer2
Back to top
View user's profile Send private message
blopsalot
Apprentice
Apprentice


Joined: 28 Jan 2017
Posts: 231

PostPosted: Sun Jan 21, 2018 1:01 am    Post subject: Reply with quote

ok yeah, reinstalling alsa and/or pulseaudio probably will not help. from my experience nowadays, as long as you compile audio device drivers as modules, alsa and udev figure it out, and it "just works"
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1343
Location: Sweden

PostPosted: Sun Mar 04, 2018 9:36 pm    Post subject: Reply with quote

I made another attempt at upgrading to 4.14 today, now with 4.14.23, and with that version, audio appears to work fine, so I guess it was driver bug caused by a meltdown/spectre patch.
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1343
Location: Sweden

PostPosted: Tue Jun 05, 2018 7:50 am    Post subject: Reply with quote

Argh. I've been running 4.14.27 for a while. 4.14.34 broke audio again. Now I tried upgrading to 4.14.47, and still no audio. :(

Code:
# cat /proc/version
Linux version 4.14.47-gentoo (root@traxex) (gcc version 6.4.0 (Gentoo 6.4.0-r1 p1.3)) #1 SMP Tue Jun 5 09:20:05 CEST 2018
# ls /sys/class/sound/
seq  sequencer  sequencer2  timer
# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server


Excerpt from messages where various usb-devices come up:
Code:
[    1.512658] usb 3-6: New USB device found, idVendor=045e, idProduct=0779
[    1.513245] usb 3-6: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    1.513798] usb 3-6: Product: Microsoft® LifeCam HD-3000
[    1.514340] usb 3-6: Manufacturer: Microsoft
[    1.516510] uvcvideo: Found UVC 1.00 device Microsoft® LifeCam HD-3000 (045e:0779)
[    1.519886] input: Microsoft® LifeCam HD-3000: Mi as /devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6:1.0/input/input6
[    1.635013] usb 3-12: new full-speed USB device number 5 using xhci_hcd
[    1.641995] random: lvm: uninitialized urandom read (4 bytes read)
[    1.761811] usb 3-12: New USB device found, idVendor=0b05, idProduct=17a0
[    1.762505] usb 3-12: New USB device strings: Mfr=3, Product=1, SerialNumber=0
[    1.763054] usb 3-12: Product: USB Advanced Audio Device
[    1.763581] usb 3-12: Manufacturer: C-Media Electronics Inc.
[    1.764681] input: C-Media Electronics Inc. USB Advanced Audio Device as /devices/pci0000:00/0000:00:14.0/usb3/3-12/3-12:1.3/0003:0B05:17A0.0004/input/input7
[    1.817123] hid-generic 0003:0B05:17A0.0004: input,hidraw3: USB HID v1.00 Device [C-Media Electronics Inc. USB Advanced Audio Device] on usb-0000:00:14.0-12/input3



And on a the last working version:
Code:
# cat /proc/version
Linux version 4.14.27-gentoo (root@traxex) (gcc version 6.4.0 (Gentoo 6.4.0-r1 p1.3)) #1 SMP Thu Mar 15 22:42:41 CET 2018
# ls /sys/class/sound/
audio2  audio3  card2  card3  controlC2  controlC3  dsp2  dsp3  mixer2  mixer3  pcmC2D0c  pcmC3D0c  pcmC3D0p  seq  sequencer  sequencer2  timer
# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
sysdefault:CARD=Device
    USB Advanced Audio Device, USB Audio
    Default Audio Device
front:CARD=Device,DEV=0
    USB Advanced Audio Device, USB Audio
    Front speakers
surround21:CARD=Device,DEV=0
    USB Advanced Audio Device, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Device,DEV=0
    USB Advanced Audio Device, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Device,DEV=0
    USB Advanced Audio Device, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Device,DEV=0
    USB Advanced Audio Device, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Device,DEV=0
    USB Advanced Audio Device, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Device,DEV=0
    USB Advanced Audio Device, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Device,DEV=0
    USB Advanced Audio Device, USB Audio                                                                                                                                                                         
    IEC958 (S/PDIF) Digital Audio Output

And the kernel logs:
Code:
[    1.515764] usb 3-6: New USB device found, idVendor=045e, idProduct=0779
[    1.516418] usb 3-6: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    1.517050] usb 3-6: Product: Microsoft® LifeCam HD-3000
[    1.517664] usb 3-6: Manufacturer: Microsoft
[    1.519981] uvcvideo: Found UVC 1.00 device Microsoft® LifeCam HD-3000 (045e:0779)
[    1.523445] input: Microsoft® LifeCam HD-3000: Mi as /devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6:1.0/input/input6
[    1.576232] random: crng init done
[    1.638010] usb 3-12: new full-speed USB device number 5 using xhci_hcd
[    1.764816] usb 3-12: New USB device found, idVendor=0b05, idProduct=17a0
[    1.765360] usb 3-12: New USB device strings: Mfr=3, Product=1, SerialNumber=0
[    1.765872] usb 3-12: Product: USB Advanced Audio Device
[    1.766385] usb 3-12: Manufacturer: C-Media Electronics Inc.
[    1.767513] input: C-Media Electronics Inc. USB Advanced Audio Device as /devices/pci0000:00/0000:00:14.0/usb3/3-12/3-12:1.3/0003:0B05:17A0.0004/input/input7
[    1.820128] hid-generic 0003:0B05:17A0.0004: input,hidraw3: USB HID v1.00 Device [C-Media Electronics Inc. USB Advanced Audio Device] on usb-0000:00:14.0-12/input3

Other than a minor re-ordering thing, I see no difference. :(
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21518

PostPosted: Wed Jun 06, 2018 1:38 am    Post subject: Reply with quote

What patch in the later 4.14.x kernels broke audio for you? Has this been reported upstream so that it can be reverted?
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1343
Location: Sweden

PostPosted: Wed Jun 06, 2018 5:30 am    Post subject: Reply with quote

Hu wrote:
What patch in the later 4.14.x kernels broke audio for you? Has this been reported upstream so that it can be reverted?

I wish I knew! I suppose I could work out which release it was with relative ease since I have known working and not working versions, but how would I take it from there?
While I'm familiar with using git bisect, the prospect of bisecting the largest software project in the world seems... daunting.

Any tips for me?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21518

PostPosted: Thu Jun 07, 2018 1:38 am    Post subject: Reply with quote

Git bisect is the preferred solution here. Since you will be bisecting in the stable series, your experience should be relatively straightforward. Generally, stable series have no build-breaking patches in them, nor known backports of anything that causes serious stability problems. Bisecting -rc series kernels during the merge window can be somewhat more exciting.
Code:
$ git bisect start
$ git bisect good v4.14.27
$ git bisect bad v4.14.34
# Git now picks an intermediate commit for you to test.
# Build and test the commit it picked.
# If that commit has working audio, run: git bisect good
# If that commit has non-working audio, run: git bisect bad
# Git will now pick another intermediate commit.
# Build and test the commit it picked.
# Repeat until a specific commit is identified as bad.
Then report the bad commit. Include in your report the commit ID of the bad commit (in stable), the commit ID upstream from which the bad stable commit was backported, a description of the hardware which fails in "bad" kernels, and the usual expected/actual results block. Since you will have generated one, including the git bisect log might be helpful, just to show your work.
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1343
Location: Sweden

PostPosted: Tue Jul 10, 2018 5:16 am    Post subject: Reply with quote

Edit: Argh, going back to the vanilla kernel 27, the device files don't appear there either, so probably I accidentally booted 27-gentoo when I checked initially. I'll have to go back to the drawing board. I suppose I'll start by checking that the config is correct.

I've finally gotten around to doing this. I've cloned git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git, I checked out both
v4.14.27 and v.4.14.34 and built those, confirming that I see the same behavior as with gentoo-sources, looking at /sys/class/sound/.
Then I've essentially iterated over this a number of times:

Code:
sudo bash -c 'ls /sys/class/sound/' # Check if the expected number of devices show up.
cd projects/linux-stable/
git bisect bad
make && sudo bash -c 'mount /boot/; make install && grub-mkconfig -o /boot/grub/grub.cfg'
sudo reboot


Unfortunately, this leads me to 76fbc152cd8c95369b0527b5d5cb1e166033ab84, which is a network related commit, and also happens to be the very first commit after the version bump to 4.14.27. Since the commit doesn't appear to be even remotely audio-related, I suspect I've done something wrong, thought I don't know what that would be.
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1343
Location: Sweden

PostPosted: Mon Jul 16, 2018 7:51 pm    Post subject: Reply with quote

I am not a smart person...

Occams razor make its entrance:
After starting over, I realized that I had snd-usb-audio=m, and I hadn't installed the modules. :(
Back to top
View user's profile Send private message
saturnalia0
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2016
Posts: 132

PostPosted: Fri May 12, 2023 10:15 pm    Post subject: Reply with quote

For future reference, since Google led me to this topic...

To make my C-Media USB Audio device work, besides building the kernel with CONFIG_SND_USB_AUDIO=y (I made the same mistake as OP and had CONFIG_SND_USB_AUDIO=m initially - guess I'm not that smart either!) I also had to do two more steps:

1. Also build the kernel with CONFIG_HID_CMEDIA=y

What tipped me off was that `dmesg | grep usb` yielded my C-Media USB Audio device as hid-generic:

Code:

[    3.000870] input: C-Media USB Audio Device    as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4:1.3/0003:0D8C:0008.0005/input/input16
[    3.054129] hid-generic 0003:0D8C:0008.0005: input,hidraw4: USB HID v1.00 Device [C-Media USB Audio Device   ] on usb-0000:00:14.0-4.4/input3


And it wasn't showing up as a sound card with ` aplay -L`. After rebuilding the kernel with the aforementioned config, `aplay -L` shows the card as expected:

Code:

localhost /usr/src/linux # aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default
    Default Audio Device
sysdefault
    Default Audio Device
default:CARD=PCH
    HDA Intel PCH, ALC887-VD Analog
    Default Audio Device
sysdefault:CARD=PCH
    HDA Intel PCH, ALC887-VD Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC887-VD Analog
    Front output / input
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, ALC887-VD Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, ALC887-VD Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, ALC887-VD Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, ALC887-VD Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, ALC887-VD Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, ALC887-VD Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, Generic Digital
    HDMI Audio Output
default:CARD=Device
    C-Media USB Audio Device, USB Audio
    Default Audio Device
sysdefault:CARD=Device
    C-Media USB Audio Device, USB Audio
    Default Audio Device
front:CARD=Device,DEV=0
    C-Media USB Audio Device, USB Audio
    Front output / input
surround21:CARD=Device,DEV=0
    C-Media USB Audio Device, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Device,DEV=0
    C-Media USB Audio Device, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Device,DEV=0
    C-Media USB Audio Device, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Device,DEV=0
    C-Media USB Audio Device, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Device,DEV=0
    C-Media USB Audio Device, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Device,DEV=0
    C-Media USB Audio Device, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Device,DEV=0
    C-Media USB Audio Device, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
localhost /usr/src/linux #


But then even though I could hear myself on my mic if I unmuted it on alsamixer, Firefox had no sound. I suspected it was a Firefox issue, but when I connected my headphone on the jack instead of the P2 to USB C-Media thingy, Firefox had sound, which lead me to the second missing step:

2. Set the default sound card on ALSA if you're using Firefox with the alsa USE flag (apulse)

Get the card numbers with `cat /proc/asound/cards`:

Code:

localhost /usr/src/linux # cat /proc/asound/cards
 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xf7220000 irq 127
 1 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xf7080000 irq 17
 2 [WEBCAM         ]: USB-Audio - C270 HD WEBCAM
                      C270 HD WEBCAM at usb-0000:00:14.0-4.3, high speed
 3 [Device         ]: USB-Audio - C-Media USB Audio Device
                      C-Media USB Audio Device at usb-0000:00:14.0-4.4, full speed


Then set it in /etc/asound.conf, e.g.:

Code:

localhost /usr/src/linux # cat /etc/asound.conf
defaults.pcm.card 3
defaults.ctl.card 3


Finally, Firefox with sound using my C-Media USB Audio Device!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum