[alsa-devel] snd-usb-audio syncronisation problem
Hi,
I'm using an E-MU 0404 USB interface with the snd-usb-audio module from alsa 1.0.16, operating in isochronous asynchronous mode. This interface was producing very annoying click/pop sounds at regular intervals during playback. Eventually I discovered that the syncronisation mechanism telling the driver to send audio data faster or slower to match the interface's consumption speed does not work as expected, for some reason.
I did a very dirty hack within the source of this driver, simulating the interface asking for data to be sent a little bit quicker, and this almost fixed the problem *for me*. I really wish to debug this issue further, to find what actually does not work as it should in this feed-back mechanism. However this was the first time I dealt with alsa source code, so I do not have much experience. Therefore, I really need help with debugging this problem and maybe finding an universal fix.
Thanks in advance, Adi
Adrian Stancu wrote:
I'm using an E-MU 0404 USB interface with the snd-usb-audio module from alsa 1.0.16, operating in isochronous asynchronous mode. This interface was producing very annoying click/pop sounds at regular intervals during playback. Eventually I discovered that the syncronisation mechanism telling the driver to send audio data faster or slower to match the interface's consumption speed does not work as expected, for some reason.
The momentary frequency as requested by the device is shown in /proc/asound/card?/stream? (if CONFIG_SND_VERBOSE_PROCFS is enabled).
Try something like:
while sleep 0.3; do grep "Momentary freq" /proc/asound/card0/stream0; done
In theory, once the device has determined its own speed relative to the computer, this value should be nearly constant. (When a stream has just been started, the requested frequency usually is higher because the device's buffer is empty.)
Regards, Clemens
Hi Clemens,
Thank you very much for helping me!
Using the original module, the momentary frequency is always stalled at 48000Hz during playback: vader:~# while sleep 0.3; do grep "Momentary freq" /proc/asound/card1/stream0; done Momentary freq = 48000 Hz (0x6.0000) Momentary freq = 48000 Hz (0x6.0000) Momentary freq = 48000 Hz (0x6.0000) Momentary freq = 48000 Hz (0x6.0000) Momentary freq = 48000 Hz (0x6.0000)
note: I started playback after issuing the command. So maybe this particular type of interface does not report back correctly, thus confusing the driver?
After playing with subs->freqm in init_substream_urbs(,,,), the situation improved dramatically for me, but this is no general fix... In this case, I get: Momentary freq = 48001 Hz (0x6.0007) and I get a single little pop once about 90 seconds, but this is nothing compared to the horrible sound I normally get when the buffer gets empty.
On Fri, Feb 22, 2008 at 3:09 PM, Clemens Ladisch clemens@ladisch.de wrote:
Adrian Stancu wrote:
I'm using an E-MU 0404 USB interface with the snd-usb-audio module from alsa 1.0.16, operating in isochronous asynchronous mode. This interface was producing very annoying click/pop sounds at regular intervals during playback. Eventually I discovered that the syncronisation mechanism telling the driver to send audio data faster or slower to match the interface's consumption speed does not work as expected, for some reason.
The momentary frequency as requested by the device is shown in /proc/asound/card?/stream? (if CONFIG_SND_VERBOSE_PROCFS is enabled).
Try something like:
while sleep 0.3; do grep "Momentary freq" /proc/asound/card0/stream0; done
In theory, once the device has determined its own speed relative to the computer, this value should be nearly constant. (When a stream has just been started, the requested frequency usually is higher because the device's buffer is empty.)
Regards, Clemens
Adrian Stancu wrote:
Using the original module, the momentary frequency is always stalled at 48000Hz during playback: vader:~# while sleep 0.3; do grep "Momentary freq" /proc/asound/card1/stream0; done Momentary freq = 48000 Hz (0x6.0000) Momentary freq = 48000 Hz (0x6.0000) Momentary freq = 48000 Hz (0x6.0000) Momentary freq = 48000 Hz (0x6.0000) Momentary freq = 48000 Hz (0x6.0000)
note: I started playback after issuing the command. So maybe this particular type of interface does not report back correctly, thus confusing the driver?
This is possible. Please try to put printk's into retire_playback_sync_urb(_hs) to see whether these functions ever get called, and whether the line "subs->freqm = f;" is reached.
Please show the entire contents of /proc/asound/card1/stream0 while the device is playing.
Regards, Clemens
It seems that retire_playback_sync_urb_hs gets called, but 'subs->feqm = f;' never gets called
Here is the content of /proc/asound/card1/stream0 during playback:
vader:~# cat /proc/asound/card1/stream0 E-MU Systems, Inc. E-MU 0404 | USB at usb-0000:00:1d.7-6, high speed : USB Audio
Playback: Status: Running Interface = 1 Altset = 3 URBs = 4 [ 8 8 8 5 ] Packet Size = 298 Momentary freq = 48000 Hz (0x6.0000) Interface 1 Altset 1 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 44100 Interface 1 Altset 2 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 44100 Interface 1 Altset 3 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 48000 Interface 1 Altset 4 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 48000 Interface 1 Altset 5 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 88200 Interface 1 Altset 6 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 88200 Interface 1 Altset 7 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 96000 Interface 1 Altset 8 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 96000 Interface 1 Altset 9 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 176400 Interface 1 Altset 10 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 192000 Interface 1 Altset 11 Format: 0x20 Channels: 4 Endpoint: 1 OUT (ASYNC) Rates: 44100 Interface 1 Altset 12 Format: 0x20 Channels: 4 Endpoint: 1 OUT (ASYNC) Rates: 44100 Interface 1 Altset 13 Format: 0x20 Channels: 4 Endpoint: 1 OUT (ASYNC) Rates: 48000 Interface 1 Altset 14 Format: 0x20 Channels: 4 Endpoint: 1 OUT (ASYNC) Rates: 48000 Interface 1 Altset 15 Format: 0x20 Channels: 4 Endpoint: 1 OUT (ASYNC) Rates: 88200 Interface 1 Altset 16 Format: 0x20 Channels: 4 Endpoint: 1 OUT (ASYNC) Rates: 96000
Capture: Status: Stop Interface 2 Altset 1 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 44100 Interface 2 Altset 2 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 44100 Interface 2 Altset 3 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 48000 Interface 2 Altset 4 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 48000 Interface 2 Altset 5 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 88200 Interface 2 Altset 6 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 88200 Interface 2 Altset 7 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 96000 Interface 2 Altset 8 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 96000 Interface 2 Altset 9 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 176400 Interface 2 Altset 10 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 192000 Interface 2 Altset 11 Format: 0x20 Channels: 4 Endpoint: 2 IN (ASYNC) Rates: 44100 Interface 2 Altset 12 Format: 0x20 Channels: 4 Endpoint: 2 IN (ASYNC) Rates: 44100 Interface 2 Altset 13 Format: 0x20 Channels: 4 Endpoint: 2 IN (ASYNC) Rates: 48000 Interface 2 Altset 14 Format: 0x20 Channels: 4 Endpoint: 2 IN (ASYNC) Rates: 48000 Interface 2 Altset 15 Format: 0x20 Channels: 4 Endpoint: 2 IN (ASYNC) Rates: 88200 Interface 2 Altset 16 Format: 0x20 Channels: 4 Endpoint: 2 IN (ASYNC) Rates: 96000
On Fri, Feb 22, 2008 at 3:57 PM, Clemens Ladisch clemens@ladisch.de wrote:
Adrian Stancu wrote:
Using the original module, the momentary frequency is always stalled at 48000Hz during playback: vader:~# while sleep 0.3; do grep "Momentary freq" /proc/asound/card1/stream0; done Momentary freq = 48000 Hz (0x6.0000) Momentary freq = 48000 Hz (0x6.0000) Momentary freq = 48000 Hz (0x6.0000) Momentary freq = 48000 Hz (0x6.0000) Momentary freq = 48000 Hz (0x6.0000)
note: I started playback after issuing the command. So maybe this particular type of interface does not report back correctly, thus confusing the driver?
This is possible. Please try to put printk's into retire_playback_sync_urb(_hs) to see whether these functions ever get called, and whether the line "subs->freqm = f;" is reached.
Please show the entire contents of /proc/asound/card1/stream0 while the device is playing.
Regards, Clemens
Adrian Stancu wrote:
It seems that retire_playback_sync_urb_hs gets called, but 'subs->feqm = f;' never gets called
Please try these printk's:
... spin_unlock_irqrestore(&subs->lock, flags); } else printk("invalid freq %u\n", f); } else printk("status %d len %u\n", urb->iso_frame_desc[0].status, urb->iso_frame_desc[0].actual_length);
return 0; }
Regards, Clemens
I got these results:
[...] status 0 len 0 status 0 len 0 status 0 len 0 status 0 len 0 status 0 len 0 invalid freq 3145728 status 0 len 0 status 0 len 0 status 0 len 0 [...]
additional note: freqn=393216, freqmax=401408, f=3145728
On Fri, Feb 22, 2008 at 4:43 PM, Clemens Ladisch clemens@ladisch.de wrote:
Adrian Stancu wrote:
It seems that retire_playback_sync_urb_hs gets called, but 'subs->feqm = f;' never gets called
Please try these printk's:
... spin_unlock_irqrestore(&subs->lock, flags); } else printk("invalid freq %u\n", f); } else printk("status %d len %u\n", urb->iso_frame_desc[0].status, urb->iso_frame_desc[0].actual_length); return 0;
}
Regards, Clemens
Hi list,
I'm working with ASoC layer for arm AT91. I'd like to trace sound datas right before they are transmitted to dma.
Buffer pointer seems to be prtd->period_ptr. Is there any way to read datas from this pointer ?
Thanks in advance.
Regards, Alex.
Adrian Stancu wrote:
I got these results:
invalid freq 3145728
How often does this message appear?
To convert to Hz, multiply by 1000/65536 (full speed) or 8000/65536 (high speed).
3145728 * 1000/65536 = 48000
freqn=393216, freqmax=401408
These values would be correct for high speed.
Is this device running at full speed or high speed? Please show the output of "lsusb -v" for this device.
Regards, Clemens
According to dmesg, the device is running at high speed:
usb 1-6: new high speed USB device using ehci_hcd and address 20 usb 1-6: configuration #1 chosen from 1 choice usbcore: registered new interface driver snd-usb-audio
So, if I convert the freq using the high speed formula, I get a value within the acceptable range, that would actually have an effect.
regarding the 'invalid freq' message, it seems to appear about 30 times per second: vader:~# dmesg -c [...play about 10 sec of audio] vader:~# dmesg | wc -l 331 (during those 10 seconds, there were only 'invalid freq' messages generated)
vader:~# lsusb -s 1:20 -v
Bus 001 Device 020: ID 041e:3f04 Creative Technology, Ltd Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 239 Miscellaneous Device bDeviceSubClass 2 ? bDeviceProtocol 1 Interface Association bMaxPacketSize0 64 idVendor 0x041e Creative Technology, Ltd idProduct 0x3f04 bcdDevice 1.00 iManufacturer 1 E-MU Systems, Inc. iProduct 2 E-MU 0404 | USB iSerial 3 E-MU-B0-3F04-07D70C0C-07E7D-STATION02 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 1832 bNumInterfaces 4 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xc0 Self Powered MaxPower 2mA Interface Association: bLength 8 bDescriptorType 11 bFirstInterface 0 bInterfaceCount 4 bFunctionClass 255 Vendor Specific Class bFunctionSubClass 255 Vendor Specific Subclass bFunctionProtocol 255 Vendor Specific Protocol iFunction 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 1 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 0b 24 01 00 01 bf 00 03 01 02 03 ** UNRECOGNIZED: 0c 24 02 01 01 01 00 04 33 00 00 00 ** UNRECOGNIZED: 11 24 06 04 01 02 01 00 02 00 02 00 02 00 02 00 00 ** UNRECOGNIZED: 0c 24 02 02 01 06 00 02 03 00 00 00 ** UNRECOGNIZED: 0c 24 02 03 02 06 00 02 03 00 00 00 ** UNRECOGNIZED: 0f 24 08 0e 03 e3 01 03 04 33 00 00 01 1f 00 ** UNRECOGNIZED: 0e 24 04 0b 02 04 0e 04 33 00 00 00 00 00 ** UNRECOGNIZED: 11 24 04 05 03 04 02 0e 04 33 00 00 00 00 00 00 00 ** UNRECOGNIZED: 0f 24 08 0c 01 e3 01 05 04 33 00 00 01 07 00 ** UNRECOGNIZED: 0f 24 08 0d 02 e3 01 0c 04 33 00 00 01 03 00 ** UNRECOGNIZED: 0f 24 08 0f 04 e3 01 0d 04 33 00 00 01 07 00 ** UNRECOGNIZED: 09 24 03 08 01 03 00 0f 00 ** UNRECOGNIZED: 09 24 03 07 02 03 00 0f 00 ** UNRECOGNIZED: 09 24 03 09 02 06 00 0f 00 ** UNRECOGNIZED: 09 24 03 0a 01 01 00 0b 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x83 EP 3 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0002 1x 2 bytes bInterval 10 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 1 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 01 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 44 ac 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0112 1x 274 bytes bInterval 4 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 17 Transfer Type Isochronous Synch Type None Usage Type Feedback wMaxPacketSize 0x0004 1x 4 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 2 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 01 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 44 ac 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x008e 1x 142 bytes bInterval 3 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 17 Transfer Type Isochronous Synch Type None Usage Type Feedback wMaxPacketSize 0x0004 1x 4 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 3 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 01 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 80 bb 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x012a 1x 298 bytes bInterval 4 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 17 Transfer Type Isochronous Synch Type None Usage Type Feedback wMaxPacketSize 0x0004 1x 4 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 4 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 01 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 80 bb 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x009a 1x 154 bytes bInterval 3 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 17 Transfer Type Isochronous Synch Type None Usage Type Feedback wMaxPacketSize 0x0004 1x 4 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 5 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 01 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 88 58 01 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x021a 1x 538 bytes bInterval 4 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 17 Transfer Type Isochronous Synch Type None Usage Type Feedback wMaxPacketSize 0x0004 1x 4 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 6 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 01 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 88 58 01 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0112 1x 274 bytes bInterval 3 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 17 Transfer Type Isochronous Synch Type None Usage Type Feedback wMaxPacketSize 0x0004 1x 4 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 7 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 01 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 00 77 01 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x024a 1x 586 bytes bInterval 4 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 17 Transfer Type Isochronous Synch Type None Usage Type Feedback wMaxPacketSize 0x0004 1x 4 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 8 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 01 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 00 77 01 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x012a 1x 298 bytes bInterval 3 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 17 Transfer Type Isochronous Synch Type None Usage Type Feedback wMaxPacketSize 0x0004 1x 4 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 9 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 01 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 10 b1 02 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x021a 1x 538 bytes bInterval 3 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 17 Transfer Type Isochronous Synch Type None Usage Type Feedback wMaxPacketSize 0x0004 1x 4 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 10 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 01 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 00 ee 02 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x024a 1x 586 bytes bInterval 3 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 17 Transfer Type Isochronous Synch Type None Usage Type Feedback wMaxPacketSize 0x0004 1x 4 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 11 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 01 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 04 03 18 01 44 ac 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0220 1x 544 bytes bInterval 4 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 17 Transfer Type Isochronous Synch Type None Usage Type Feedback wMaxPacketSize 0x0004 1x 4 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 12 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 01 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 04 03 18 01 44 ac 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0118 1x 280 bytes bInterval 3 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 17 Transfer Type Isochronous Synch Type None Usage Type Feedback wMaxPacketSize 0x0004 1x 4 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 13 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 01 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 04 03 18 01 80 bb 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0250 1x 592 bytes bInterval 4 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 17 Transfer Type Isochronous Synch Type None Usage Type Feedback wMaxPacketSize 0x0004 1x 4 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 14 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 01 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 04 03 18 01 80 bb 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0130 1x 304 bytes bInterval 3 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 17 Transfer Type Isochronous Synch Type None Usage Type Feedback wMaxPacketSize 0x0004 1x 4 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 15 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 01 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 04 03 18 01 88 58 01 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0220 1x 544 bytes bInterval 3 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 17 Transfer Type Isochronous Synch Type None Usage Type Feedback wMaxPacketSize 0x0004 1x 4 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 16 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 01 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 04 03 18 01 00 77 01 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0250 1x 592 bytes bInterval 3 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 17 Transfer Type Isochronous Synch Type None Usage Type Feedback wMaxPacketSize 0x0004 1x 4 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 17 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 01 00 01 20 ** UNRECOGNIZED: 0b 24 02 03 02 02 10 01 44 ac 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x00b8 1x 184 bytes bInterval 4 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 17 Transfer Type Isochronous Synch Type None Usage Type Feedback wMaxPacketSize 0x0004 1x 4 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 18 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 01 00 01 20 ** UNRECOGNIZED: 0b 24 02 03 02 02 10 01 80 bb 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x00c8 1x 200 bytes bInterval 4 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 17 Transfer Type Isochronous Synch Type None Usage Type Feedback wMaxPacketSize 0x0004 1x 4 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 1 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 0a 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 44 ac 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 37 Transfer Type Isochronous Synch Type Asynchronous Usage Type Implicit feedback Data wMaxPacketSize 0x0112 1x 274 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 2 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 0a 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 44 ac 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 37 Transfer Type Isochronous Synch Type Asynchronous Usage Type Implicit feedback Data wMaxPacketSize 0x008e 1x 142 bytes bInterval 3 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 3 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 0a 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 80 bb 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 37 Transfer Type Isochronous Synch Type Asynchronous Usage Type Implicit feedback Data wMaxPacketSize 0x012a 1x 298 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 4 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 0a 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 80 bb 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 37 Transfer Type Isochronous Synch Type Asynchronous Usage Type Implicit feedback Data wMaxPacketSize 0x009a 1x 154 bytes bInterval 3 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 5 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 0a 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 88 58 01 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 37 Transfer Type Isochronous Synch Type Asynchronous Usage Type Implicit feedback Data wMaxPacketSize 0x021a 1x 538 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 6 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 0a 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 88 58 01 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 37 Transfer Type Isochronous Synch Type Asynchronous Usage Type Implicit feedback Data wMaxPacketSize 0x0112 1x 274 bytes bInterval 3 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 7 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 0a 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 00 77 01 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 37 Transfer Type Isochronous Synch Type Asynchronous Usage Type Implicit feedback Data wMaxPacketSize 0x024a 1x 586 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 8 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 0a 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 00 77 01 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 37 Transfer Type Isochronous Synch Type Asynchronous Usage Type Implicit feedback Data wMaxPacketSize 0x012a 1x 298 bytes bInterval 3 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 9 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 0a 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 10 b1 02 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 37 Transfer Type Isochronous Synch Type Asynchronous Usage Type Implicit feedback Data wMaxPacketSize 0x021a 1x 538 bytes bInterval 3 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 10 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 0a 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 02 03 18 01 00 ee 02 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 37 Transfer Type Isochronous Synch Type Asynchronous Usage Type Implicit feedback Data wMaxPacketSize 0x024a 1x 586 bytes bInterval 3 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 11 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 0a 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 04 03 18 01 44 ac 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 37 Transfer Type Isochronous Synch Type Asynchronous Usage Type Implicit feedback Data wMaxPacketSize 0x0220 1x 544 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 12 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 0a 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 04 03 18 01 44 ac 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 37 Transfer Type Isochronous Synch Type Asynchronous Usage Type Implicit feedback Data wMaxPacketSize 0x0118 1x 280 bytes bInterval 3 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 13 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 0a 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 04 03 18 01 80 bb 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 37 Transfer Type Isochronous Synch Type Asynchronous Usage Type Implicit feedback Data wMaxPacketSize 0x0250 1x 592 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 14 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 0a 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 04 03 18 01 80 bb 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 37 Transfer Type Isochronous Synch Type Asynchronous Usage Type Implicit feedback Data wMaxPacketSize 0x0130 1x 304 bytes bInterval 3 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 15 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 0a 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 04 03 18 01 88 58 01 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 37 Transfer Type Isochronous Synch Type Asynchronous Usage Type Implicit feedback Data wMaxPacketSize 0x0220 1x 544 bytes bInterval 3 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 16 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 0a 00 01 00 ** UNRECOGNIZED: 0b 24 02 01 04 03 18 01 00 77 01 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 37 Transfer Type Isochronous Synch Type Asynchronous Usage Type Implicit feedback Data wMaxPacketSize 0x0250 1x 592 bytes bInterval 3 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 3 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 3 bInterfaceProtocol 0 iInterface 0 ** UNRECOGNIZED: 07 24 01 00 01 25 00 ** UNRECOGNIZED: 06 24 02 01 01 00 ** UNRECOGNIZED: 06 24 02 02 02 00 ** UNRECOGNIZED: 09 24 03 01 03 01 02 01 00 ** UNRECOGNIZED: 09 24 03 02 04 01 01 01 00 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x05 EP 5 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 1 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x85 EP 5 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 1 Device Qualifier (for other device speed): bLength 10 bDescriptorType 6 bcdUSB 2.00 bDeviceClass 239 Miscellaneous Device bDeviceSubClass 2 ? bDeviceProtocol 1 Interface Association bMaxPacketSize0 64 bNumConfigurations 1 Device Status: 0x0001 Self Powered
On Fri, Feb 22, 2008 at 5:50 PM, Clemens Ladisch clemens@ladisch.de wrote:
Adrian Stancu wrote:
I got these results:
invalid freq 3145728
How often does this message appear?
To convert to Hz, multiply by 1000/65536 (full speed) or 8000/65536 (high speed).
3145728 * 1000/65536 = 48000
freqn=393216, freqmax=401408
These values would be correct for high speed.
Is this device running at full speed or high speed? Please show the output of "lsusb -v" for this device.
Regards, Clemens
Adrian Stancu wrote:
According to dmesg, the device is running at high speed: usb 1-6: new high speed USB device using ehci_hcd and address 20
So, if I convert the freq using the high speed formula, I get a value within the acceptable range,
No; the device is high speed, but it sends a full speed feedback value.
Please try "subs->freqm = f / 8;"
The value quoted in your previous message was exactly 48000 Hz; please check if it ever changes.
Regards, Clemens
Yes!!! the feedback works correctly this way => perfect playback!
what I had to do was: [...] f = combine_quad((u8*)urb->transfer_buffer) & 0x0fffffff; f /= 8; if (f >= subs->freqn - subs->freqn / 8 && f <= subs->freqmax) { spin_lock_irqsave(&subs->lock, flags); subs->freqm = f; [...]
otherwise, the 'if' condition would still not be satisfied. Words can not describe how thankful I am about this one!
Now, is there a way to incorporate this change into the driver without affecting functionality for other usb audio devices?
On Fri, Feb 22, 2008 at 6:31 PM, Clemens Ladisch clemens@ladisch.de wrote:
Adrian Stancu wrote:
According to dmesg, the device is running at high speed: usb 1-6: new high speed USB device using ehci_hcd and address 20
So, if I convert the freq using the high speed formula, I get a value within the acceptable range,
No; the device is high speed, but it sends a full speed feedback value.
Please try "subs->freqm = f / 8;"
The value quoted in your previous message was exactly 48000 Hz; please check if it ever changes.
Regards, Clemens
forgot to mention:
vader:~# while sleep 0.05; do grep "Momentary freq" /proc/asound/card1/stream0 >> out; done
vader:~# cat out | sort | uniq -c 1272 Momentary freq = 48000 Hz (0x6.0000) 7 Momentary freq = 48063 Hz (0x6.0200) vader:~#
On Fri, Feb 22, 2008 at 6:46 PM, Adrian Stancu adrian.stancu.82@gmail.com wrote:
Yes!!! the feedback works correctly this way => perfect playback!
what I had to do was: [...] f = combine_quad((u8*)urb->transfer_buffer) & 0x0fffffff; f /= 8; if (f >= subs->freqn - subs->freqn / 8 && f <= subs->freqmax) { spin_lock_irqsave(&subs->lock, flags); subs->freqm = f; [...]
otherwise, the 'if' condition would still not be satisfied. Words can not describe how thankful I am about this one!
Now, is there a way to incorporate this change into the driver without affecting functionality for other usb audio devices?
On Fri, Feb 22, 2008 at 6:31 PM, Clemens Ladisch clemens@ladisch.de wrote:
Adrian Stancu wrote:
According to dmesg, the device is running at high speed: usb 1-6: new high speed USB device using ehci_hcd and address 20
So, if I convert the freq using the high speed formula, I get a value within the acceptable range,
No; the device is high speed, but it sends a full speed feedback value.
Please try "subs->freqm = f / 8;"
The value quoted in your previous message was exactly 48000 Hz; please check if it ever changes.
Regards, Clemens
Adrian Stancu wrote:
Yes!!! the feedback works correctly this way => perfect playback!
what I had to do was: [...] f = combine_quad((u8*)urb->transfer_buffer) & 0x0fffffff; f /= 8; if (f >= subs->freqn - subs->freqn / 8 && f <= subs->freqmax) { spin_lock_irqsave(&subs->lock, flags); subs->freqm = f; [...]
otherwise, the 'if' condition would still not be satisfied.
Oops. Of course.
Now, is there a way to incorporate this change into the driver without affecting functionality for other usb audio devices?
I'll write a quirk.
Regards, Clemens
OK!
I *think* the 0202 USB is also in the same situation. Thank you again!
Best regards, Adi
On Fri, Feb 22, 2008 at 7:01 PM, Clemens Ladisch clemens@ladisch.de wrote:
Adrian Stancu wrote:
Yes!!! the feedback works correctly this way => perfect playback!
what I had to do was: [...] f = combine_quad((u8*)urb->transfer_buffer) & 0x0fffffff; f /= 8; if (f >= subs->freqn - subs->freqn / 8 && f <= subs->freqmax) { spin_lock_irqsave(&subs->lock, flags); subs->freqm = f; [...]
otherwise, the 'if' condition would still not be satisfied.
Oops. Of course.
Now, is there a way to incorporate this change into the driver without affecting functionality for other usb audio devices?
I'll write a quirk.
Regards, Clemens
Adrian Stancu wrote:
I *think* the 0202 USB is also in the same situation.
OK, I made a quirk for both: http://hg.alsa-project.org/alsa-kernel/rev/247195dfda43
Please also test with a sample format where packets are sent every four microframes, i.e., > 96 kHz.
Regards, Clemens
Hi,
Thanks for the update. I tested your patch and 44.1kHz, 48kHz and 96kHz seem to work correctly. Unfortunately, I am not able to test any rate higher than 96kHz, because I cannot modify this interface's sampling rate under Linux (and if I modify it on another computer [a virtual machine], the interface will reset to 44.1kHz whenever I "unplug the USB cable" AND it is set to a rate higher than 96kHz).
I don't know if there's any way around this, but I currently don't see any way of using this interface at >96kHz in Linux.
Best regards, Adi
On Mon, Feb 25, 2008 at 2:44 PM, Clemens Ladisch clemens@ladisch.de wrote:
Adrian Stancu wrote:
I *think* the 0202 USB is also in the same situation.
OK, I made a quirk for both: http://hg.alsa-project.org/alsa-kernel/rev/247195dfda43
Please also test with a sample format where packets are sent every four microframes, i.e., > 96 kHz.
Regards, Clemens
Thanks,
Here is what i get: deathu@vader:~/Desktop$ sox testtone96.wav -r 192000 testtone192.wav deathu@vader:~/Desktop$ aplay -D hw:1 testtone192.wav Playing WAVE 'testtone192.wav' : Signed 16 bit Little Endian, Rate 192000 Hz, Mono aplay: set_params:918: Sample format non available
If i do this: deathu@vader:~/Desktop$ aplay -D plughw:1 testtone192.wav Playing WAVE 'testtone192.wav' : Signed 16 bit Little Endian, Rate 192000 Hz, Mono I receive totally damaged audio (wrong frequency, lots of artifacts)
Note: I wasn't ever able to use hw:1 or hw:1,0 as output for this interface, only plughw:1,0
On Tue, Feb 26, 2008 at 9:32 AM, Clemens Ladisch clemens@ladisch.de wrote:
Adrian Stancu wrote:
I don't know if there's any way around this, but I currently don't see any way of using this interface at >96kHz in Linux.
sox something.wav -r 192000 something-192.wav aplay -D hw:1 something-192.wav
HTH Clemens
Adrian Stancu wrote:
deathu@vader:~/Desktop$ sox testtone96.wav -r 192000 testtone192.wav deathu@vader:~/Desktop$ aplay -D hw:1 testtone192.wav Playing WAVE 'testtone192.wav' : Signed 16 bit Little Endian, Rate 192000 Hz, Mono aplay: set_params:918: Sample format non available
The device doesn't support mono. Try "sox testtone96.wav -r 192000 -c 2 testtone192.wav".
I receive totally damaged audio (wrong frequency, lots of artifacts)
What frequency? What is shown /proc/asound/card1/stream0 while playing this file? Does something similar happen with a four-channel 96 kHz file? ("sox testtone96.wav -c 4 testtone4.wav")
Regards, Clemens
OK, I tried playing the stereo file but still getting the same error: deathu@vader:~/Desktop$ aplay -D hw:1 testtone192.wav Playing WAVE 'testtone192.wav' : Signed 16 bit Little Endian, Rate 192000 Hz, Stereo aplay: set_params:918: Sample format non available
For the four channel 96kHz file, aplay complains that it's not in PCM format. deathu@vader:~/Desktop$ aplay -D hw:1 testtone4.wav aplay: test_wavefile:749: can't play not PCM-coded WAVE-files
Well, my test file contained a single constant frequency tone; it is still there while I play the 192k file through plughw:1,0, but burried under: - periodic series of clicks - other high frequency tones
Here is /proc/asound/card1/stream0 while playing through plughw:1,0: E-MU Systems, Inc. E-MU 0404 | USB at usb-0000:00:1d.7-6, high speed : USB Audio
Playback: Status: Running Interface = 1 Altset = 10 URBs = 8 [ 16 16 16 16 16 16 16 16 ] Packet Size = 586 Momentary freq = 192000 Hz (0x18.0000) Interface 1 Altset 1 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 44100 Interface 1 Altset 2 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 44100 Interface 1 Altset 3 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 48000 Interface 1 Altset 4 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 48000 Interface 1 Altset 5 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 88200 Interface 1 Altset 6 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 88200 Interface 1 Altset 7 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 96000 Interface 1 Altset 8 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 96000 Interface 1 Altset 9 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 176400 Interface 1 Altset 10 Format: 0x20 Channels: 2 Endpoint: 1 OUT (ASYNC) Rates: 192000 Interface 1 Altset 11 Format: 0x20 Channels: 4 Endpoint: 1 OUT (ASYNC) Rates: 44100 Interface 1 Altset 12 Format: 0x20 Channels: 4 Endpoint: 1 OUT (ASYNC) Rates: 44100 Interface 1 Altset 13 Format: 0x20 Channels: 4 Endpoint: 1 OUT (ASYNC) Rates: 48000 Interface 1 Altset 14 Format: 0x20 Channels: 4 Endpoint: 1 OUT (ASYNC) Rates: 48000 Interface 1 Altset 15 Format: 0x20 Channels: 4 Endpoint: 1 OUT (ASYNC) Rates: 88200 Interface 1 Altset 16 Format: 0x20 Channels: 4 Endpoint: 1 OUT (ASYNC) Rates: 96000
Capture: Status: Stop Interface 2 Altset 1 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 44100 Interface 2 Altset 2 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 44100 Interface 2 Altset 3 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 48000 Interface 2 Altset 4 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 48000 Interface 2 Altset 5 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 88200 Interface 2 Altset 6 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 88200 Interface 2 Altset 7 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 96000 Interface 2 Altset 8 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 96000 Interface 2 Altset 9 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 176400 Interface 2 Altset 10 Format: 0x20 Channels: 2 Endpoint: 2 IN (ASYNC) Rates: 192000 Interface 2 Altset 11 Format: 0x20 Channels: 4 Endpoint: 2 IN (ASYNC) Rates: 44100 Interface 2 Altset 12 Format: 0x20 Channels: 4 Endpoint: 2 IN (ASYNC) Rates: 44100 Interface 2 Altset 13 Format: 0x20 Channels: 4 Endpoint: 2 IN (ASYNC) Rates: 48000 Interface 2 Altset 14 Format: 0x20 Channels: 4 Endpoint: 2 IN (ASYNC) Rates: 48000 Interface 2 Altset 15 Format: 0x20 Channels: 4 Endpoint: 2 IN (ASYNC) Rates: 88200 Interface 2 Altset 16 Format: 0x20 Channels: 4 Endpoint: 2 IN (ASYNC) Rates: 96000
On Tue, Feb 26, 2008 at 10:14 AM, Clemens Ladisch clemens@ladisch.de wrote:
Adrian Stancu wrote:
deathu@vader:~/Desktop$ sox testtone96.wav -r 192000 testtone192.wav deathu@vader:~/Desktop$ aplay -D hw:1 testtone192.wav Playing WAVE 'testtone192.wav' : Signed 16 bit Little Endian, Rate 192000 Hz, Mono aplay: set_params:918: Sample format non available
The device doesn't support mono. Try "sox testtone96.wav -r 192000 -c 2 testtone192.wav".
I receive totally damaged audio (wrong frequency, lots of artifacts)
What frequency? What is shown /proc/asound/card1/stream0 while playing this file? Does something similar happen with a four-channel 96 kHz file? ("sox testtone96.wav -c 4 testtone4.wav")
Regards, Clemens
Adrian Stancu wrote:
OK, I tried playing the stereo file but still getting the same error: deathu@vader:~/Desktop$ aplay -D hw:1 testtone192.wav Playing WAVE 'testtone192.wav' : Signed 16 bit Little Endian, Rate 192000 Hz, Stereo aplay: set_params:918: Sample format non available
Oops, the device supports only 24-bit samples, and this isn't supported by .wav files, so using hw:1 won't ever work with aply.
Well, my test file contained a single constant frequency tone; it is still there while I play the 192k file through plughw:1,0, but burried under:
- periodic series of clicks
- other high frequency tones
Here is /proc/asound/card1/stream0 while playing through plughw:1,0: ... Momentary freq = 192000 Hz (0x18.0000)
Does this value ever change? Could you again try inserting a printk to see whether the driver thinks it gets invalid frequency values?
Regards, Clemens
This time, the driver does not consider the feedback frequencies invalid. What I did was: f = combine_quad((u8*)urb->transfer_buffer) & 0x0fffffff; printk("freqn=%u, freqmax=%u, f=%u, dataint=%u\n", subs->freqn, subs->freqmax, f, subs->datainterval); f >>= subs->datainterval; if (f >= subs->freqn - subs->freqn / 8 && f <= subs->freqmax) { spin_lock_irqsave(&subs->lock, flags); subs->freqm = f; printk("f=%u assigned!", f); spin_unlock_irqrestore(&subs->lock, flags);
And what I got: f=1572864 assigned!freqn=1572864, freqmax=1589248, f=6291456, dataint=2 f=1572864 assigned!freqn=1572864, freqmax=1589248, f=6291456, dataint=2 f=1572864 assigned!freqn=1572864, freqmax=1589248, f=6291456, dataint=2
However, the feedback value does not seem to ever change.
I wanted to mention that (from what I noticed until now), it is not possible to get correct playback on this device unless the sampling frequency it is set to (it defaults to 48k when powered on) matches the sampling frequency of the audio stream you send to it. So how is this supposed to work, if the device is set to 48k and my stream has 192k (and I cannot set the device to 192k)?
On Tue, Feb 26, 2008 at 10:49 AM, Clemens Ladisch clemens@ladisch.de wrote:
Adrian Stancu wrote:
OK, I tried playing the stereo file but still getting the same error: deathu@vader:~/Desktop$ aplay -D hw:1 testtone192.wav Playing WAVE 'testtone192.wav' : Signed 16 bit Little Endian, Rate 192000 Hz, Stereo aplay: set_params:918: Sample format non available
Oops, the device supports only 24-bit samples, and this isn't supported by .wav files, so using hw:1 won't ever work with aply.
Well, my test file contained a single constant frequency tone; it is still there while I play the 192k file through plughw:1,0, but burried under:
- periodic series of clicks
- other high frequency tones
Here is /proc/asound/card1/stream0 while playing through plughw:1,0: ...
Momentary freq = 192000 Hz (0x18.0000)
Does this value ever change? Could you again try inserting a printk to see whether the driver thinks it gets invalid frequency values?
Regards, Clemens
Adrian Stancu wrote:
I wanted to mention that (from what I noticed until now), it is not possible to get correct playback on this device unless the sampling frequency it is set to (it defaults to 48k when powered on) matches the sampling frequency of the audio stream you send to it. So how is this supposed to work, if the device is set to 48k and my stream has 192k (and I cannot set the device to 192k)?
The alternate setting of the interface is supposed to set the sampling frequency, and this is exactly what the driver does.
The returned frequency value is correct, so it seems the device knows that it is supposed to run at 192 kHz.
Does recording work with all sample rates?
Regards, Clemens
I see, you say that the device knows what sample rate it is supposed to use, and that this rate should be automatically used. However, in practice, I guess this does not happen for some reason. For the recording part, the things stay exactly like for playback, i.e. the recorded sound is correct as long as the device is (manually, through another OS) set to the sampling rate at which the recording is made.
Let me give a few examples: 1) I power on the device, and it automatically picks 48k. If i try playing back something at any other rate (44.1k, 96k etc), the sound is very distorted. 2) I logically connect the device to the virtual machine, set the sampling rate to 96k through the creative supplied drivers, disconnect (WITHOUT powering it off), reload the snd-usb-audio module in Linux. Now, I can achieve correct playback only at 96k. Anything else is distorted. Of course, I can resample anything on-the-fly (through additional device in ~/.asoundrc) to match the sampling rate of the device and get normal sound.
As an additional note, recording at 192k seems *completely* broken. I mean, If I record at 96k while the device was just powered on (i.e. set to 48k), there is still a connection between the original and the recorded sounds. However, at 192k, it looks just like pure noise, at maximum amplitude. Details: http://img147.imageshack.us/my.php?image=recat96kdeviceat48kkt3.jpg -- recorded at 96kHz http://img81.imageshack.us/my.php?image=recat192kdeviceat48kii7.jpg -- recorded at 192kHz In both cases, the sound fed to the input was a simple 41.2Hz tone.
On Tue, Feb 26, 2008 at 1:36 PM, Clemens Ladisch clemens@ladisch.de wrote:
Adrian Stancu wrote:
I wanted to mention that (from what I noticed until now), it is not possible to get correct playback on this device unless the sampling frequency it is set to (it defaults to 48k when powered on) matches the sampling frequency of the audio stream you send to it. So how is this supposed to work, if the device is set to 48k and my stream has 192k (and I cannot set the device to 192k)?
The alternate setting of the interface is supposed to set the sampling frequency, and this is exactly what the driver does.
The returned frequency value is correct, so it seems the device knows that it is supposed to run at 192 kHz.
Does recording work with all sample rates?
Regards, Clemens
Adrian Stancu wrote:
I see, you say that the device knows what sample rate it is supposed to use, and that this rate should be automatically used.
Not automatically, the driver sets an alternate setting in set_format() by calling usb_set_interface().
... 2) I logically connect the device to the virtual machine, set the sampling rate to 96k through the creative supplied drivers,
Apparently, that driver uses some vendor-specific request to configure the device. To find out what exactly that driver does, you'd have to use a tool like usbsnoop to record the USB requests.
Regards, Clemens
OK, I undertand
First of all, I am very happy with the patch you wrote, that just solved the most annoying issue for me, that was the synchronization problem.
Second, I did as you instructed with the USB sniffer. I opened the emu control panel (the interface was set to 48kHz), saved the current log file (as log1), set the rate to 96kHz, again saved the current log file (as log2). I diff'ed the 2 files, resulting in a third section, 170 lines. If you are interested in debugging the rate control, I can attach the diff file (or the original logs, if necessary). Will this list allow mail attachments? Of course, I am willing to test anything you like, if you are willing to further debug this.
Thanks, Adi
On Tue, Feb 26, 2008 at 4:21 PM, Clemens Ladisch clemens@ladisch.de wrote:
Adrian Stancu wrote:
I see, you say that the device knows what sample rate it is supposed to use, and that this rate should be automatically used.
Not automatically, the driver sets an alternate setting in set_format() by calling usb_set_interface().
...
- I logically connect the device to the virtual machine, set the
sampling rate to 96k through the creative supplied drivers,
Apparently, that driver uses some vendor-specific request to configure the device. To find out what exactly that driver does, you'd have to use a tool like usbsnoop to record the USB requests.
Regards, Clemens
Hi,
just a quick note - when troubleshooting, I find the verbose mode of aplay -v -D plughw:0 invaluable. In verbose mode the plug plugin prints all the conversions it is doing with the input signal.
Good luck,
Pavel.
Adrian Stancu napsal(a):
Thanks,
Here is what i get: deathu@vader:~/Desktop$ sox testtone96.wav -r 192000 testtone192.wav deathu@vader:~/Desktop$ aplay -D hw:1 testtone192.wav Playing WAVE 'testtone192.wav' : Signed 16 bit Little Endian, Rate 192000 Hz, Mono aplay: set_params:918: Sample format non available
If i do this: deathu@vader:~/Desktop$ aplay -D plughw:1 testtone192.wav Playing WAVE 'testtone192.wav' : Signed 16 bit Little Endian, Rate 192000 Hz, Mono I receive totally damaged audio (wrong frequency, lots of artifacts)
Note: I wasn't ever able to use hw:1 or hw:1,0 as output for this interface, only plughw:1,0
On Tue, Feb 26, 2008 at 9:32 AM, Clemens Ladisch clemens@ladisch.de wrote:
Adrian Stancu wrote:
I don't know if there's any way around this, but I currently don't see any way of using this interface at >96kHz in Linux.
sox something.wav -r 192000 something-192.wav aplay -D hw:1 something-192.wav
HTH Clemens
Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
participants (4)
-
Adrian Stancu
-
Alexandre BOUIN
-
Clemens Ladisch
-
Pavel Hofman