vmsda
Posts: 32
Joined: Tue Mar 12, 2013 5:02 pm

Re: RPi and real-time, low-latency audio

Tue Mar 26, 2013 11:42 pm

OK, thank you so much.
Samsung 900X, Ubuntu 12.04 host, VirtualBox, Windows 7 guest.
Raspberry Pi running 2013-02-09-wheezy-raspbian.img; Edimax EW-7811Un 802.11b/g/n adapter; Plugable USB2.0 4-port Hub.

vmsda
Posts: 32
Joined: Tue Mar 12, 2013 5:02 pm

Re: RPi and real-time, low-latency audio

Wed Mar 27, 2013 11:24 am

I switched to USB1.1 mode, by tweaking the boot cmdfile.txt as advised. The system produced no sound whatsoever, with any type of file. Got the following in the console:

Code: Select all

dmesg
5:1:1: cannot get freq at ep 0x1
[  297.124071] INFO:: schedule_periodic: Insufficient periodic bandwidth for periodic transfer.
[  297.124071] 
[  297.124116] ERROR::dwc_otg_hcd_urb_enqueue:501: DWC OTG HCD URB Enqueue failed adding QTD. Error status -1
[  297.124116] 
[  297.124139] cannot submit urb 0, error -1: unknown error
Samsung 900X, Ubuntu 12.04 host, VirtualBox, Windows 7 guest.
Raspberry Pi running 2013-02-09-wheezy-raspbian.img; Edimax EW-7811Un 802.11b/g/n adapter; Plugable USB2.0 4-port Hub.

User avatar
AutoStatic
Posts: 326
Joined: Tue Jan 01, 2013 10:27 pm
Contact: Website

Re: RPi and real-time, low-latency audio

Wed Mar 27, 2013 11:40 am

If you're device can do 192kHz/24bit then it's probably not a USB1.1 device in the first place so that's probably why it doesn't work when you force the controller in USB1.1 mode.
RPi and real-time, low-latency audio: http://wiki.linuxaudio.org/wiki/raspberrypi
RPi audio repository: http://rpi.autostatic.com/
RPi and audio blog: https://autostatic.com/tag/raspberrypi/

vmsda
Posts: 32
Joined: Tue Mar 12, 2013 5:02 pm

Re: RPi and real-time, low-latency audio

Wed Mar 27, 2013 12:11 pm

In fact my device can only do 192/24 via the S/PDIF or Toslink interfaces; it is in fact a usb1.1 device, via which it can do max 96/24. The problem must lie somewhere else (RPi driver for usb?).
Samsung 900X, Ubuntu 12.04 host, VirtualBox, Windows 7 guest.
Raspberry Pi running 2013-02-09-wheezy-raspbian.img; Edimax EW-7811Un 802.11b/g/n adapter; Plugable USB2.0 4-port Hub.

User avatar
AutoStatic
Posts: 326
Joined: Tue Jan 01, 2013 10:27 pm
Contact: Website

Re: RPi and real-time, low-latency audio

Wed Mar 27, 2013 1:23 pm

What is the output of

Code: Select all

cat /proc/asound/cards
with the DAC attached? And could you also post the output of

Code: Select all

sudo lsusb -vvv
RPi and real-time, low-latency audio: http://wiki.linuxaudio.org/wiki/raspberrypi
RPi audio repository: http://rpi.autostatic.com/
RPi and audio blog: https://autostatic.com/tag/raspberrypi/

vmsda
Posts: 32
Joined: Tue Mar 12, 2013 5:02 pm

Re: RPi and real-time, low-latency audio

Wed Mar 27, 2013 3:17 pm

Here goes, with thanks for help:

Code: Select all

cat /proc/asound/cards
 0 [ALSA           ]: BRCM bcm2835 ALSbcm2835 ALSA - bcm2835 ALSA
                      bcm2835 ALSA
 1 [B10            ]: USB-Audio - Benchmark 1.0
                      Texas Instruments Benchmark 1.0 at usb-bcm2708_usb-1.3.2, full speed

Code: Select all

  idProduct          0x0002 2.0 root hub
  bcdDevice            3.06
  iManufacturer           3 Linux 3.6.11+ dwc_otg_hcd
  iProduct                2 DWC OTG Controller
  iSerial                 1 bcm2708_usb
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             1
  wHubCharacteristic 0x0008
    Ganged power switching
    Per-port overcurrent protection
    TT think time 8 FS bits
  bPwrOn2PwrGood        1 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  DeviceRemovable    0x00
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0503 highspeed power enable connect
Device Status:     0x0001
  Self Powered

Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass         0 
  bDeviceProtocol         1 
  bMaxPacketSize0        64
  idVendor           0x0424 Standard Microsystems Corp.
  idProduct          0xec00 
  bcdDevice            2.00
  iManufacturer           0 
  iProduct                0 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol    255 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               4
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass         0 
  bDeviceProtocol         1 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered

Bus 001 Device 004: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x1a40 Terminus Technology Inc.
  idProduct          0x0101 4-Port HUB
  bcdDevice            1.11
  iManufacturer           0 
  iProduct                1 USB 2.0 Hub
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             4
  wHubCharacteristic 0x0000
    Ganged power switching
    Ganged overcurrent protection
    TT think time 8 FS bits
  bPwrOn2PwrGood       50 * 2 milli seconds
  bHubContrCurrent    100 milli Ampere
  DeviceRemovable    0x00
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0100 power
   Port 2: 0000.0103 power enable connect
   Port 3: 0000.0503 highspeed power enable connect
   Port 4: 0000.0503 highspeed power enable connect
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         0 Full speed (or root) hub
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered

Bus 001 Device 005: ID 04d8:feea Microchip Technology, Inc. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x04d8 Microchip Technology, Inc.
  idProduct          0xfeea 
  bcdDevice            1.00
  iManufacturer           1 Texas Instruments
  iProduct                2 Benchmark 1.0
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          109
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol      0 
      iInterface              0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength           30
        bInCollection           1
        baInterfaceNr( 0)       1
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             5
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bNrChannels             2
        wChannelConfig     0x0003
          Left Front (L)
          Right Front (R)
        iChannelNames           0 
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             8
        wTerminalType      0x0301 Speaker
        bAssocTerminal          0
        bSourceID               5
        iTerminal               0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      AudioStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           5
        bDelay                  1 frames
        wFormatTag              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                20
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             2
        bSubframeSize           3
        bBitResolution         24
        bSamFreqType            4 Discrete
        tSamFreq[ 0]        44100
        tSamFreq[ 1]        48000
        tSamFreq[ 2]        88200
        tSamFreq[ 3]        96000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            9
          Transfer Type            Isochronous
          Synch Type               Adaptive
          Usage Type               Data
        wMaxPacketSize     0x0240  1x 576 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay              0 Undefined
Device Status:     0x0000
  (Bus Powered)

Bus 001 Device 006: ID 0480:a006 Toshiba America Info. Systems, Inc. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0480 Toshiba America Info. Systems, Inc.
  idProduct          0xa006 
  bcdDevice            0.01
  iManufacturer           1 Toshiba
  iProduct                2 External USB 3.0
  iSerial                 3 2011082021221
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              400mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval              20
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval              20
Device Status:     0x0000
  (Bus Powered)

Bus 001 Device 007: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wi
reless Adapter [Realtek RTL8188CUS]
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x7392 Edimax Technology Co., Ltd
  idProduct          0x7811 EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188C
US]
  bcdDevice            2.00
  iManufacturer           1 Realtek
  iProduct                2 802.11n WLAN Adapter
  iSerial                 3 00e04c000001
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           46
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           4
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)
[email protected] ~ $ nano fich
[email protected] ~ $ more fich

Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         2 TT per port
  bMaxPacketSize0        64
  idVendor           0x0424 Standard Microsystems Corp.
  idProduct          0x9512 
  bcdDevice            2.00
  iManufacturer           0 
  iProduct                0 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
--More--(3%)
Samsung 900X, Ubuntu 12.04 host, VirtualBox, Windows 7 guest.
Raspberry Pi running 2013-02-09-wheezy-raspbian.img; Edimax EW-7811Un 802.11b/g/n adapter; Plugable USB2.0 4-port Hub.

User avatar
AutoStatic
Posts: 326
Joined: Tue Jan 01, 2013 10:27 pm
Contact: Website

Re: RPi and real-time, low-latency audio

Sat Mar 30, 2013 9:20 pm

Thanks even though the output of lsusb is incomplete. I've reread the relevant posts but could you explain a bit more what the exact issue is?
RPi and real-time, low-latency audio: http://wiki.linuxaudio.org/wiki/raspberrypi
RPi audio repository: http://rpi.autostatic.com/
RPi and audio blog: https://autostatic.com/tag/raspberrypi/

User avatar
AutoStatic
Posts: 326
Joined: Tue Jan 01, 2013 10:27 pm
Contact: Website

Re: RPi and real-time, low-latency audio

Sun Mar 31, 2013 11:24 am

Cool project using real-time, low-latency audio: Amp Brownie - Building a Raspberry Pi Guitar Rig
RPi and real-time, low-latency audio: http://wiki.linuxaudio.org/wiki/raspberrypi
RPi audio repository: http://rpi.autostatic.com/
RPi and audio blog: https://autostatic.com/tag/raspberrypi/

vmsda
Posts: 32
Joined: Tue Mar 12, 2013 5:02 pm

Re: RPi and real-time, low-latency audio

Sun Mar 31, 2013 11:38 am

AutoStatic wrote:Thanks even though the output of lsusb is incomplete. I've reread the relevant posts but could you explain a bit more what the exact issue is?

