• CTAG-ALSA
  • ALSA sound card evaluation weirdness on Linux 4.19 kernel

Have been observing some weird behaviour on the CTAG FACE 8 cape on Kernel 4.19.

When playing 8 channel audio on C8CH, the first 4 channels (DAC1/DAC2) seem to work ok, but the last 4 channels (DAC3/DAC4) are incredibly muted, and I couldn't work out why.

So I've taken measurements with https://github.com/henrix/ALSA-sound-card-evaluation to see how a known working configuration (based on 4.4 kernel) and the 4.19 configuration compares.

Measuring the frequency response of CTAG FACE 8 on Linux 4.4 (using ctag_bone_debian_v0.1.2.img) results in the expected output.

alt text

The exact same measurement process on Linux 4.19 (using bone-debian-11.3-iot-armhf-2022-05-10-4gb.img - which has support for the card built in now), results in a very patchy frequency response:

alt text

Has anyone actually confirmed that CTAG FACE 8 works properly on Linux 4.19, or recommend what can be done to get it to work on 4.19?

The above measurements were undertaken by bridging DAC1 and ADC1 but any combo produces similar results.

I'd appreciate any pointers where to look or approach to investigate further.

Note - I need SO_TXTIME support in the kernel which was only introduced added in 4.19.

    siraaris results in a very patchy frequency response:

    That is a very weird frequency response: what happens to magnitude between 250 and 10000 Hz? It just "disappears"??? Or does it go below -70dB and your software just removes the line? When you listen to those outputs, what do you get? Is this on those channels that you refer to as "muted" early on (i.e.: the last 4 ones) ? Or is it also on the first 4 channels?

    siraaris I'd appreciate any pointers where to look or approach to investigate further.

    I would hook the device to a scope and inspect the FSCK, BCK, AXR0 and AXR2 lines. I think the slot size is fixed at 32 bit (data size can be 16, 20 or 24 bit). Verify that:

    • you get at least 8slots 32width = 256 BCK per each FSCK. This could even be 16slots 32width = 512 BCK per each FSCK, depending on the driver configuration
    • that you see data on AXR0 (input into BBB from ADC) on slots 0, 1, 2, 3
    • that you see data on AXR2 (output from BBB to DAC) on slots 0, 1, 2, 3, 4, 5, 6, 7

    If any of the above doesn't match, it gives a clue as to what the relevant part of the driver to look into may be.

    What device tree overlay are you using?

    Thank you for the reply.

    I'm software only, so here goes.

    I got it wrong before. When I connect DAC3 and DAC4 to powered speakers I generally hear things relatively clearly. It's perhaps a little low in volume compared to what I would expect, but music sounds relatively coherent.

    When I connect to DAC1 and DAC2, the sound is very low in volume, and muted. I need to really pump up the volume to hear anything really.

    So hence moving to a measurement based approach, using @henrix 's ALSA sound card evaluation scripts. These work perfectly on 4.4 but produce just really weird measurements with 4.19.

    What would help is a definitive answer as to whether the CTAG face is expected and actually working properly on 4.19 - on any configuration that I can reproduce. A built image is all well and good, but what really helps is a narrative on precisely the questions being asked here (what version, what configuration, what source repo and process/script was used to create the image, that way one can follow steps when looking to evolve support /test for when things need to evolve, such as getting CTAG working with ALSA on a recent-ish kernel).

    As to which overlay versions, I've tried the "default" that comes with the 4.19 BB kernels, and also tried from https://github.com/beagleboard/bb.org-overlays.git

    Aris

      siraaris I'm software only, so here goes.

      Can you send me your kernel / image ? I can then scope it here.

      siraaris What would help is a definitive answer as to whether the CTAG face is expected and actually working properly on 4.19 - on any configuration that I can reproduce.

      I don't think there is such a thing available right now and I am sorry that this is the case. Thanks for your exploration and pointers here and in the other thread, I'll get back to the maintainers to see if they can make it work. Is there a specific preference for 4.19 or could it be any LTS version after that?

      Debian 10/Buster is in LTS for the next two years, but it may make sense to also support Debian 11/Bullseye with the latest 5.x kernel (5.19?), as that would probably give a runway to mid 2026 inclusive of LTS.

      @giuliomoro I’m more than happy to test and write up documentation and liaise with upstream to get patches included etc.

      I’ve been working on using the BBB with CTAG cape as part of an active speaker system design & build and this last bit (to hear how they sound!) is the final step of an 18 month process - so very excited to finally see the project proof of concept complete!!!