Opened 5 hours ago

Last modified 4 hours ago

#19472 new bug

USB Audio double lock KDL on startup.

Reported by: LSS37040 Owned by: mmlr
Priority: normal Milestone: Unscheduled
Component: Drivers/USB/EHCI Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by waddlesplash)

Following #19411 I tried another USB audio adapter on the system which currently runs hrev58713.

The adapter this time is a good one, reporting USB version 1.16 and is picked up by usb_audio.

[Device /dev/bus/usb/3/0/7]
    Class .................. 0x00 (Defined at Interface level) ()
    Subclass ............... 0x00 (Defined at Interface level) ()
    Protocol ............... 0x00 (Defined at Interface level) ()
    Max Endpoint 0 Packet .. 64
    USB Version ............ 1.16
    Vendor ID .............. 0x0d8c (C-Media Electronics, Inc.)
    Product ID ............. 0x000c (Audio Adapter)
    Product Version ........ 0x0100
    Manufacturer String .... ""
    Product String ......... "C-Media USB Headphone Set  "
    Serial Number .......... ""
    [Configuration 0]
        Configuration String . ""
        [Interface 0]
            [Alternate 0 active]
                Class .............. 0x01 Audio ()
                Subclass ........... 0x01 Audio (Control Device)
                Protocol ........... 0x00 Audio (Control Device)
                Interface String ... ""
                [Descriptor 0]
                    Type .............. 0x24
                    Subtype ........... 0x01 (Header)
                    Audio codec version .. 1.0
                    Total Length ...... 100
                    Interfaces ........ 1, 2, 
                [Descriptor 1]
                    Length............. 12
                    Type .............. 0x24
                    Subtype ........... 0x02 (Input Terminal)
                    Terminal ID ....... 1
                    Terminal Type ..... 0x0101 (USB Streaming)
                    Associated Terminal 0
                    Nr Channels ....... 2
                    Channel Config .... 0x3
                       Front .......... Left Right 
                    Channel Names ..... 0
                    Terminal .......... 0
                [Descriptor 2]
                    Length............. 12
                    Type .............. 0x24
                    Subtype ........... 0x02 (Input Terminal)
                    Terminal ID ....... 2
                    Terminal Type ..... 0x0201 (Microphone)
                    Associated Terminal 0
                    Nr Channels ....... 1
                    Channel Config .... 0x1
                       Front .......... Left 
                    Channel Names ..... 0
                    Terminal .......... 0
                [Descriptor 3]
                    Length............. 9
                    Type .............. 0x24
                    Subtype ........... 0x03 (Output Terminal)
                    Terminal ID ....... 6
                    Terminal Type ..... 0x0301 (Speaker)
                    Associated Terminal 0
                    Source ID ......... 0x09
                    Terminal .......... 0
                [Descriptor 4]
                    Length............. 9
                    Type .............. 0x24
                    Subtype ........... 0x03 (Output Terminal)
                    Terminal ID ....... 7
                    Terminal Type ..... 0x0101 (USB Streaming)
                    Associated Terminal 0
                    Source ID ......... 0x08
                    Terminal .......... 0
                [Descriptor 5]
                    Type .............. 0x24
                    Subtype ........... 0x05 (Selector Unit)
                    Unit ID ........... 8
                    Source IDs ........ 10, 
                    Selector .......... 10
                [Descriptor 6]
                    Length............. 10
                    Type .............. 0x24
                    Subtype ........... 0x06 (Feature Unit)
                    Unit ID ........... 9
                    Source ID ......... 0x0f
                    Control Size ...... 1
                       Master Channel . Mute 
                       Channel 1 ...... Volume 
                       Channel 2 ...... Volume 
                [Descriptor 7]
                    Length............. 9
                    Type .............. 0x24
                    Subtype ........... 0x06 (Feature Unit)
                    Unit ID ........... 10
                    Source ID ......... 0x02
                    Control Size ...... 1
                       Master Channel . Mute Volume Automatic Gain 
                [Descriptor 8]
                    Length............. 9
                    Type .............. 0x24
                    Subtype ........... 0x06 (Feature Unit)
                    Unit ID ........... 13
                    Source ID ......... 0x02
                    Control Size ...... 1
                       Master Channel . Mute Volume 
                [Descriptor 9]
                    Length............. 13
                    Type .............. 0x24
                    Subtype ........... 0x04 (Mixer Unit)
                    Unit ID ........... 15
                    Source IDs ........ 1, 13, 
                    Channels .......... 2
                    Channel Config .... 0x3
                       Front .......... Left Right 
                    Channel Names ..... 0
                    Bitmap Control .... 0x00 
                    Mixer ............. 0
        [Interface 1]
            [Alternate 0]
                Class .............. 0x01 Audio ()
                Subclass ........... 0x02 Audio (Streaming)
                Protocol ........... 0x00 Audio (Streaming)
                Interface String ... ""
            [Alternate 1 active]
                Class .............. 0x01 Audio ()
                Subclass ........... 0x02 Audio (Streaming)
                Protocol ........... 0x00 Audio (Streaming)
                Interface String ... ""
                [Endpoint 0]
                    MaxPacketSize .... 1x 200 bytes
                    Interval ......... 1
                    Type ............. Isochronous
                    Direction ........ Output
                [Descriptor 0]
                    Subtype ........... 1 (AS_GENERAL)
                    Terminal link ..... 1
                    Delay ............. 1
                    Format tag ........ 1
                [Descriptor 1]
                    Subtype ........... 2 (FORMAT_TYPE)
                    Format Type ....... 1 (FORMAT_TYPE_I)
                    Channels .......... 2
                    Subframe size ..... 2
                    Bit resolution .... 16
                    Sampling Freq ..... 48000, 44100, 
                [Descriptor 2]
                    Type .............. 0x25 (CS_ENDPOINT)
                    Subtype ........... 0x01 (EP_GENERAL)
                    Attributes ........ 0x01 Sampling Frequency 
                    Lock Delay Units .. 1 (Milliseconds)
                    Lock Delay ........ 1
        [Interface 2]
            [Alternate 0]
                Class .............. 0x01 Audio ()
                Subclass ........... 0x02 Audio (Streaming)
                Protocol ........... 0x00 Audio (Streaming)
                Interface String ... ""
            [Alternate 1 active]
                Class .............. 0x01 Audio ()
                Subclass ........... 0x02 Audio (Streaming)
                Protocol ........... 0x00 Audio (Streaming)
                Interface String ... ""
                [Endpoint 0]
                    MaxPacketSize .... 1x 100 bytes
                    Interval ......... 1
                    Type ............. Isochronous
                    Direction ........ Input
                [Descriptor 0]
                    Subtype ........... 1 (AS_GENERAL)
                    Terminal link ..... 7
                    Delay ............. 1
                    Format tag ........ 1
                [Descriptor 1]
                    Subtype ........... 2 (FORMAT_TYPE)
                    Format Type ....... 1 (FORMAT_TYPE_I)
                    Channels .......... 1
                    Subframe size ..... 2
                    Bit resolution .... 16
                    Sampling Freq ..... 48000, 44100, 
                [Descriptor 2]
                    Type .............. 0x25 (CS_ENDPOINT)
                    Subtype ........... 0x01 (EP_GENERAL)
                    Attributes ........ 0x01 Sampling Frequency 
                    Lock Delay Units .. 0 (Undefined)
                    Lock Delay ........ 0
        [Interface 3]
            [Alternate 0 active]
                Class .............. 0x03 Human Interface Device (No Subclass, None)
                Subclass ........... 0x00 Human Interface Device (No Subclass, None)
                Protocol ........... 0x00 Human Interface Device (No Subclass, None)
                Interface String ... ""
                [Endpoint 0]
                    MaxPacketSize .... 1x 4 bytes
                    Interval ......... 32
                    Type ............. Interrupt
                    Direction ........ Input
                [Descriptor 0]
                    Length............ 0x09
                    Type ............. 0x21
                    Data ............. 00 01 00 01 22 32 00 

