• 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

The 24576000 belongs to the 48k family.

Then I should use 22579200 or 45158400 clock for 44.1 and multiples.
For 48k and so on I will use the internal clock hence the setting snd_soc_botic.ext_masterclk=1

As the frequency was programmable in uEnv.txt I gues any clock would be fine as long as I get a decent fs ( like 192fs / 256fs / 384fs and so on .. )
But this is more important for the DAC chip after all .. I was not aware that the BBB is limited in accepted external clock frequencies.
I just happend to have a Tentlabs XO available with 16.934 clock from a previous project.

Any other comments or should I be fine when I install a 22.579 clock ?
 
Is the 22 / 24 MHz a hardware requirement from the BBB design of is the Botic driver programmed that way ?

Tentlabs is using a square sized clock (plugged in a DIL-14 socket) so I will have to check if the DIL pins are also connected / usable for these longer clock modules.

Of course I can Always buy the square Tentlab clock in 22.579.
 
Is the 22 / 24 MHz a hardware requirement from the BBB design of is the Botic driver programmed that way ?

It is not mandatory but you can get the best quality of sound system by applying these external clocks to the Botic driver.

Tentlabs is using a square sized clock (plugged in a DIL-14 socket) so I will have to check if the DIL pins are also connected / usable for these longer clock modules.
The size and shape will not matter as long as you can deal with placement and maybe soldering. For Crystek clocks, TPA provides a particular clock board suitable to them. You might want to check here. Other than the clock modules, you'll find a blank Rhea board, which will fit to a 10P IC socket.
 
It is not mandatory but you can get the best quality of sound system by applying these external clocks to the Botic driver.

If it is not mandatory it migth work with 16.934 for 44.1 ?
I have only 1 album on 88.2 and none at 176.4 so if the majority will be 44.1 anyway (which still gives 384fs) it should be plenty enough.

Sorry to be a pain in the *** but I just want to be sure I do not need to buy a new clock but also want to avoid trying to get something to work that is not supported at all ... which is something different than "not recommended" ;-)

The size and shape will not matter as long as you can deal with placement and maybe soldering. For Crystek clocks, TPA provides a particular clock board suitable to them. You might want to check here. Other than the clock modules, you'll find a blank Rhea board, which will fit to a 10P IC socket.

I will stick to the Tentlabs XO board ...

Thanks anyway for your input :D
 
If it is not mandatory it migth work with 16.934 for 44.1 ?
"Not mandatory" means you have to live with only 48k sources without complaints. If you want to go with 44.1k sources on a Botic system, a 22.5792 MHz clock is mandatory.

Shown below is an example of experimental Botic system with external clocks (and with an isolator), that was best refined as Hermes and Cronus boards by TPA nearly a year ago.

Regards,
 

Attachments

  • IMG_1238.JPG
    IMG_1238.JPG
    154.4 KB · Views: 233
O.K. I will buy an 22.579 clock to make it happen.

I will only use the external clock for 44.1 (and 88.2) and use the onboard 24.576 for 48k and up.

My "wooden" breadbord with my other BBB looks like this with the Tentlabs between the 2 power supply boards. As you can see the external clock is not connected to the BBB yet.

540.jpg
 
I am still learning and getting closer to get it working but I am still struggling for many days now to nail it.

My setup will be to use an external clock for 44.1k only (ext_masterclk=1) but for testing I am using only the onboard clock (ext_masterclk=0) before I will implement the extra clock.

I installed the Botic distro V4 and upgraded that to V5.
I use the MPad app to control the music and see all music on my NAS.

For now I think the BBB is still expecting an external clock because when I want to play a song it stays at 0:00 and no progress.
Could it be it is waiting for an external clock ??

Doing speaker test it does not continue after “0 – Front Left” and have to break it with “Ctrl + C”
root@botic:~# speaker-test -c 2
speaker-test 1.0.27.2

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 64 to 16384
Period size range from 3 to 1025
Using max buffer size 16384
Periods = 4
was set period_size = 1024
was set buffer_size = 16384
0 - Front Left


Some more system information:

root@botic:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Botic [Botic], device 0: external dac-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0


root@botic:~# uname -a
Linux botic 4.0.0-botic5 #1 PREEMPT Tue Apr 28 23:42:17 CEST 2015 armv7l GNU/Linux

etc/mpd.conf
/audio_output {
type "alsa"
name "Botic"
device "hw:0,0"
dsd_usb "no"
dsd_native "yes"
dsd_native_type "3"
priority "FIFO:32"
period_time "1"
mixer_type "software"
# mixer_device "default" # optional
# mixer_control "PCM" # optional
# mixer_index "0" # optional


/boot/uEnv.txt
#Docs: http://elinux.org/Beagleboard:Uboot_partitioning_layout_2.0

Uname -ar=4.0.0-botic5
#dtb=
cmdline=quiet init=/lib/systemd/systemd

##Example
#cape_disable=capemgr.disable_partno=
#cape_enable=capemgr.enable_partno=

##enable BBB: eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

uuid=ccd47fbd-12c5-404b-9098-53ecaf665e30


/boot/uboot/uEnv.txt
optargs=fixrtc snd_soc_botic.ext_masterclk=0 snd_soc_botic.serconfig=I--- snd_soc_botic.dai_format=16385

root@botic:~# for i in /sys/module/snd_soc_botic/parameters/*; do echo "* $i"; cat $i; done
* /sys/module/snd_soc_botic/parameters/blr_ratio
64
* /sys/module/snd_soc_botic/parameters/clk_44k1
22579200
* /sys/module/snd_soc_botic/parameters/clk_48k
24576000
* /sys/module/snd_soc_botic/parameters/dai_format
16385
* /sys/module/snd_soc_botic/parameters/dsd_format_switch
1
* /sys/module/snd_soc_botic/parameters/ext_masterclk
3
* /sys/module/snd_soc_botic/parameters/helper_cmd
* /sys/module/snd_soc_botic/parameters/pinconfig
default
* /sys/module/snd_soc_botic/parameters/serconfig
I---


If I understand correct the files in /sys/module/snd_soc_botic/parameters are not relevant as the uEnv.txt is telling the BBB how to act ?
One typical thing is that I can edit all files in /sys/module/snd_soc_botic/parameters exept for ext_masterclk so here it stay on value “3”
I am not sure if this is relevant anyway …

P.S. I have not connected the I2S signals to the (ES9023) DAC yet but I guess it should play anyway as it does not need any feedback / communication to/from the DAC ??

Please help me to find the problem ….
 
Member
Joined 2007
Paid Member
I am still learning and getting closer to get it working but I am still struggling for many days now to nail it.

The behavior you describe is what happens when my BBB is powered but the DACs and clocks are not powered. Because your hardware is different, it is very difficult to troubleshoot by speculation. My only suggestion is to double-check that all of your GPIO connections are correct and, if possible, confirm their output with a fast scope.

Debug info can be hard to come by. The command 'aplay' has a good amount of debug information if you use the -v flag (verbose). I suggest moving one music file to your local memory and try to play it with, for example:
Code:
aplay -c 2 -v -D hw:0,0 /pathto/somefilename.wav
Good luck!
 
Don't get mislead by the picture or previous info.
The picture is of my other BBB which serves me fine in the meantime with I2S direct without the botic driver.

So I have all the time to play around with the second BBB but have to admit playing around too long is no fun anymore ;-)

I started again from scratch and only need to confirm for myself that the Botic driver works although at first with the onboard clock only before I step up to include the external clock for 44.1k (I have the 22.579 clock availale now).

I am not using Volumio / Squeezelte or any other additional modules besides plain MPD.

Later today I will try to play a local file with debugging as suggested.

One question ... Is the single line what I posted for /boot/uboot/uEnv.txt all there should be ? With the different configurations whih I tried until now the file uEnv.txt was always empty so I have to put the correct info in there myself.
I am not sure if it is supposed to be empty when setting up with Botic distro or driver.
 
Member
Joined 2007
Paid Member
Greetings Miero!

I would like your perspectives on ways to input outside signals to the BBB under Botic. In particular, I want SPDIF from video sources to be accessible to the BBB. I can convert it to I2S and don't care about pristine quality! Resampling is perfectly OK, as long as the BBB can act as an active crossover as it does under MPD/Squeezelite. Is there a patch to make 'record' input to the mcasp serializers work? If not, no problem! I can work 'outside the box' to perhaps get USB input working.

My good news is that by Boticizing Debian 8.3 I can now use a new set of advanced LADSPA crossover filters to create more customized crossover profiles. As part of the design and change-over process, I want to finally solve the problem of processing and filtering audio from video appliances. Should I look into USB input?

Best,

Frank
 
Guys,

I am just starting on this...and need your help:

- First of all, I bought a Beaglebone GREEN. This is the one WITHOUT HDMI. So: Will this Output I2S or is only the black Version capable of doing so ?

- I have downloaded Botic 4 from the Webpage, wrote it to SD, boot with "User/Boot"-buttom pressed.

- I do not have anything connected to the BBB, it is just the standalone board attached over USB to Putty.

When I am booting WITHOUT the SDcard: I can connect with Putty at 192.168.7.2. No issue. When I boot with/from SDcard: No Connection possible anymore.

So, I am not clear what booting from the SCcard should accomplish: Is this a Kind of Live-USB-Boot, so the whole System Comes from the Card, or will it install just some Drivers / Settings onto the internal eMMC and Need only once applied ? Or is the GREEN-Version the issue ?

THX for your support
 
Last edited:
Member
Joined 2007
Paid Member
Guys,
- I do not have anything connected to the BBB, it is just the standalone board attached over USB to Putty.

I suggest using the ethernet connection. Then login directly from a terminal as root - like 'ssh root@xxx.xxx.xxx.xxx'. Password is 'botic'. You can find the BBB's IP with a network scanning program (like 'Fing' for smartphones), or perhaps from the terminal by executing 'arp -a'.
 
Debug info can be hard to come by. The command 'aplay' has a good amount of debug information if you use the -v flag (verbose). I suggest moving one music file to your local memory and try to play it with, for example:
Code:
aplay -c 2 -v -D hw:0,0 /pathto/somefilename.wav
Good luck!

This is what I get playing a song:

root@botic:~# aplay -c 2 -v -D hw:0,0 /mnt/music/GetHere.wav
Playing WAVE '/mnt/music/GetHere.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Hardware PCM card 0 'Botic' device 0 subdevice 0
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 44100
exact rate : 44100 (44100/1)
msbits : 16
buffer_size : 32768
period_size : 2048
period_time : 46439
tstamp_mode : NONE
period_step : 1
avail_min : 2048
period_event : 0
start_threshold : 32768
stop_threshold : 32768
silence_threshold: 0
silence_size : 0
boundary : 1073741824
appl_ptr : 0
hw_ptr : 0
aplay: pcm_write:1939: write error: Input/output error

But I have no idea what I should be looking for ... besides that it gives an error in the last line.
 
SOLVED !! ... but there must still be a driver / software bug

As I wanted to test it first with minimal components before I put all extra bells and whistles on it I deliberately set "optargs=fixrtc snd_soc_botic.ext_masterclk=0 snd_soc_botic.serconfig=I--- snd_soc_botic.dai_format=16385" in /boot/uboot/uEnv.txt to use the internal clock only.

But I had to connect my 22,579 clock anway at input 25 before I could play the song without error.
Now I can play my complete library via the iPad without any issues too :)

Why is the clock setting=0 not working properly ?

The typical thing is that in "/sys/module/snd_soc_botic/parameters/" the value for ext_masterclk stay at value 3.

Is this a software bug ?
Even if I try to edit this value mayself to change from 3 to 0 as I tried in the beginning I get a "PERMISSION DENIED" so could this preventing Botic from the ability to change the value internally ?

I could edit serconfig from MMM to I--- without problems but did I have to edit this at all ??

What is the exact relation between uEnv.txt and /sys/module/snd_soc_botic/parameters/ ??

Maybe Miero knows ??