Skip to content

ASoC: hifiberry-studio: add AES CS Mode control (channel status format) - #7527

Merged
pelwell merged 1 commit into
raspberrypi:rpi-6.18.yfrom
hifiberry:hifiberry-studio-6.18
Jul 29, 2026
Merged

ASoC: hifiberry-studio: add AES CS Mode control (channel status format)#7527
pelwell merged 1 commit into
raspberrypi:rpi-6.18.yfrom
hifiberry:hifiberry-studio-6.18

Conversation

@hifiberry

@hifiberry hifiberry commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Adds an enum control on HiFiBerry Studio Digi (AES) cards to select the channel status format transmitted by the DIT, backed by controller register 0x90 (DIGI_CS_FORMAT in the card firmware register map):

Mode Behaviour
Consumer IEC 60958-3 channel status (no CRCC defined)
Professional AES3, byte 5 = 0 (spec-literal; the CRCC in byte 23 is invalid, since the DIX9211 can only program channel status bytes 0-5 and transmits bytes 6-23 as zero)
Professional CRC AES3, byte 5 carries the CRC fixup value that makes the CRCC over bytes 0-22 come out 0x00, matching the zero byte 23 the chip transmits (firmware default)

The control is registered only for the AES card type (same gating as the existing Clock mode / Current Sample Rate controls); DAC8x cards are unaffected.

Verified on a Studio Digi I/O on CM5: channel status decode and CRC validity confirmed on an Audio Precision analyzer in all three modes (Professional CRC validates, Professional raw shows the expected invalid CRCC, Consumer decodes as consumer format), audio pass-through unaffected at 44.1-192 kHz.

Comment thread sound/soc/bcm/hifiberry_studio.c Outdated
#define CARD_CLK_OVRWR 0x38
#define CARD_STREAM_STATUS 0x39
#define CARD_DIR_FS 0x3A
#define CARD_CS_FORMAT 0x73 /* AES channel status format */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is correct? All the other values in this block are in ascending order and unique.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, as this is a special control only to be used for the Studio Digi, we moved it to a higher range.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BUt let me rename it, the CARD_ prefix is a bit misleading here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And perhaps put it next to the other 0x73 value (ADC_SAMPLE_FORMAT) to make it clear that this is intentional.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me move it to a completely different block that it doesn't overlap with the ADC range at all. I'll send an update soon.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved it now to a seperate block and a seperate address. The firmware on the board has been updated too to match this (still on my bench here)

@hifiberry
hifiberry force-pushed the hifiberry-studio-6.18 branch 2 times, most recently from 2ce5fa4 to dc496e7 Compare July 29, 2026 14:16
Add an enum control on AES cards to select the channel status format
transmitted by the DIT, backed by card register 0x90
(DIGI_CS_FORMAT in the card firmware register map):

  Consumer          - IEC 60958-3 channel status (no CRCC defined)
  Professional      - AES3, byte 5 = 0 (spec-literal; the CRCC in byte
                      23 is invalid since the DIX9211 can only program
                      channel status bytes 0-5 and transmits 6-23 as 0)
  Professional CRC  - AES3, byte 5 carries the CRC fixup value that
                      makes the CRCC over bytes 0-22 come out 0x00,
                      matching the zero byte 23 the chip transmits
                      (firmware default)

Verified on a Studio Digi I/O: channel status decode and CRC validity
checked on an Audio Precision analyzer in all three modes.

Signed-off-by: Daniel Matuschek <info@hifiberry.com>
@hifiberry
hifiberry force-pushed the hifiberry-studio-6.18 branch from dc496e7 to c494d5d Compare July 29, 2026 14:17
@pelwell
pelwell merged commit 58792fc into raspberrypi:rpi-6.18.y Jul 29, 2026
12 checks passed
@hifiberry

Copy link
Copy Markdown
Contributor Author

Thanks for merging so fast

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants