Re: [Alsa-user] Latency

2013-04-10 Thread Clemens Ladisch
jon wrote:
 On Tue, 2013-04-09 at 21:59 +0200, Clemens Ladisch wrote:
 jon wrote:
 If I increase the bufchunks value I seem to get larger latency
 yet the latency values i'm reading always seem to be the same.

 Apparently, your program fills the buffer fast enough so that there
 are never too many frames available.  I'd guess that if your program
 gets delayed more, by its own computations, by scheduling delays, or
 by increasing the period time, you would see higher values.

 I'm not sure I understand that behaviour at all... I would expect ALSA
 to keep the buffer as full as possible not as empty ?

Please note that the number of available frames, as returned by
snd_pcm_avail(), is the number of sample that your application can write
to the buffer.  The number of frames available for the device to play is
the opposite of that.

 If I set the buffer length to say 100ms does ALSA not maintain a 100ms
 fill of the buffer only dropping if I don't send samples fast enough,
 then re-filling when I do - that is the behaviour I want (and would
 expect).

And that is exactly what happens.

 I am trying to cope with frequent short freezes (30ms or so) making
 buffer filling jittery. I want to maintain a cache of about 80ms between
 the ALSA write and my ears,

If that is what you call latency, then you must subtract the value
returned by snd_pcm_avail() from the buffer size.

 with ALSA using data from cache during the slower iterations of the
 fill loop. How can I do this ?

By using a buffer size of about 80 ms.


Regards,
Clemens

--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis  visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Status of CM6631 USB

2013-04-10 Thread chris hermansen
Torstein and list:

Wait!  this is still weird.  Please see at bottom...

On Wed, Apr 10, 2013 at 8:31 AM, chris hermansen clherman...@gmail.com wrote:
 Torstein, list:

 On Wed, Apr 10, 2013 at 2:32 AM, Torstein Hegge he...@resisty.net wrote:
 [...]
 What does dmesg / /var/log/kern.log say when you plug in the device with
 the v3.9-rc6 kernel?

 Hmm things are getting interesting.  Yesterday, when I had the problem
 with missing altset 2, as far as I can remember, I had plugged in the
 Schiit before booting and switched the Schiit to USB once booted.

 Today below I booted the machine, switched the Schiit to usb input,
 started up a terminal window, checked the kernel version, tailed the
 /var/log/kern.log, plugged the Schiit in, then checked the
 /proc/asound/Interface/stream0 file.

 Despite the error messages when plugging, it seems I have altset 2 back!

 clh@temuko:~$ uname -r
 3.9.0-030900rc6-generic
 clh@temuko:~$ tail -f /var/log/kern.log
 Apr 10 08:08:39 temuko kernel: [   21.818692] 8139too :02:03.0
 eth0: link down
 Apr 10 08:08:39 temuko kernel: [   21.818776] IPv6:
 ADDRCONF(NETDEV_UP): eth0: link is not ready
 Apr 10 08:08:44 temuko kernel: [   26.130144] wlan0: authenticate with
 20:76:00:0d:dd:00
 Apr 10 08:08:44 temuko kernel: [   26.135889] wlan0: send auth to
 20:76:00:0d:dd:00 (try 1/3)
 Apr 10 08:08:44 temuko kernel: [   26.137723] wlan0: authenticated
 Apr 10 08:08:44 temuko kernel: [   26.138252] ath5k :02:02.0
 wlan0: disabling HT/VHT due to WEP/TKIP use
 Apr 10 08:08:44 temuko kernel: [   26.140071] wlan0: associate with
 20:76:00:0d:dd:00 (try 1/3)
 Apr 10 08:08:44 temuko kernel: [   26.142175] wlan0: RX AssocResp from
 20:76:00:0d:dd:00 (capab=0x411 status=0 aid=3)
 Apr 10 08:08:44 temuko kernel: [   26.142630] wlan0: associated
 Apr 10 08:08:44 temuko kernel: [   26.142702] IPv6:
 ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

 (here I am plugging in the Schiit)

 Apr 10 08:11:15 temuko kernel: [  177.148055] usb 1-3: new high-speed
 USB device number 2 using ehci-pci
 Apr 10 08:11:15 temuko kernel: [  177.305718] usb 1-3: config 1
 interface 8 altsetting 0 bulk endpoint 0x1 has invalid maxpacket 64
 Apr 10 08:11:15 temuko kernel: [  177.305731] usb 1-3: config 1
 interface 8 altsetting 0 bulk endpoint 0x82 has invalid maxpacket 64
 Apr 10 08:11:15 temuko kernel: [  177.308176] usb 1-3: New USB device
 found, idVendor=0d8c, idProduct=0304
 Apr 10 08:11:15 temuko kernel: [  177.308187] usb 1-3: New USB device
 strings: Mfr=1, Product=2, SerialNumber=0
 Apr 10 08:11:15 temuko kernel: [  177.308197] usb 1-3: Product: Schiit
 USB Interface
 Apr 10 08:11:15 temuko kernel: [  177.308206] usb 1-3: Manufacturer: CMEDIA
 Apr 10 08:11:15 temuko kernel: [  177.694819] hidraw: raw HID events
 driver (C) Jiri Kosina
 Apr 10 08:11:15 temuko kernel: [  177.712517] 2:1:2: clock source 15
 is not valid, cannot use
 Apr 10 08:11:15 temuko kernel: [  177.743525] 2:2:2: clock source 16
 is not valid, cannot use
 Apr 10 08:11:15 temuko kernel: [  177.784388] 2:5:1: clock source 19
 is not valid, cannot use
 Apr 10 08:11:15 temuko kernel: [  177.788307] 2:5:2: clock source 19
 is not valid, cannot use
 Apr 10 08:11:15 temuko kernel: [  177.788858] cannot get ctl value:
 req = 0x83, wValue = 0x201, wIndex = 0x0, type = 4
 Apr 10 08:11:15 temuko kernel: [  177.791363] usbcore: registered new
 interface driver snd-usb-audio
 Apr 10 08:11:15 temuko kernel: [  177.849874] usbcore: registered new
 interface driver usbhid
 Apr 10 08:11:15 temuko kernel: [  177.849886] usbhid: USB HID core driver
 Apr 10 08:11:15 temuko kernel: [  177.897234] input: CMEDIA Schiit USB
 Interface as /devices/pci:00/:00:13.2/usb1/1-3/1-3:1.6/input/input7
 Apr 10 08:11:15 temuko kernel: [  177.897944] hid-generic
 0003:0D8C:0304.0001: input,hidraw0: USB HID v1.00 Device [CMEDIA
 Schiit USB Interface] on usb-:00:13.2-3/input6

 (ok that's all it's going to do I guess)

 ^C
 clh@temuko:~$ ls /proc/asound/Interface
 id  midi0  pcm0c  pcm0p  pcm1c  pcm1p  pcm2p  pcm3c  stream0  stream1
 stream2  stream3  usbbus  usbid  usbmixer
 clh@temuko:~$ cat !$/stream0
 cat /proc/asound/Interface/stream0
 CMEDIA Schiit USB Interface at usb-:00:13.2-3, high speed : USB Audio

 Playback:
   Status: Stop
   Interface 1
 Altset 1
 Format: S16_LE
 Channels: 2
 Endpoint: 5 OUT (ASYNC)
 Rates: 44100, 48000, 88200, 96000, 192000
 Data packet interval: 125 us
   Interface 1
 Altset 2
 Format: S32_LE
 Channels: 2
 Endpoint: 5 OUT (ASYNC)
 Rates: 44100, 48000, 88200, 96000, 192000
 Data packet interval: 125 us

 Capture:
   Status: Stop
   Interface 4
 Altset 1
 Format: S16_LE
 Channels: 2
 Endpoint: 8 IN (ASYNC)
 Rates: 44100, 48000, 88200, 96000, 192000
 Data packet interval: 125 us
   Interface 4
 Altset 2
 Format: S32_LE
 Channels: 2
 Endpoint: 8 IN (ASYNC)
 Rates: 44100, 48000, 88200, 96000, 192000
 Data packet interval: 125 

