A lot has happened since the original Beaglebone White and the original DVI-D with Audio cape have been released. The Ångstrom distribution has been ditched and Robert C. Nelson produces Debian-based images and kernel updates at an impressive pace. Clearly, the primary focus is on the Beaglebone Black and while compatibility with Beaglebone White is also maintained, some of the capes are no longer supported, probably because they are not compatible with the Beaglebone Black.
In my latest project trying to create a remote control kit for my IC-706, I wanted to use some Beaglebone Whites I have left from earlier projects. They need to have audio I/O capability and while using USB soundcards is possible, I would really prefer to use an audio cape. Fortunately , the leftovers include an Audio Cape rev A and a DVI-D with Audio cape also rev A.
Trying the latest Debian image labeled 2014.09.03 I found that the audio cap is working just fine but the DVI-D with Audio is not loaded. Instead a message appears in the console output during boot:
[ 1.885331] udevd: starting version 175
[ 2.062352] bone-capemgr bone_capemgr.8: failed to load firmware 'BB-BONE-DVID-02-00A0.dtbo'
[ 2.071409] bone-capemgr bone_capemgr.8: loader: failed to load slot-0 BB-BONE-DVID-02:00A0 (prio 0)
I couldn’t find any more info why capemgr fails to load the device tree object so I was left with Google.
One of the first results that shows up is actually very helpful. It is a message on the Beagleboard list from February 2014 that deals with exactly this problem. According to the message, the device tree spec is simply missing from the kernel source tree and the author was kind enough to attach a patch that adds the missing .dts file. There haven’t been any responses from Beagleboards devs and the problem still persists, so I can only assume that this cape is no longer supported.
To compile this device tree source in a device tree overlay blob (.dtbo) that can be loaded by the kernel we need the device tree compiler. This is not installed by default on the console image that I am using. Note that as of writing we need a patched version that supports device tree overlays, see Beagleboard and the 3.8 Kernel if you are interested in the details.
To get the proper device tree compiler (dtc) get the dtc.sh script from Robert C. Nelson and run it on the Beaglebone:
$ wget -c https://raw.githubusercontent.com/RobertCNelson/tools/master/pkgs/dtc.sh
$ chmod +x dtc.sh
This will install a bunch of dependencies, checkout the correct branch of the device tree compiler, build it and install it in /usr/local/bin.
Compile the .dts file and copy the resulting binary to /lib/firmware/:
$ dtc -O dtb -o BB-BONE-DVID-02-00A0.dtbo -b 0 -@ BB-BONE-DVID-02-00A0.dts
$ sudo cp BB-BONE-DVID-02-00A0.dtbo /lib/firmware/
The device tree overlay can now be loaded using:
$ sudo su
$ echo BB-BONE-DVID-02 > /sys/devices/bone_capemgr*/slots
You should see the LED on the board start blinking and in the syslog the following should appear:
[ 3006.665385] bone-capemgr bone_capemgr.8: part_number 'BB-BONE-DVID-02', version 'N/A'
[ 3006.665503] bone-capemgr bone_capemgr.8: slot #5: generic override
[ 3006.665527] bone-capemgr bone_capemgr.8: bone: Using override eeprom data at slot 5
[ 3006.665551] bone-capemgr bone_capemgr.8: slot #5: 'Override Board Name,00A0,Override Manuf,BB-BONE-DVID-02'
[ 3006.665695] bone-capemgr bone_capemgr.8: slot #5: Requesting part number/version based 'BB-BONE-DVID-02-00A0.dtbo
[ 3006.665717] bone-capemgr bone_capemgr.8: slot #5: Requesting firmware 'BB-BONE-DVID-02-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[ 3006.698223] bone-capemgr bone_capemgr.8: slot #5: dtbo 'BB-BONE-DVID-02-00A0.dtbo' loaded; converting to live tree
[ 3006.698922] bone-capemgr bone_capemgr.8: slot #5: #5 overlays
[ 3006.706184] of_get_named_gpio_flags exited with status 51
[ 3006.706216] of_get_named_gpio_flags exited with status 50
[ 3006.706235] of_get_named_gpio_flags exited with status 51
[ 3006.706580] of_get_named_gpio_flags exited with status 50
[ 3006.709612] of_get_named_gpio_flags exited with status 31
[ 3006.709647] tfp410 panel.11: Power GPIO active high, initial state set to high
[ 3006.712501] platform 4830e000.fb: alias fck already exists
[ 3006.716403] of_get_named_gpio_flags: can't parse gpios property
[ 3006.716433] tilcdc 4830e000.fb: No power control GPIO
[ 3006.716811] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
[ 3006.716828] [drm] No driver support for vblank timestamp query.
[ 3006.722711] tilcdc 4830e000.fb: No connectors reported connected with modes
[ 3006.722760] [drm] Cannot find any crtc or sizes - going 1024x768
[ 3006.737483] Console: switching to colour frame buffer device 128x48
[ 3006.746544] tilcdc 4830e000.fb: fb0: frame buffer device
[ 3006.746561] tilcdc 4830e000.fb: registered panic notifier
[ 3006.746606] [drm] Initialized tilcdc 1.0.0 20121205 on minor 0
[ 3006.769477] of_get_named_gpio_flags: can't parse gpios property
[ 3006.773344] 1-001b supply IOVDD not found, using dummy regulator
[ 3006.773446] 1-001b supply DVDD not found, using dummy regulator
[ 3006.773518] 1-001b supply AVDD not found, using dummy regulator
[ 3006.773599] 1-001b supply DRVDD not found, using dummy regulator
[ 3006.786478] davinci_evm sound.12: tlv320aic3x-hifi <-> 48038000.mcasp mapping ok
[ 3006.797441] bone-capemgr bone_capemgr.8: slot #5: Applied #5 overlays
There should now also be a sound card present:
debian@beaglebone:~$ cat /proc/asound/cards
0 [EVM ]: DA830_EVM - DA830 EVM
We can test the sound card using apeaker-test from the alsa-utils package. The simplest test is to run “speaker-test -twav” but check out all the useful options of the program:
$ debian@beaglebone:~$ speaker-test -h
Usage: speaker-test [OPTION]...
-D,--device playback device
-r,--rate stream rate in Hz
-c,--channels count of channels in stream
-f,--frequency sine wave frequency in Hz
-F,--format sample format
-b,--buffer ring buffer size in us
-p,--period period size in us
-P,--nperiods number of periods
-t,--test pink=use pink noise, sine=use sine wave, wav=WAV file
-l,--nloops specify number of loops to test, 0 = infinite
-s,--speaker single speaker test. Values 1=Left, 2=right, etc
-w,--wavfile Use the given WAV file as a test sound
-W,--wavdir Specify the directory containing WAV files
Recognized sample formats are: S8 S16_LE S16_BE FLOAT_LE S32_LE S32_BE
If you hear nothing in the headphones it is probably because the gain is turned down. Start alsamixer and play with the PCM and the HP DAC settings. Of course, you can also play with the other settings but most of them have no effect. If you look at the schematics of the audio cape you will see that only Line In and Headphones are connected.
On the other hand, it could be very interesting to play with the AGC and filter settings, but that’s a topic for a different post.
For reference, my dts and dtbo files are available in the ic706-remote git repository:
- BB-BONE-DVID-02-00A0.dtbo (Beaglebone Debian 2014.09.03 with kernel 3.8.13-bone64)
Before finishing off I should credit Adafruit and Hipstercircuits for providing useful pointers in resolving this issue:
- Adafruit: Introduction to the Beaglebone Device Tree
- Hipstercircuits: Problems with BeagleBone Black and their solution
And of course “cde” for posting the dts file on the beagleboard mailing list.