For now this USB audio adapter shows correctly in the Media config. Just that when the system starts up I get a KDL complaining about a double lock, which can be ignored by typing "continue" in the KDL prompt. The system will continue running without any other KDL occurring afterwards.

Haven't tested actual audio functionality as I don't know if Haiku includes any default sound that I could play for testing, and the system is currently unable to connect to internet due to #19471, so I can't obtain any software with sound effects via HaikuDepot at the moment.

Relevant syslog is here.

KERN: usb_audio:00.31.285:GetSamplingRateId::Ignore unsupported sample rate 0.
KERN: usb error ehci 3: KERN: no isochronous transfer found!
KERN: usb_audio:00.31.295:SetGlobalFormat::set_speed 80bb00 for ep 0x1 3: No error
KERN: usb_audio:00.31.302:GetSamplingRateId::Ignore unsupported sample rate 0.
KERN: usb error ehci 3: KERN: no isochronous transfer found!
KERN: usb_audio:00.31.313:SetGlobalFormat::set_speed 80bb00 for ep 0x82 3: No error
KERN: usb_audio:00.31.320:_InitGainLimits::Control : 0 dB, from 0 to 23.812 dB, step 0.187 dB.
KERN: usb_audio:00.31.329:_InitGainLimits::Control : 34.5 dB, from 0 to 47.812 dB, step 0.187 dB.
KERN: usb_audio:00.31.338:_InitGainLimits::Control : -0.25 dB, from -28.375 to -0.62 dB, step 0.187 dB.
KERN: usb_audio:00.31.347:_InitGainLimits::Control : -0.25 dB, from -28.375 to -0.62 dB, step 0.187 dB.
KERN: PANIC: _mutex_lock(): double lock of 0x8365ca44 by thread 46
KERN: Welcome to Kernel Debugging Land...
KERN: Thread 46 "ehci isochronous finish thread" running on CPU 21
KERN: stack trace for thread 46 "ehci isochronous finish thread"
KERN:     kernel stack: 0x82668000 to 0x8266c000
KERN: frame               caller     <image>:function + offset
KERN:  0 8266bc48 (+  32) 8015d23f   <kernel_x86> arch_debug_stack_trace + 0x0f
KERN:  1 8266bc54 (+  12) 8014b5d2   <kernel_x86> arch_debug_call_with_fault_handler + 0x1b
KERN:  2 8266bc84 (+  48) 800b1210   <kernel_x86> debug_call_with_fault_handler + 0x60
KERN:  3 8266bcd4 (+  80) 800b2620   <kernel_x86> kernel_debugger_loop(char const*: [34m0x15[0m [31m"<???>"[0m, char const*: [34m0x801dc774[0m [36m"½f‚"[0m, char*: [34m0x8266bd14[0m, int32: [34m-2146751818[0m) + 0xe0
KERN:  4 8266bd14 (+  64) 800b29af   <kernel_x86> kernel_debugger_internal(char const*: [34m0x15[0m [31m"<???>"[0m, char const*: [34m0x0[0m [31m"<NULL>"[0m, char*: [34m0x8266bd44[0m, int32: [34m-2146751275[0m) + 0x5f
KERN:  5 8266bd34 (+  32) 800b2cbf   <kernel_x86> panic + 0x2f
KERN:  6 8266bd84 (+  80) 800976fd   <kernel_x86> _mutex_lock(mutex*: [34m0x8365ca44[0m, void*: NULL) + 0x23d
KERN:  7 8266be04 (+ 128) 81d1c3e4   <ehci> EHCI<[32m0x8365c900[0m>::SubmitIsochronous[clone .localalias] (Transfer*: [34m0xba033cd0[0m) + 0x294
KERN:  8 8266be44 (+  64) 81cff08d   <usb> IsochronousPipe<[32m0xba421d00[0m>::QueueIsochronous(void*: [34m0xde9c7f80[0m, uint32: [34m0x1f80[0m ([34m8064[0m), usb_iso_packet_descriptor*: [34m0x83708550[0m, uint32: [34m0x2a[0m ([34m42[0m), unsigned int*: [34m0xba41fdfc[0m, uint32: [34m0x1[0m ([34m1[0m), void (*)(void*, int, void*, unsigned long): [34m0xde9ada40[0m, void*: [34m0xba41fda0[0m) + 0xfd
KERN:  9 8266be94 (+  80) 81cf9728   <usb> queue_isochronous[clone .localalias] (uint32: [34m0x31[0m ([34m49[0m), void*: [34m0xde9c7f80[0m, uint32: [34m0x1f80[0m ([34m8064[0m), usb_iso_packet_descriptor*: [34m0x83708550[0m, uint32: [34m0x2a[0m ([34m42[0m), unsigned int*: [34m0xba41fdfc[0m, uint32: [34m0x1[0m ([34m1[0m), void (*)(void*, int, void*, unsigned long): [34m0xde9ada40[0m, void*: [34m0xba41fda0[0m) + 0x68
KERN: 10 8266bef4 (+  96) de9ada0c   </boot/system/add-ons/kernel/drivers/dev/audio/hmulti/usb_audio> Stream<[32m0xba41fda0[0m>::_QueueNextTransfer[clone .localalias] (uint32: [34m0x1[0m ([34m1[0m), [34mfalse[0m) + 0xcc
KERN: 11 8266bf34 (+  64) de9adb4c   </boot/system/add-ons/kernel/drivers/dev/audio/hmulti/usb_audio> Stream<[32m0xba41fda0[0m>::_TransferCallback(void*: NULL, int32: [34m-560177152[0m, void*: NULL, uint32: [34m0x81d2992c[0m) + 0x10c
KERN: 12 8266bf54 (+  32) 81d24055   <ehci> Transfer<[32m0xba41e1a8[0m>::Finished(uint32: [34m0x0[0m ([34m0[0m), uint32: [34m0x0[0m ([34m0[0m)) + 0x25
KERN: 13 8266bfa4 (+  80) 81d1e43b   <ehci> EHCI<[32m0x8365c900[0m>::FinishIsochronousTransfers[clone .localalias] () + 0x23b
KERN: 14 8266bfc4 (+  32) 81d1e61f   <ehci> EHCI<[32m0x8365c900[0m>::FinishIsochronousThread(void*: NULL) + 0x0f
KERN: 15 8266bfe4 (+  32) 80089ec6   <kernel_x86> common_thread_entry(void*: [34m0x8266bff0[0m) + 0x36
KERN: kdebug> continue

(It seems some of the characters from this portion of syslog are unreadable somehow.)

Change History (4)

comment:1 by waddlesplash, 5 hours ago

Component: Drivers/Audio/USBDrivers/USB/EHCI
Description: modified (diff)
Owner: changed from nobody to mmlr

It appears the EHCI driver does not support transfers being resubmitted from transfer callback hooks, that should be fixed.

However, EHCI does not support outbound isochronous transfers anyway, so the USB audio driver will not work there anyway. (Input might work, but output won't.) Only XHCI and OHCI properly support isochronous transfers.

comment:2 by LSS37040, 4 hours ago

I think this is indeed an EHCI issue. Plugging the same USB audio adapter to a USB 3.0 port and the KDL is gone.

However, I'm getting another issue, as the syslog is being spammed by a lot of XHCI "babbles", even though I'm not actually playing any audio at the moment.

I don't think this is normal, either, as those "babbles" are so many that the syslog auto-suppress a good amount of them at a regular basis. Those "babbles" did not happen when the adapter was plugged into a USB 2.0 port.

KERN: usb_audio:00.31.662:GetSamplingRateId::Ignore unsupported sample rate 0.
KERN: usb_audio:00.31.668:SetGlobalFormat::set_speed 80bb00 for ep 0x1 3: No error
KERN: usb_audio:00.31.675:GetSamplingRateId::Ignore unsupported sample rate 0.
KERN: usb_audio:00.31.681:SetGlobalFormat::set_speed 80bb00 for ep 0x82 3: No error
KERN: usb_audio:00.31.689:_InitGainLimits::Control : 0 dB, from 0 to 23.812 dB, step 0.187 dB.
KERN: usb_audio:00.31.697:_InitGainLimits::Control : 34.5 dB, from 0 to 47.812 dB, step 0.187 dB.
KERN: usb_audio:00.31.705:_InitGainLimits::Control : -0.25 dB, from -28.375 to -0.62 dB, step 0.187 dB.
KERN: usb_audio:00.31.714:_InitGainLimits::Control : -0.25 dB, from -28.375 to -0.62 dB, step 0.187 dB.
KERN: cx23882: init_hardware()
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 5 times
KERN: slab memory manager: created area 0xbd001000 (46288)
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 7 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 11 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 23 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb error xhci 0: KERN: TRB 0x1229290 was not found in the endpoint!
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 2 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb error xhci 0: KERN: TRB 0x123aa90 was not found in the endpoint!
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 2 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb error xhci 0: KERN: TRB 0x124c290 was not found in the endpoint!
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 29 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 5 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 5 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb error xhci 0: KERN: TRB 0x1348e90 was not found in the endpoint!
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 10 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb error xhci 0: KERN: TRB 0x1389e90 was not found in the endpoint!
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 22 times
KERN: slab memory manager: created area 0xbd801000 (47640)
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb error xhci 0: KERN: TRB 0x1418690 was not found in the endpoint!
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 20 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb error xhci 0: KERN: TRB 0x1495690 was not found in the endpoint!
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 7 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 12 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb error xhci 0: KERN: TRB 0x1512690 was not found in the endpoint!
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 20 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb error xhci 0: KERN: TRB 0x158f690 was not found in the endpoint!
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 20 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb error xhci 0: KERN: TRB 0x160c690 was not found in the endpoint!
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 11 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb error xhci 0: KERN: TRB 0x1655e90 was not found in the endpoint!
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 12 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 4 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb error xhci 0: KERN: TRB 0x16c1690 was not found in the endpoint!
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 56 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb error xhci 0: KERN: TRB 0x1817690 was not found in the endpoint!
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 20 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb error xhci 0: KERN: TRB 0x110ea90 was not found in the endpoint!
KERN: usb xhci 0: transfer error on slot 1 endpoint 1: Stall
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 3 times
KERN: usb error control pipe 8: timeout waiting for queued request to complete
KERN: usb error xhci 0: KERN: cancel queued transfers: halted endpoint, reset!
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 24 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb error xhci 0: KERN: TRB 0x11bfa90 was not found in the endpoint!
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb xhci 0: transfer error on slot 1 endpoint 1: Stall
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 3 times
KERN: usb error control pipe 8: timeout waiting for queued request to complete
KERN: usb error xhci 0: KERN: cancel queued transfers: halted endpoint, reset!
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 20 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 1 time
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 27 times
KERN: usb xhci 0: KERN: transfer error on slot 2 endpoint 5: Babble detected
KERN: usb error xhci 0: KERN: TRB 0x1312a90 was not found in the endpoint!
KERN: usb xhci 0: transfer error on slot 2 endpoint 5: Babble detected
Last message repeated 11 times

comment:3 by waddlesplash, 4 hours ago

"Babble" means the device is sending data when we don't expect it. This is probably a bug in the USB Audio driver (it isn't scheduling transfers long or fast enough for your device, most likely).

comment:4 by waddlesplash, 4 hours ago

even though I'm not actually playing any audio at the moment.

The media server always sends audio buffers even if no audio is playing at the moment; they will just be silence in that case.

Note: See TracTickets for help on using tickets.