Re: Scratchy playback issue with USB CLASS2 audio device

2013-10-19 Thread Taner
Hi,

I modified uaudio.c according to your patch but it didn't make any
difference. I'm running 10.0-stable. It doesn't matter with vchan
adaptive/fixed or bitperfect settings. Behavior is same. I don't know how
to read usbdump output thus I'm mailing 5 sec. playback output file to you
(1.5MB zipped). It captured while vchan at 16bit/48Khz.

I keen on any other suggestion from you. I don't know why but sound quality
is obviously better in FreeBSD despite this playback issue still remains.

Regards,
Taner


On Sat, Oct 19, 2013 at 9:42 AM, Hans Petter Selasky wrote:

> On 10/19/13 08:35, Hans Petter Selasky wrote:
>
>> On 10/19/13 07:46, Taner wrote:
>>
>>> uaudio_chan_play_sync_**callback: Value = 0x0005fff8
>>> uaudio_chan_play_sync_**callback: Comparing 47998 < 48000
>>> uaudio_chan_play_sync_**callback: Value = 0x0005fff6
>>> uaudio_chan_play_sync_**callback: Comparing 47998 < 48000
>>>
>>
>> Hi,
>>
>> The normal for adaptive rates is that this value should tilt just above
>> or below the 48000 or whatever is there. Else something is wrong.
>>
>> Did you try to record while playing?
>>
>> Also, are you running -stable?
>>
>> Could also check the amount of samples sent by using
>> "usbdump -i usbusX -f Y -s 65536 -vvv"
>>
>> --HPS
>>
>
> Hi,
>
> Does this patch make any difference?
>
> === dev/sound/usb/uaudio.c
> ==**==**==
> --- dev/sound/usb/uaudio.c  (revision 256754)
> +++ dev/sound/usb/uaudio.c  (local)
> @@ -2070,7 +2070,7 @@
> chn_intr(ch->pcm_ch);
>
> /* start SYNC transfer, if any */
> -   if ((ch->last_sync_time++ & 7) == 0)
> +   if ((ch->last_sync_time++ & 3) == 0)
> usbd_transfer_start(ch->xfer[**UAUDIO_NCHANBUFS]);
>
> case USB_ST_SETUP:
>
> --HPS
>
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: Scratchy playback issue with USB CLASS2 audio device

2013-10-18 Thread Hans Petter Selasky

On 10/19/13 08:35, Hans Petter Selasky wrote:

On 10/19/13 07:46, Taner wrote:

uaudio_chan_play_sync_callback: Value = 0x0005fff8
uaudio_chan_play_sync_callback: Comparing 47998 < 48000
uaudio_chan_play_sync_callback: Value = 0x0005fff6
uaudio_chan_play_sync_callback: Comparing 47998 < 48000


Hi,

The normal for adaptive rates is that this value should tilt just above
or below the 48000 or whatever is there. Else something is wrong.

Did you try to record while playing?

Also, are you running -stable?

Could also check the amount of samples sent by using
"usbdump -i usbusX -f Y -s 65536 -vvv"

--HPS


Hi,

Does this patch make any difference?

=== dev/sound/usb/uaudio.c
==
--- dev/sound/usb/uaudio.c  (revision 256754)
+++ dev/sound/usb/uaudio.c  (local)
@@ -2070,7 +2070,7 @@
chn_intr(ch->pcm_ch);

/* start SYNC transfer, if any */
-   if ((ch->last_sync_time++ & 7) == 0)
+   if ((ch->last_sync_time++ & 3) == 0)
usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]);

case USB_ST_SETUP:

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: Scratchy playback issue with USB CLASS2 audio device

2013-10-18 Thread Hans Petter Selasky

On 10/19/13 07:46, Taner wrote:

uaudio_chan_play_sync_callback: Value = 0x0005fff8
uaudio_chan_play_sync_callback: Comparing 47998 < 48000
uaudio_chan_play_sync_callback: Value = 0x0005fff6
uaudio_chan_play_sync_callback: Comparing 47998 < 48000


Hi,

The normal for adaptive rates is that this value should tilt just above 
or below the 48000 or whatever is there. Else something is wrong.


Did you try to record while playing?

Also, are you running -stable?

Could also check the amount of samples sent by using
"usbdump -i usbusX -f Y -s 65536 -vvv"

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Scratchy playback issue with USB CLASS2 audio device

2013-10-18 Thread Taner
Hi,

I'm trying to solve scratchy (as like as scratched vinyl records) playback
issue with my Amanero Asyncronous USB to I2S interface (http://amanero.com/)
on a amd64 FreeBSD-10-BETA1 system.

Amanero is a 2 channels high speed usb class2 audio device which capable of
accepting up to 32bit 384khz data format. I haven't similar issues with
other operating systems.

I played with many sysctl setting combinations including:

dev.pcm.0.play.vchanmode=fixed/adaptive
dev.pcm.0.play.vchanformat:s32le:2.0
dev.pcm.0.play.vchans=0
dev.pcm.0.bitperfect:1
etc.

With enabling debug, lots of these error messages appear on dmesg output:

uaudio_chan_play_sync_callback: Value = 0x0005fff8
uaudio_chan_play_sync_callback: Comparing 47998 < 48000
uaudio_chan_play_sync_callback: Value = 0x0005fff6
uaudio_chan_play_sync_callback: Comparing 47998 < 48000

or

uaudio_chan_play_sync_callback: Value = 0x000bfff0
uaudio_chan_play_sync_callback: Comparing 95997 < 96000
uaudio_chan_play_sync_callback: Value = 0x000bfff0
uaudio_chan_play_sync_callback: Comparing 95997 < 96000

---> dmesg output while device attached

uaudio0: at uhub1, port 3, addr 1 (disconnected)
pcm0: detached
uaudio0:  on usbus0
uaudio0: Play: 96000 Hz, 2 ch, 32-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Play: 88200 Hz, 2 ch, 32-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Play: 48000 Hz, 2 ch, 32-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Play: 44100 Hz, 2 ch, 32-bit S-LE PCM format, 2x8ms buffer.
uaudio0: Play: 32000 Hz, 2 ch, 32-bit S-LE PCM format, 2x8ms buffer.
uaudio0: No recording.
uaudio0: No MIDI sequencer.
pcm0:  on uaudio0
uaudio0: No HID volume keys found.

---> usbconfig -d 0.2 dump_all_config_desc

ugen0.2:  at usbus0, cfg=0 md=HOST
spd=HIGH (480Mbps) pwr=ON (128mA)


 Configuration index 0

bLength = 0x0009
bDescriptorType = 0x0002
wTotalLength = 0x00b0
bNumInterfaces = 0x0003
bConfigurationValue = 0x0001
iConfiguration = 0x0002  
bmAttributes = 0x0080
bMaxPower = 0x0040

Interface 0
  bLength = 0x0009
  bDescriptorType = 0x0004
  bInterfaceNumber = 0x
  bAlternateSetting = 0x
  bNumEndpoints = 0x0001
  bInterfaceClass = 0x00ff
  bInterfaceSubClass = 0x00ff
  bInterfaceProtocol = 0x
  iInterface = 0x  

 Endpoint 0
bLength = 0x0007
bDescriptorType = 0x0005
bEndpointAddress = 0x0002  
bmAttributes = 0x0002  
wMaxPacketSize = 0x0200
bInterval = 0x
bRefresh = 0x
bSynchAddress = 0x

  Additional Descriptor

  bLength = 0x08
  bDescriptorType = 0x0b
  bDescriptorSubType = 0x01
   RAW dump:
   0x00 | 0x08, 0x0b, 0x01, 0x02, 0x01, 0x00, 0x20, 0x00



Interface 1
  bLength = 0x0009
  bDescriptorType = 0x0004
  bInterfaceNumber = 0x0001
  bAlternateSetting = 0x
  bNumEndpoints = 0x
  bInterfaceClass = 0x0001
  bInterfaceSubClass = 0x0001
  bInterfaceProtocol = 0x0020
  iInterface = 0x  

  Additional Descriptor

  bLength = 0x09
  bDescriptorType = 0x24
  bDescriptorSubType = 0x01
   RAW dump:
   0x00 | 0x09, 0x24, 0x01, 0x00, 0x02, 0x01, 0x48, 0x00,
   0x08 | 0x00

  Additional Descriptor

  bLength = 0x08
  bDescriptorType = 0x24
  bDescriptorSubType = 0x0a
   RAW dump:
   0x00 | 0x08, 0x24, 0x0a, 0x29, 0x03, 0x07, 0x00, 0x02


  Additional Descriptor

  bLength = 0x08
  bDescriptorType = 0x24
  bDescriptorSubType = 0x0b
   RAW dump:
   0x00 | 0x08, 0x24, 0x0b, 0x28, 0x01, 0x29, 0x03, 0x02


  Additional Descriptor

  bLength = 0x11
  bDescriptorType = 0x24
  bDescriptorSubType = 0x02
   RAW dump:
   0x00 | 0x11, 0x24, 0x02, 0x2a, 0x01, 0x01, 0x00, 0x28,
   0x08 | 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x10 | 0x00

  Additional Descriptor

  bLength = 0x12
  bDescriptorType = 0x24
  bDescriptorSubType = 0x06
   RAW dump:
   0x00 | 0x12, 0x24, 0x06, 0x0a, 0x2a, 0x0f, 0x00, 0x00,
   0x08 | 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00,
   0x10 | 0x00, 0x00


  Additional Descriptor

  bLength = 0x0c
  bDescriptorType = 0x24
  bDescriptorSubType = 0x03
   RAW dump:
   0x00 | 0x0c, 0x24, 0x03, 0x2b, 0x01, 0x03, 0x00, 0x0a,
   0x08 | 0x28, 0x00, 0x00, 0x00



Interface 2
  bLength = 0x0009
  bDescriptorType = 0x0004
  bInterfaceNumber = 0x0002
  bAlternateSetting = 0x
  bNumEndpoints = 0x
  bInterfaceClass = 0x0001
  bInterfaceSubClass = 0x0002
  bInterfaceProtocol = 0x0020
  iInterface = 0x  


Interface 2 Alt 1
  bLength = 0x0009
  bDescriptorType = 0x0004
  bInterfaceNumber = 0x0002
  bAlternateSetting = 0x0001
  bNumEndpoints = 0x0002
  bInterfaceClass = 0x0001
  bInterfaceSubClass = 0x0002
  bInterfaceProtocol = 0x0020
  iInterface = 0x