Code: Select all

 lsusb -vvv

Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         2 TT per port
  bMaxPacketSize0        64
  idVendor           0x0424 Standard Microsystems Corp.
  idProduct          0x9512 
  bcdDevice            2.00
  iManufacturer           0 
  iProduct                0 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      1 Single TT
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      2 TT per port
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0002 2.0 root hub
  bcdDevice            3.06
  iManufacturer           3 
  iProduct                2 
  iSerial                 1 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12

Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass         0 
  bDeviceProtocol         1 
  bMaxPacketSize0        64
  idVendor           0x0424 Standard Microsystems Corp.
  idProduct          0xec00 
  bcdDevice            2.00
  iManufacturer           0 
  iProduct                0 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol    255 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               4

Bus 001 Device 004: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x1a40 Terminus Technology Inc.
  idProduct          0x0101 4-Port HUB
  bcdDevice            1.11
  iManufacturer           0 
  iProduct                1 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12

Bus 001 Device 005: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x7392 Edimax Technology Co., Ltd
  idProduct          0x7811 EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
  bcdDevice            2.00
  iManufacturer           1 
  iProduct                2 
  iSerial                 3 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           46
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           4
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1

Bus 001 Device 006: ID 04d8:feea Microchip Technology, Inc. 
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x04d8 Microchip Technology, Inc.
  idProduct          0xfeea 
  bcdDevice            1.00
  iManufacturer           1 
  iProduct                2 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          109
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol      0 
      iInterface              0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength           30
        bInCollection           1
        baInterfaceNr( 0)       1
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             5
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bNrChannels             2
        wChannelConfig     0x0003
          Left Front (L)
          Right Front (R)
        iChannelNames           0 
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             8
        wTerminalType      0x0301 Speaker
        bAssocTerminal          0
        bSourceID               5
        iTerminal               0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      AudioStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           5
        bDelay                  1 frames
        wFormatTag              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                20
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             2
        bSubframeSize           3
        bBitResolution         24
        bSamFreqType            4 Discrete
        tSamFreq[ 0]        44100
        tSamFreq[ 1]        48000
        tSamFreq[ 2]        88200
        tSamFreq[ 3]        96000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            9
          Transfer Type            Isochronous
          Synch Type               Adaptive
          Usage Type               Data
        wMaxPacketSize     0x0240  1x 576 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay              0 Undefined

Bus 001 Device 007: ID 0951:1643 Kingston Technology DataTraveler G3 4GB
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0951 Kingston Technology
  idProduct          0x1643 DataTraveler G3 4GB
  bcdDevice            1.00
  iManufacturer           1 
  iProduct                2 
  iSerial                 3 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval             255
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval             255
My apologies for the truncated copy of lsusb -vvv, I hope it is ok now.

I used to have two issues, only have one now: the system refuses to play 96khz/24bit files through the usb interface connecting the RPi to the DAC (both hanging from the same 4-port powered usb hub). The file starts playing, then gets blocked for shorter or longer periods, after which the devices get into sync again, before the next occurrance; occasionally, they lose sync for good. The problem persists with the latest available kernel update, #399, although to a lesser extent than before, so one can say there is a slight improvement, but we are still on our way to recovery.

(The other issue I had was the crackling with 44.1khz/16bit files, but that was taken care of by coding the nrpacks options for usb-snd-audio in /etc/modprobe.d files).

Thank you for your continued interest and support.
Samsung 900X, Ubuntu 12.04 host, VirtualBox, Windows 7 guest.
Raspberry Pi running 2013-02-09-wheezy-raspbian.img; Edimax EW-7811Un 802.11b/g/n adapter; Plugable USB2.0 4-port Hub.

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: RPi and real-time, low-latency audio

Sun Mar 31, 2013 6:26 pm

This is an awesome project! What I do now and then is buy a new very cheap guitar (< €100) and then work on it until it plays real well (mostly sanding the frets and re-positioning the bridge). I have had the urge for quite a while to put a Pi into such a guitar so that the output already has the wanted sound effects. Possibly some buttons connected to the GPIO pins to change effects and maybe a small display to show the chosen effect and to announce 'beer time'.

So I tried following your setup but when I try to start Jack as you indicated I get:

Code: Select all

jackd 0.122.0
Copyright 2001-2009 Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details

JACK compiled with System V SHM support.
loading driver ..
apparent rate = 44100
creating alsa driver ... hw:UA25|hw:UA25|128|3|44100|0|0|nomon|swmeter|soft-mode|32bit
control open "hw:UA25" (No such device)
ALSA lib pcm_hw.c:1401:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1401:(_snd_pcm_hw_open) Invalid value for card
ALSA: Cannot open PCM device alsa_pcm for playback. Falling back to capture-only mode
cannot load driver module alsa

I use a FastTrack Pro from M-Audio. Does this mean it's not compatible or do I need to change something?

Also trying to install guitarex:

Code: Select all

sudo apt-get install guitarex
doesn't seem to work as it says:

Code: Select all

E: Unable to locate package guitarex
Not sure btw what I should do if guitarex was installed, will it appear in the list on the desktop? Does Jack run in the background?

As you can see I'm pretty new to this :D but would love to make it work.

User avatar
AutoStatic
Posts: 326
Joined: Tue Jan 01, 2013 10:27 pm
Contact: Website

Re: RPi and real-time, low-latency audio

Sun Mar 31, 2013 6:49 pm

poing wrote:This is an awesome project! What I do now and then is buy a new very cheap guitar (< €100) and then work on it until it plays real well (mostly sanding the frets and re-positioning the bridge).
Hello poing, that's a very cool idea. I also have a weak spot for cheap guitars and making them better: $100 plexi LP
poing wrote:I have had the urge for quite a while to put a Pi into such a guitar so that the output already has the wanted sound effects. Possibly some buttons connected to the GPIO pins to change effects and maybe a small display to show the chosen effect and to announce 'beer time'.
All of that should be possible. My goal is to be able to strap the RPi on to my guitar strap. I have about a month to get there. ;)
poing wrote:So I tried following your setup but when I try to start Jack as you indicated I get:

Code: Select all

jackd 0.122.0
...
creating alsa driver ... hw:UA25|hw:UA25|128|3|44100|0|0|nomon|swmeter|soft-mode|32bit
control open "hw:UA25" (No such device)
I use a FastTrack Pro from M-Audio. Does this mean it's not compatible or do I need to change something?
You're not using an Edirol UA25 so you should change the hardware name. You can find the name with the following command:

Code: Select all

cat /proc/asound/cards
If you disabled the onboard audio you can even use a shortcut when starting up JACK:

Code: Select all

jackd -v -P84 -p32 -t2000 -d alsa -dhw:$(cat /proc/asound/card0/id) -p 128 -n 3 -r 44100 -s
This will automatically make JACK work with your sound card.
poing wrote:Also trying to install guitarex:

Code: Select all

sudo apt-get install guitarex
doesn't seem to work as it says:

Code: Select all

E: Unable to locate package guitarex
It's guitarix ;) And did you add my repository? The Raspbian repository has guitarix 0.22.4 which is quite old in guitarix terms, guitarix is well maintained.
poing wrote:Not sure btw what I should do if guitarex was installed, will it appear in the list on the desktop?
It probably will. But I'd refrain from using the desktop on the RPi and do everything with SSH.
poing wrote:Does Jack run in the background?
Yes, it can run in the background.
poing wrote:As you can see I'm pretty new to this :D but would love to make it work.
It can work but it does take some learning.
RPi and real-time, low-latency audio: http://wiki.linuxaudio.org/wiki/raspberrypi
RPi audio repository: http://rpi.autostatic.com/
RPi and audio blog: https://autostatic.com/tag/raspberrypi/

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: RPi and real-time, low-latency audio

Sun Mar 31, 2013 8:26 pm

AutoStatic wrote:I also have a weak spot for cheap guitars and making them better: $100 plexi LP
That's a very cool guitar. You really don't need a legendary $100,000 1960 LesPaul to play a few riffs ;)
AutoStatic wrote:You're not using an Edirol UA25 so you should change the hardware name. You can find the name with the following command:

Code: Select all

cat /proc/asound/cards
If you disabled the onboard audio you can even use a shortcut when starting up JACK:

Code: Select all

jackd -v -P84 -p32 -t2000 -d alsa -dhw:$(cat /proc/asound/card0/id) -p 128 -n 3 -r 44100 -s
This will automatically make JACK work with your sound card.
Ah! I get this:

Code: Select all

 0 [Pro            ]: USB-Audio - FastTrack Pro
                      M-Audio FastTrack Pro at usb-bcm2708_usb-1.2.3, full speed
 1 [ALSA           ]: BRCM bcm2835 ALSbcm2835 ALSA - bcm2835 ALSA
                      bcm2835 ALSA
and using 'Pro' seems to work (also will try to disable the onboard sound). That said, after running the script you linked to (replacing 'UA25' with 'Pro') I get scrolling error messages like:

Code: Select all

delay of 3005.000 usecs exceeds estimated spare time of 2785.000; restart ...

delay of 2994.000 usecs exceeds estimated spare time of 2813.000; restart ...

delay of 3127.000 usecs exceeds estimated spare time of 2813.000; restart ...

delay of 3995.000 usecs exceeds estimated spare time of 2813.000; restart ...

delay of 2986.000 usecs exceeds estimated spare time of 2813.000; restart ...

delay of 3008.000 usecs exceeds estimated spare time of 2813.000; restart ...

delay of 3011.000 usecs exceeds estimated spare time of 2800.000; restart ...

delay of 2956.000 usecs exceeds estimated spare time of 2800.000; restart ...
and Ctrl-C doesn't stop it...
AutoStatic wrote:It's guitarix ;) And did you add my repository? The Raspbian repository has guitarix 0.22.4 which is quite old in guitarix terms, guitarix is well maintained.
:oops:
Yes, I did add the repository, will try again... But will it pick your version automagically?
AutoStatic wrote:It probably will. But I'd refrain from using the desktop on the RPi and do everything with SSH.
Would that be possible with another Pi? I do have a Linux system on HD for an Atom board but it's a bit cumbersome as I use that PC with Windows for automated tasks for work. So if I can run Jack and guitarix on one Pi and then use the graphical interface on another Pi that would work for me.

User avatar
AutoStatic
Posts: 326
Joined: Tue Jan 01, 2013 10:27 pm
Contact: Website

Re: RPi and real-time, low-latency audio

Sun Mar 31, 2013 9:03 pm

poing wrote:That's a very cool guitar. You really don't need a legendary $100,000 1960 LesPaul to play a few riffs ;)
Thanks. And very true. Unless your name is Billy Gibbons.
poing wrote:Ah! I get this:

Code: Select all

 0 [Pro            ]: USB-Audio - FastTrack Pro
                      M-Audio FastTrack Pro at usb-bcm2708_usb-1.2.3, full speed
 1 [ALSA           ]: BRCM bcm2835 ALSbcm2835 ALSA - bcm2835 ALSA
                      bcm2835 ALSA
and using 'Pro' seems to work (also will try to disable the onboard sound).
Yes, 'Pro' is the ALSA device name for the FastTrack Pro. When working with ALSA, or JACK using ALSA as backend, you can always use the ALSA device name to make sure the right sound card will be used.
poing wrote:That said, after running the script you linked to (replacing 'UA25' with 'Pro') I get scrolling error messages like:

Code: Select all

delay of 3005.000 usecs exceeds estimated spare time of 2785.000; restart ...

delay of 2994.000 usecs exceeds estimated spare time of 2813.000; restart ...

delay of 3127.000 usecs exceeds estimated spare time of 2813.000; restart ...

delay of 3995.000 usecs exceeds estimated spare time of 2813.000; restart ...

delay of 2986.000 usecs exceeds estimated spare time of 2813.000; restart ...

delay of 3008.000 usecs exceeds estimated spare time of 2813.000; restart ...

delay of 3011.000 usecs exceeds estimated spare time of 2800.000; restart ...

delay of 2956.000 usecs exceeds estimated spare time of 2800.000; restart ...
and Ctrl-C doesn't stop it...
How does your script look like? Do you get a prompt? Then you can kill JACK with

Code: Select all

killall jackd
poing wrote:Yes, I did add the repository, will try again... But will it pick your version automagically?
If you did a sudo apt-get update, yes.
poing wrote:Would that be possible with another Pi?
Yes, that's perfectly possible. It can be done with Windows but then you need to install cygwin and then X but I wouldn't recommend it.
RPi and real-time, low-latency audio: http://wiki.linuxaudio.org/wiki/raspberrypi
RPi audio repository: http://rpi.autostatic.com/
RPi and audio blog: https://autostatic.com/tag/raspberrypi/

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: RPi and real-time, low-latency audio

Sun Mar 31, 2013 10:04 pm

