<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hey Paul; <br>
      <br>
      Ah, so you're a maintainer of jack!  Cool.  <br>
      <br>
      This is what leads me to believe I have latency going on:<br>
      <br>
      *** ERROR: open directory failed
      '/home/bananapi/.local/share/SuperCollider/synthdefs'<br>
      JackDriver: client name is 'SuperCollider'<br>
      SC_AudioDriver: sample rate = 44100.000000, driver's block size =
      1024<br>
      SuperCollider 3 server ready.<br>
      Zeroconf: failed to create client: Daemon not running<br>
      <b>JackDriver: max output latency 23.2 ms</b><b><br>
      </b>FAILURE IN SERVER /g_freeAll Group 1 not found<br>
      <br>
      According to the article linked below, there is some kind of
      problem with usb devices, which is what I have, adding an extra
      period or 24ms, whichever is smaller.  Looks familiar.  Period is
      1024/44100, or 23.2 ms, which is what scsynth is reporting in jack
      mode, like so:<br>
      <br>
      <a class="moz-txt-link-freetext" href="http://apps.linuxaudio.org/wiki/jack_latency_tests">http://apps.linuxaudio.org/wiki/jack_latency_tests</a><br>
      <br>
      As to whether that is real or not I don't know, but I know there
      is latency in my system.  Jack still beats portaudio though, since
      portaudio has to use hw:0,0 with its 70ms latency.  <br>
      <br>
      Ben<br>
      <br>
      On 10/04/2015 04:47 PM, Paul Davis wrote:<br>
    </div>
    <blockquote
cite="mid:CAFa_cKkztRWa+bLD6b7iEX8GE8M9Xs1p4j3jU_-8Ff9JwWd6ug@mail.gmail.com"
      type="cite">
      <pre wrap="">Oh, one other thing. Using PortAudio will *not* reduce latency. JACK
does not add any latency.

On Sun, Oct 4, 2015 at 6:46 PM, Paul Davis <a class="moz-txt-link-rfc2396E" href="mailto:paul@linuxaudiosystems.com"><paul@linuxaudiosystems.com></a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">This can be hard to do. Why can't you tell software to use hw:1 ?

Most system BIOS setup utilities can be used to disable onboard sound.
Getting Linux to reorder them is also possible but can be complex
depending on the types of devices (PCI, USB etc)

On Sun, Oct 4, 2015 at 2:57 PM, ansible <a class="moz-txt-link-rfc2396E" href="mailto:bburdette@gmail.com"><bburdette@gmail.com></a> wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">I compiled supercollider to play through portaudio rather than jack, as it
usually does, in an attempt to reduce latency and hassle.  It works for
audio device hw:0,0, but it doesn't work for hw:1,0.  My problem is that on
my device hw:0,0 has horrible latency - 70ms - while hw:1,0 has 9ms latency,
much better.

So what I'd like to do is reorder the audio devices, or disable the onboard
audio, and have my current hw:1,0 be the hw:0,0 device.  Hopefully then
supercollider will work with it and I'll have those coveted low latency
numbers.  This is on arch linux on a bananapi armv7 computer.

So here's the output from aplay -l:

```
[bananapi@lemaker ~]$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sunxicodec [sunxi-CODEC], device 0: M1 PCM [sunxi PCM]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Pro [Sound Blaster X-Fi Go! Pro], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
[bananapi@lemaker ~]$
```

According to the [alsa wiki][1], I should be able to reorder the devices
using a .conf file. See 'set the default sound card'.  It gives the example
of this:

```
/etc/modprobe.d/alsa-base.conf

options snd_mia index=0
options snd_hda_intel index=1
```

Ok so I made a file like that, but I only know the name of the usb driver,
not the onboard sound driver.  lsmod reveals the following:

```
[bananapi@lemaker ~]$ lsmod
Module                  Size  Used by
snd_usb_audio          96225  0
snd_hwdep               5757  1 snd_usb_audio
snd_usbmidi_lib        18033  1 snd_usb_audio
cdc_acm                20518  0
spidev                  6217  0
spi_sun7i              17802  0
sunxi_cedar_mod         9808  0
mali_drm                2608  0
drm                   209226  1 mali_drm
mali                  111427  0
disp_ump                 861  0
ump                    52415  2 mali,disp_ump
ap6210                584133  0
ip_tables              12937  0
x_tables               17443  1 ip_tables
```

If I do "modprobe -r snd_usb_audio", then snd_hwdep and snd_usbmidi_lib both
disappear too, so they are all for the same device I think.  That leaves
nothing for the driver name for the onboard audio.

The alsa wiki says that the driver names should be in "cat
/proc/asound/modules" but I don't have that directory on my system.

So anyway I made an alsa-base.conf file as directed, which looks like this:

```
[bananapi@lemaker ~]$ cat /etc/modprobe.d/alsa-base.conf
options snd_usb_audio index=0
options sunxicodec index=1
[bananapi@lemaker ~]$
```

After creating that file and rebooting aplay just returns this.

```
[bananapi@lemaker ~]$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sunxicodec [sunxi-CODEC], device 0: M1 PCM [sunxi PCM]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
[bananapi@lemaker ~]$
```

So this alsa-base.conf has the effect of making only the onboard audio
available instead of reordering.  I most likely have the 'sunxicodec' name
wrong for the onboard audio, I'm just guessing at that, and have no idea
what the driver name for that is, if there even is one.  I'm kind of
suspecting the audio device is part of a monolithic driver for the whole
system-on-chip, is that possible?

  [1]:
<a class="moz-txt-link-freetext" href="https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture">https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture</a>



--
View this message in context: <a class="moz-txt-link-freetext" href="http://linux-audio.4202.n7.nabble.com/make-alsa-device-hw-1-0-be-hw-0-0-somehow-tp97402.html">http://linux-audio.4202.n7.nabble.com/make-alsa-device-hw-1-0-be-hw-0-0-somehow-tp97402.html</a>
Sent from the linux-audio-user mailing list archive at Nabble.com.
_______________________________________________
Linux-audio-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Linux-audio-user@lists.linuxaudio.org">Linux-audio-user@lists.linuxaudio.org</a>
<a class="moz-txt-link-freetext" href="http://lists.linuxaudio.org/listinfo/linux-audio-user">http://lists.linuxaudio.org/listinfo/linux-audio-user</a>
</pre>
        </blockquote>
      </blockquote>
    </blockquote>
    <br>
  </body>
</html>