[Alsa-user] USB MIDI problem with receiving large sysex files

2013-04-10 Thread jem_7
Hello,

I am running openSUSE 12.2, 64bit (Kernel 3.4.33-2.24-desktop). ALSA version is 
1.0.26 according to YAST, but alsamixer reports 1.0.25.

Recently I encountered a problem with receiving large amounts of sysex data. 
The sysex data is sent from an effects processor called Fractal Audio Systems 
Axe-Fx II which also provides a USB MIDI interface. This device lets you dump 
single presets with 6.487 bytes and so called banks which are 830.336 bytes 
large. While the smaller preset dumps are received without any problem, the 
bank dumps never reach 830.336 bytes. The number of bytes received from a bank 
dump seems to be not predictable and varies strongly each time.

I tried different programs for recording the sysex data such as amidi, 
arecordmidi, aseqdump, KMidimon, SimpleSysexxer and even Midi-Ox with WINE to 
no avail. Also cat /dev/snd/midiCxDx  test.syx did not succeed.

Looking into /var/log/messages I could find errors which would seem to be 
related to this issue. I have no clue where else to look for error messages at 
the moment.

For an overview of the sending device here is what lsusb -v reports:

Bus 002 Device 007: ID 2466:8003 Fractal Audio Systems Axe-Fx II
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass  239 Miscellaneous Device
  bDeviceSubClass 2 ?
  bDeviceProtocol 1 Interface Association
  bMaxPacketSize064
  idVendor   0x2466 Fractal Audio Systems
  idProduct  0x8003 Axe-Fx II
  bcdDevice0.00
  iManufacturer   1 Fractal Audio Systems
  iProduct2 AXE-FX II
  iSerial 0 
  bNumConfigurations  2
  Configuration Descriptor:
bLength 9
bDescriptorType 2   

wTotalLength  285   

bNumInterfaces  4   

bConfigurationValue 1   

iConfiguration  0   

bmAttributes 0xc0   

  Self Powered  

MaxPower  100mA 

Interface Association:  

  bLength 8 

  bDescriptorType11 

  bFirstInterface 0 

  bInterfaceCount 3 

  bFunctionClass  1 Audio   

  bFunctionSubClass   0 

  bFunctionProtocol  32 

  iFunction   0 

Interface Descriptor:   

  bLength 9 

  bDescriptorType 4 

  bInterfaceNumber0 

  bAlternateSetting   0 

  bNumEndpoints   0 

  bInterfaceClass 1 Audio   

  bInterfaceSubClass  1 Control Device  

  bInterfaceProtocol 32 

  iInterface  3 AXE-FX II Audio 

  AudioControl Interface Descriptor:

bLength