AutoStatic wrote:
poing wrote:That's a very cool guitar. You really don't need a legendary $100,000 1960 LesPaul to play a few riffs ;)
Thanks. And very true. Unless your name is Billy Gibbons.
Sure, for guys like that it will no doubt make a difference. But what I see around me with less gifted people (of which I'm one) it seems the price of the guitar is a measure of one's ability. Here's my present €89 guitar:

Image Image Image
AutoStatic wrote:How does your script look like? Do you get a prompt? Then you can kill JACK with

Code: Select all

killall jackd
No prompt, it looks like this:

Code: Select all

#!/bin/bash
sudo service ntp stop
sudo service triggerhappy stop
sudo service dbus stop
sudo killall console-kit-daemon
sudo killall polkitd
## Only needed when Jack2 is compiled with D-Bus support
#export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
sudo mount -o remount,size=128M /dev/shm
killall gvfsd
killall dbus-daemon
killall dbus-launch
## Uncomment if you'd like to disable the network adapter completely
#echo -n "1-1.1:1.0" | sudo tee /sys/bus/usb/drivers/smsc95xx/unbind
echo -n performance | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_gov$
jackd -P70 -p16 -t2000 -d alsa -dhw:Pro -p 128 -n 3 -r 44100 -s &
exit
and I start it with

Code: Select all

sudo ./disable.sh

User avatar
AutoStatic
Posts: 326
Joined: Tue Jan 01, 2013 10:27 pm
Contact: Website

Re: RPi and real-time, low-latency audio

Mon Apr 01, 2013 8:28 am

poing wrote:Sure, for guys like that it will no doubt make a difference. But what I see around me with less gifted people (of which I'm one) it seems the price of the guitar is a measure of one's ability.
While what really matters is how it plays, sounds and feels. Cool looks are a plus of course but my favorite guitar isn't the coolest looking and the guitar I like most for its looks plays and sounds horrible
poing wrote:Here's my present €89 guitar:
Wow, that looks sweet! I never really liked Tele's until I used one for a recording. Little while later I had the possibility to buy a good one and it has been one of my main guitars for years now. Did you also replace PU's or any other hardware? Or did it sound good out of the box? What kind of wood is the body?
poing wrote:... and I start it with

Code: Select all

sudo ./disable.sh
You shouldn't run it with sudo because then you would need to run any other JACK client with sudo too. Is there any reason why you run it with sudo?
RPi and real-time, low-latency audio: http://wiki.linuxaudio.org/wiki/raspberrypi
RPi audio repository: http://rpi.autostatic.com/
RPi and audio blog: https://autostatic.com/tag/raspberrypi/

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: RPi and real-time, low-latency audio

Mon Apr 01, 2013 10:18 am

AutoStatic wrote:
poing wrote:Here's my present €89 guitar:
Wow, that looks sweet! I never really liked Tele's until I used one for a recording. Little while later I had the possibility to buy a good one and it has been one of my main guitars for years now. Did you also replace PU's or any other hardware? Or did it sound good out of the box? What kind of wood is the body?
It's got an ash body, here's the product page: http://www.thomann.de/gb/harley_benton_ ... itarre.htm which has a few sound samples.

When it arrived, as I expected, it was not really playable. The neck was slightly warped, the bridge was out of line, the nut was a joke, it was not isolated against interference and the switch was working only with very careful positioning and creaking to boot :lol:

So I took it apart, made a very straight (aiming for 0,1mm accuracy) and stiff 'beam' (don't know the English term) from a 1 meter x 4 x 5 cm aluminium tube which I filled with cement for stiffness, used that to carefully sand the frets until they were very straight along the long axis of the neck. Replaced the nut, re-positioned the bridge, replaced the switch and isolated the innards with aluminium foil. Also I removed the metal cap from the pickup closest to the neck as it made the sound a bit dull. Then I tuned the guitar with the help of an excellent website I found. One thing I should still do is get another bridge as the original is a bit flaky.

Plays like a dream now and sounds pretty good to my ears. I used to have stuff like Ibanez in the €500 ballpark and I wish I had made that 'sanding beam' 30 years ago! I came to the conclusion the main problem with the 'playability' of cheaper guitars is lack of tuning. As far as pickups are concerned I'm less sure although the original Fender pickups are pretty simple.
AutoStatic wrote:You shouldn't run it with sudo because then you would need to run any other JACK client with sudo too. Is there any reason why you run it with sudo?
Bad habit ;-) Will try again.

User avatar
AutoStatic
Posts: 326
Joined: Tue Jan 01, 2013 10:27 pm
Contact: Website

Re: RPi and real-time, low-latency audio

Mon Apr 01, 2013 12:10 pm

poing wrote:It's got an ash body, here's the product page: http://www.thomann.de/gb/harley_benton_ ... itarre.htm which has a few sound samples.
No way, an ash body! Gee, that alone is already worth the €89!
poing wrote:When it arrived, as I expected, it was not really playable. The neck was slightly warped, the bridge was out of line, the nut was a joke, it was not isolated against interference and the switch was working only with very careful positioning and creaking to boot :lol:
:o Almost the same with the plexi LP I bought, luckily the neck was quite straight and the bridge was in line too. And I kept the nut even though it was also a joke. Thinking of it, it's getting time to replace it. I also insulated the cavity and replaced the switch. I've replaced the neck PU with a Gibson one and I'm awaiting a new Gibson PU to replace the bridge PU. To that order I also added a new set of tuners because the current tuners are so bad that I can't even do a string bend. And I replaced all the caps with quality parts.
poing wrote:So I took it apart, made a very straight (aiming for 0,1mm accuracy) and stiff 'beam' (don't know the English term) from a 1 meter x 4 x 5 cm aluminium tube which I filled with cement for stiffness, used that to carefully sand the frets until they were very straight along the long axis of the neck. Replaced the nut, re-positioned the bridge, replaced the switch and isolated the innards with aluminium foil. Also I removed the metal cap from the pickup closest to the neck as it made the sound a bit dull. Then I tuned the guitar with the help of an excellent website I found. One thing I should still do is get another bridge as the original is a bit flaky.
Nice! That must've been quite some work! I took the short route and had a local luthier take a look at it. He made the guitar perfectly playable.
poing wrote:Plays like a dream now and sounds pretty good to my ears. I used to have stuff like Ibanez in the €500 ballpark and I wish I had made that 'sanding beam' 30 years ago! I came to the conclusion the main problem with the 'playability' of cheaper guitars is lack of tuning. As far as pickups are concerned I'm less sure although the original Fender pickups are pretty simple.
I've found that playability of cheap guitars differs per model. I've tried Farida's and London City's (which are of a slightly better quality) that played great out of the box. For me PU's are crucial, I can't bear the sound of cheap PU's (especially humbuckers), but maybe that's also because I'm a bit spoiled as my small collection contains guitars with some classic PU's. But I wouldn't be surprised if the Harley Benton sounds just great, the London City Comets sound very good too.
poing wrote:Bad habit ;-) Will try again.
In general maybe, but in case of the RPi it's not such a bad habit, it's actually made easy by the way sudo is configured in Raspbian (no need to enter a password).
RPi and real-time, low-latency audio: http://wiki.linuxaudio.org/wiki/raspberrypi
RPi audio repository: http://rpi.autostatic.com/
RPi and audio blog: https://autostatic.com/tag/raspberrypi/

eby
Posts: 9
Joined: Wed Nov 28, 2012 11:27 am

Re: RPi and real-time, low-latency audio

Tue Apr 02, 2013 12:17 pm

Very interesting Jeremy.

What distro are you running ?.

Since JACK is working, I wonder if Pi have enough power left to run Aeolus (Pipe Organ Software) properly.

Eby

User avatar
AutoStatic
Posts: 326
Joined: Tue Jan 01, 2013 10:27 pm
Contact: Website

Re: RPi and real-time, low-latency audio

Tue Apr 02, 2013 12:32 pm

eby wrote:What distro are you running ?
Hello Eby, I'm using Raspbian.
eby wrote:Since JACK is working, I wonder if Pi have enough power left to run Aeolus (Pipe Organ Software) properly.
Haven't tried it but it probably works. How much power there will be left, can't tell, I'd say, give it a go!
RPi and real-time, low-latency audio: http://wiki.linuxaudio.org/wiki/raspberrypi
RPi audio repository: http://rpi.autostatic.com/
RPi and audio blog: https://autostatic.com/tag/raspberrypi/

User avatar
AutoStatic
Posts: 326
Joined: Tue Jan 01, 2013 10:27 pm
Contact: Website

Re: RPi and real-time, low-latency audio

Wed Apr 03, 2013 7:54 pm

vmsda wrote:I used to have two issues, only have one now: the system refuses to play 96khz/24bit files through the usb interface connecting the RPi to the DAC (both hanging from the same 4-port powered usb hub). The file starts playing, then gets blocked for shorter or longer periods, after which the devices get into sync again, before the next occurrance; occasionally, they lose sync for good. The problem persists with the latest available kernel update, #399, although to a lesser extent than before, so one can say there is a slight improvement, but we are still on our way to recovery.
You're probably suffering from ALSA over/underruns. There could be many things causing this. How are you using the RPi? With a desktop environment or over SSH? Did you try connecting the USB DAC directly to the RPi? What software are you using to play files? Did you try disabling some services/daemons mentioned in the linuxaudio.org Wiki article? Is your RPi overclocked? What kind of SD card are you using, what class, what read/write speeds? Are your USB cables ok (I reckon they are with such an expensive USB DAC)? Did you disable turbo mode for the ethernet interface? How does your /etc/asound.conf look like (if you have one)?
vmsda wrote:(The other issue I had was the crackling with 44.1khz/16bit files, but that was taken care of by coding the nrpacks options for usb-snd-audio in /etc/modprobe.d files).
I find this hard to believe but if it works then it works ;) Setting nrpacks seems to be a myth that has spread across the audiophile communities. If you, or anyone else, could point me to some relevant information on how this would improve things I'd be grateful as I'd like to know more about this setting and what it actually does.
RPi and real-time, low-latency audio: http://wiki.linuxaudio.org/wiki/raspberrypi
RPi audio repository: http://rpi.autostatic.com/
RPi and audio blog: https://autostatic.com/tag/raspberrypi/

User avatar
azeam
Posts: 194
Joined: Fri Oct 26, 2012 11:13 pm
Contact: Website

Re: RPi and real-time, low-latency audio

Wed Apr 03, 2013 9:09 pm

AutoStatic wrote:I find this hard to believe but if it works then it works ;) Setting nrpacks seems to be a myth that has spread across the audiophile communities. If you, or anyone else, could point me to some relevant information on how this would improve things I'd be grateful as I'd like to know more about this setting and what it actually does.
I can't say if this is the case here but there is (or was, don't know if it's been fixed now) a bug with the RPi causing the syslog to be heavily spammed with debug info unless nrpacks is set (normally to 1 and not 10) when using USB DACs, which caused a lot of problems. Setting nrpacks changes the number of packets per USB request block (URB) and to me it makes sense that changing the number would have an effect, regardless of the syslog bug.

As for the 24 bit audio problem with the RPi I don't think there's anything to do about it until the USB work has gotten a bit further (except for the USB 1.1 workaround, which I don't know why it won't work on vmsda's DAC).

User avatar
AutoStatic
Posts: 326
Joined: Tue Jan 01, 2013 10:27 pm
Contact: Website

Re: RPi and real-time, low-latency audio

Thu Apr 04, 2013 7:33 am

azeam wrote:I can't say if this is the case here but there is (or was, don't know if it's been fixed now) a bug with the RPi causing the syslog to be heavily spammed with debug info unless nrpacks is set (normally to 1 and not 10) when using USB DACs, which caused a lot of problems. Setting nrpacks changes the number of packets per USB request block (URB) and to me it makes sense that changing the number would have an effect, regardless of the syslog bug.
Oh yeah, that's true, I've seen some posts related to that issue. I thought that had been fixed in the meanwhile.
azeam wrote:As for the 24 bit audio problem with the RPi I don't think there's anything to do about it until the USB work has gotten a bit further (except for the USB 1.1 workaround, which I don't know why it won't work on vmsda's DAC).
Afaik USB1.1 can't do 24bit audio unless your interface has a specific driver/snd-usb-audio quirk. Some more details here: http://joegiampaoli.blogspot.nl/2011/06 ... linux.html
I have an Edirol UA-25 myself which only does 44.1kHz/16bit in USB1.1 class compliant mode. It has an 'Advanced' switch which allows the interface to do 96kHz/24bit and fortunately that works on Linux because the snd-usb-audio driver supports this mode. But I can't use this mode when I force the controller to USB1.1 on the RPi, I have to disable 'Advanced' mode in order to get it to work properly. And when I don't force USB1.1 on the controller the UA-25 doesn't work well either, at least, not for my user case (real-time, low-latency audio).
RPi and real-time, low-latency audio: http://wiki.linuxaudio.org/wiki/raspberrypi
RPi audio repository: http://rpi.autostatic.com/
RPi and audio blog: https://autostatic.com/tag/raspberrypi/

User avatar
azeam
Posts: 194
Joined: Fri Oct 26, 2012 11:13 pm
Contact: Website

Re: RPi and real-time, low-latency audio

Thu Apr 04, 2013 8:02 am

AutoStatic wrote:Afaik USB1.1 can't do 24bit audio unless your interface has a specific driver/snd-usb-audio quirk. Some more details here: http://joegiampaoli.blogspot.nl/2011/06 ... linux.html
I have an Edirol UA-25 myself which only does 44.1kHz/16bit in USB1.1 class compliant mode. It has an 'Advanced' switch which allows the interface to do 96kHz/24bit and fortunately that works on Linux because the snd-usb-audio driver supports this mode. But I can't use this mode when I force the controller to USB1.1 on the RPi, I have to disable 'Advanced' mode in order to get it to work properly. And when I don't force USB1.1 on the controller the UA-25 doesn't work well either, at least, not for my user case (real-time, low-latency audio).
I don't think that's valid for all devices, 24 bit audio was playing fine with my DACs in USB 1.1 mode the last time I tried, so there seems to be support for at least some devices with the normal kernel. But it's certainly an issue for some and possibly that's the case with vmsda's DAC as well.

User avatar
AutoStatic
Posts: 326
Joined: Tue Jan 01, 2013 10:27 pm
Contact: Website

Re: RPi and real-time, low-latency audio

Tue Apr 09, 2013 7:46 pm

Nice example of a project that makes use of the information provided in the Wiki article and of the packages in the audio repository: Amp Brownie - Open Source Guitar Effects Project, On a Pi

I've updated the complete lv2 stack to the latest versions in the repository. I've also uploaded the latest version of guitarix (0.26.1).
RPi and real-time, low-latency audio: http://wiki.linuxaudio.org/wiki/raspberrypi
RPi audio repository: http://rpi.autostatic.com/
RPi and audio blog: https://autostatic.com/tag/raspberrypi/

JulianBrooks
Posts: 35
Joined: Wed Mar 20, 2013 1:08 pm

Re: RPi and real-time, low-latency audio

Tue Apr 09, 2013 9:20 pm

Hi AutoStatic,

This and the linuxaudio pages are super-useful, many thanks.

(Apologies for the noise - I updated and upgraded before adding the repository and starting to install jack so thought this was related. Now I don't think it is)

Will delete when I figure out how??

When I run this (after adding the repository)
sudo apt-get --no-install-recommends install jackd2$ sudo apt-get --no-install-recommends install jackd2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libjack-jackd2-0 libjack-jackd2-dev python-dbus python-dbus-dev
Suggested packages:
jack-tools meterbridge python-dbus-doc python-dbus-dbg
Recommended packages:
qjackctl python-gi python-gobject-2 python-qt4-dbus
The following NEW packages will be installed:
jackd2 python-dbus python-dbus-dev
The following packages will be upgraded:
libjack-jackd2-0 libjack-jackd2-dev
2 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1,242 kB of archives.
After this operation, 2,655 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Preconfiguring packages ...
dpkg: unrecoverable fatal error, aborting:
files list file for package `fake-hwclock' contains empty filename
E: Sub-process /usr/bin/dpkg returned an error code (2)


Stuck now:( Any ideas?

Cheers,

Julian
I get:
Last edited by JulianBrooks on Tue Apr 09, 2013 9:39 pm, edited 1 time in total.

Return to “Graphics, sound and multimedia”