• Disclaimer: This Vendor's Forum is a paid-for commercial area. Unlike the rest of diyAudio, the Vendor has complete control of what may or may not be posted in this forum. If you wish to discuss technical matters outside the bounds of what is permitted by the Vendor, please use the non-commercial areas of diyAudio to do so.

Support for Botic Linux driver

Member
Joined 2007
Paid Member
As I am using a multichannel all-horn-system, delay lines are essential.

My question is whether I can use three of that four i2s-lines delayed by Botic OS. If that is possible basically, I think the real challenge might be to tell the system the needed delay in msec respectivly fractions of msec valid for all possible sample rates.

I am not interested in digital crossovers whatsoever. So there is no need for that. The signal should not be modified in any way, just delayed.

Regards,
Hans

Greetings Hans,

I believe the simplest solution to obtaining a fixed delay at multiple sample rates is to produce it in ALSA. This requires no modification to the Botic kernel, nor creation of new code. There are several LADSPA plug-ins that have been designed for various timing uses (including crossover alignment) and any one of them will give you fine control of the channel timing. ALSA is a bit challenging at first but there are working examples available that can be copied. If you choose to use LADSPA delay plug-ins in ALSA, I can help you over on this thread. Discussion there is primarily about crossovers, but the basic steps for you are the same and you would simply run LADSPA delay plugs without any frequency-based LADSPA filters. Very easy to do.
 
Last edited:
DSD512

twluke: how did you forced HQPlayer to use larger buffer than 100ms?

"ALSA period time: 185759"

I believe this could help also nautibuoy.

The data rate for DSD512 (5.5MB/s for 44k1, 6MB/s for 48k) is close to the limits of BBB Ethernet (6.5MB/s via TCP), but I do not think this is limiting factor now.
 
twluke: how did you forced HQPlayer to use larger buffer than 100ms?

"ALSA period time: 185759"

I believe this could help also nautibuoy.

The data rate for DSD512 (5.5MB/s for 44k1, 6MB/s for 48k) is close to the limits of BBB Ethernet (6.5MB/s via TCP), but I do not think this is limiting factor now.

miero, buffer size is selectable in the HQPlayer settings;

HQP_settings_zpsuygsfjvt.png


these are the settings I've been using.

Ray
 
twluke: how did you forced HQPlayer to use larger buffer than 100ms?

"ALSA period time: 185759"
I didn't force anything. It is coming from simple math. Period time is proportional to period size. As Miska wrote, 8192 PS is equivalent to 11610 PT. So 131072 PS is corresponding to 185759 PT.
I believe this could help also nautibuoy.
I doubt it. As shown by him, the buffer time of 250msec on HQP setting is 176000 PS, that should be corresponding to about 249433 PT.
The data rate for DSD 512 (5.5MB/s for 44k1, 6MB/s for 48k) is close to the limits of BBB Ethernet (6.5MB/s via TCP), but I do not think this is limiting factor now.
That would be nice. Go ahead, please go!

Regards,
 
As my B3 and B3SE are both configured with the DAC clock as it is, the problem may be associated with ASRC function on the side of DACs, though this assumption may not be correct.

Have you tried turning off ASRC? My B3SE is in full sync mode and Russ has suggested somewhere on the Cronus thread that ASRC does nothing in that mode so I plan to disable it and see what happens.

Ray
 
The max. buffer for DSD512 is now limited to the 186ms (even if HQP in GUI says 250ms). Do you think it might help to increase it more? I'm not sure. Asking, because larger buffer will reduce amount of available RAM on BBB.

Beow is the result of top command when playing DSD512:

Code:
top - 20:12:08 up 22:03,  2 users,  load average: 0.33, 0.29, 0.15
Tasks:  88 total,   1 running,  87 sleeping,   0 stopped,   0 zombie
%Cpu(s): 26.4 us, 19.2 sy,  0.0 ni, 51.7 id,  0.4 wa,  0.0 hi,  2.3 si,  0.0 st
KiB Mem :   509672 total,   390996 free,    42792 used,    75884 buff/cache
KiB Swap:        0 total,        0 free,        0 used.   453292 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND     
  486 root      10 -10   25140  14056   2676 S 36.9  2.8  49:43.49 networkaudi+
    3 root      20   0       0      0      0 S  4.8  0.0   5:21.02 ksoftirqd/0
When based on this result, I'd like to think there will be still more room for larger buffer like a period size of 176000.
 
Have you tried turning off ASRC? My B3SE is in full sync mode and Russ has suggested somewhere on the Cronus thread that ASRC does nothing in that mode so I plan to disable it and see what happens.

Ray

I've never tried to turn ASRC off, even after the Hermes/Cronus boards attached to my B3s. Fear of damaging the B3 clock board is one thing and the other one is to keep the ASRC function of ES9018, that I think the main advantage of the chip. Also, I thought the external clocks used for sync should have the rates higher than ordinary audio levels such as 22.5/24.9, probably higher than 90MHz, and, though I may be wrong probably, they should be always multiples of 44.1 or 48.

Last year I searched the clocks more than 90 MHz with multiples of 44.1 and 48 for the Cronus board and only found and bought Abracon 98.304 clock; no 90.3168 as of that time. So I gave up to make the DAC in slave mode with an assumption that 100MHz clock on B3 will do better.

I'm not an expert in this field. So what I wrote above will include many wrong points. I will be much grateful if someone kindly correct them.

Recently Russ introduced a new (or, more accurately, revised) B3SE. I'm now planning to try this new one for evaluation of this issue.

Regards,
 
The max. buffer for DSD512 is now limited to the 186ms (even if HQP in GUI says 250ms). Do you think it might help to increase it more? I'm not sure. Asking, because larger buffer will reduce amount of available RAM on BBB.

Nothing ventured, nothing gained. We can always revert if an increase is problematic.

I'm seeing a similar memory scenario to that twluke illustrates above with his top listing so I don't think RAM is a constraint.

Thanks for sticking with us on this miero.

Ray
 
I've update the DMA driver to allocate buffers of double size than previously. You can try it.

OK, you can try this patch for botic7-rc1 that allocates larger buffers:
cd /lib/modules/4.5.0-botic7-rc1/kernel/sound/soc/davinci
# backup previous module
mv snd-soc-edma.ko snd-soc-edma.ko.orig2
# download module with larger buffers
wget http://bbb.ieero.com/botic7-rc1/snd-soc-edma.ko
# restart
sync
reboot
# try it ...

Small notice: This will reduce amount of free RAM by approx. 3-6MB.
 
I've update the DMA driver to allocate buffers of double size than previously. You can try it.



Small notice: This will reduce amount of free RAM by approx. 3-6MB.

Hi miero, thank you very much for your great contribution to this matter. Well I've just installed the new patch and everything is working fine for now. The period size is just matching with the buffer time required from HQP as shown by the period time of 250000.

Code:
Jul 14 07:52:13 arm networkaudiod[495]: [/usr/sbin/networkaudiod] (495): Set channels: 2 (2)
Jul 14 07:52:13 arm networkaudiod[495]: [/usr/sbin/networkaudiod] (495): Set sampling rate: 22579200 (22579200)
Jul 14 07:52:13 arm networkaudiod[495]: [/usr/sbin/networkaudiod] (495): ALSA engine starting...
Jul 14 07:52:13 arm networkaudiod[495]: [/usr/sbin/networkaudiod] (495): ALSA channels: 2 - 8
Jul 14 07:52:13 arm networkaudiod[495]: [/usr/sbin/networkaudiod] (495): ALSA active channels: 2
Jul 14 07:52:13 arm networkaudiod[495]: [/usr/sbin/networkaudiod] (495): ALSA number of periods: 2
Jul 14 07:52:13 arm networkaudiod[495]: [/usr/sbin/networkaudiod] (495): ALSA period times: 5 - 278640
Jul 14 07:52:13 arm networkaudiod[495]: [/usr/sbin/networkaudiod] (495): ALSA period sizes: 4 - 196608
Jul 14 07:52:13 arm networkaudiod[495]: [/usr/sbin/networkaudiod] (495): ALSA period time: 250000
Jul 14 07:52:13 arm networkaudiod[495]: [/usr/sbin/networkaudiod] (495): ALSA period size: 176400
Jul 14 07:52:13 arm networkaudiod[495]: [/usr/sbin/networkaudiod] (495): ALSA engine started at: 22579200 (22579200)
Jul 14 07:52:13 arm networkaudiod[495]: [/usr/sbin/networkaudiod] (495): enter streaming mode
Jul 14 07:52:13 arm networkaudiod[495]: [/usr/sbin/networkaudiod] (495): ALSA engine running...
Also, I think there is no problem with the amount of the RAM used as shown below.

Code:
top - 07:53:52 up 2 min,  1 user,  load average: 1.39, 0.50, 0.18
Tasks:  83 total,   1 running,  82 sleeping,   0 stopped,   0 zombie
%Cpu(s): 24.3 us, 19.4 sy,  0.0 ni, 49.8 id,  0.0 wa,  0.0 hi,  6.5 si,  0.0 st
KiB Mem :   509672 total,   418460 free,    43612 used,    47600 buff/cache
KiB Swap:        0 total,        0 free,        0 used.   452604 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND                                  
  495 root      10 -10   25760  14560   2592 S 36.6  2.9   0:36.47 networkaudiod                            
    3 root      20   0       0      0      0 S  5.1  0.0   0:05.00 ksoftirqd/0                              
  617 root      20   0    6832   2776   2328 R  1.6  0.5   0:00.29 top
I hope Ray will also have a good result from this new patch.

Best Regards,
 
After a steer from Jussi, I now have my BBB/Botic running as an HQPlayer NAA for both PCM and DSD. I just had to update libasound2 to version 1.0.29 or later.

So Here's an updated set of instructions if you want to try it;

1. I did a clean install of the latest Debian Stretch image (2016-06-09) from here;

BeagleBoardDebian - eLinux.org

2. Installed NAA and Botic;

wget http://ftp.uk.debian.org/debian/pool....1-6_armhf.deb
sudo dpkg –i gcc-6-base_6.1.1-6_armhf.deb
wget http://ftp.uk.debian.org/debian/pool....1-6_armhf.deb
sudo dpkg –i libstdc++6_6.1.1-6_armhf.deb
wget https://www.signalyst.eu/bins/naa/li...0-32_armhf.deb
sudo dpkg -i networkaudiod_3.4.0-32_armhf.deb
wget http://repo.ieero.com/botic/pool/mai...-rc1_armhf.deb
sudo dpkg –i linux-image-4.5.0-botic7-rc1_4.5-botic7-rc1_armhf.deb

3. Updated libasound2;

wget http://ftp.uk.debian.org/debian/pool/main/a/alsa-lib/libasound2-data_1.1.1-1_all.deb

sudo dpkg –I libasound2-data_1.1.1-1_all.deb
wget http://ftp.uk.debian.org/debian/pool/main/a/alsa-lib/libasound2_1.1.1-1_armhf.deb
sudo dpkg –I libasound2_1.1.1-1_armhf.deb

sudo nano /boot/uEnv.txt
# check if there is a line starting with dtb= and change it to dtb=am335x-boneblack-botic.dtb

sudo sync

sudo reboot

Ray

Hi Ray.

I was downloaded your image but not run. Now, I tried follow your instructions but all links to debian server return "404 Not Found". Can you provide operative links?

Thanks for all.

Regards
 
I was downloaded your image but not run. Now, I tried follow your instructions but all links to debian server return "404 Not Found". Can you provide operative links?
6.1.1-6 in the link is already obsolete. Try 6.1.1-8 or 6.1.1-9 instead of 6.1.1-6.

Anyway, you can skip the installation of gcc and libstdc++ in the step 2 and libasound2 in the step 3 by nautibuoy. After clean installation of debian stretch (the step 1 by nautibuoy), just install networkaudiod and miero's linux-image-4.5.0-botic7-rc1_4.5-botic7-rc1 with dtb=am335x-boneblack-botic.dtb in /boot/uEnv.txt. After that update the DMA driver as indicated by miero. That's all.
 
Last edited: