Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOTU 828 (28x32) ucm2 configuration #416

Closed
wants to merge 7 commits into from

Conversation

beatboxa
Copy link
Contributor

I am trying to create a UCM for the Motu 828 (28 x 32), which was released in 2024. (Caution: there have been several versions of the 828 over the past few decades. I am referring to the 2024 model).

I am not particularly technical when it comes to code and I had to google what a Pull Request is. And I am struggling on how to do this. I had previously created an issue here: #415

I have made 2 different attempts at creating a ucm configuration: 1 with and 1 without use of the split pcm macros. I based the 'macro version' loosely on the Motu M6 ucm. And I created the one without based on a guide I found online. The version without macros seemed to get further; but for purposes here, I will attempt the Macro version.

Here are the files and changes I have created. Unfortunately, when I run the command spa-acp-tool -c 0 -vvvv info, the results are:
`spa-acp-tool -c 0 -vvvv info

variable '${var:__Device}' is not defined in this context!
error: /USB-Audio/MOTU/D828-HiFi.conf failed to parse device
error: failed to import hw:0 use case configuration -22
variable '${var:__Device}' is not defined in this context!
error: /USB-Audio/MOTU/D828-HiFi.conf failed to parse device
error: failed to import 828 use case configuration -22
UCM not available for card 828
`

At which point the system goes into an alsa fallback / default.

What am I doing wrong?

beatboxa added 4 commits May 13, 2024 16:25
Adds search for Motu 828 and points to the MOTU / D828 location for configuration files.
Motu 828 configuration file, points to D828-HiFi.conf file.
HiFi conf file for MOTU 828.  Aligns to factory settings.
Fixed error in naming SplitPCM (needed to be motu828_stereo_in, not just 828_stereo_in)

Removed 2x in+out Optical 8-channel ADAT,, replaced with 2-channel optical SPDIF
@beatboxa
Copy link
Contributor Author

After some changes, I also had to apply this patch; NixOS/nixpkgs#272991

And now, it appears to go further in the chain. It appears to find the UCM profiles, sets the ucm verb to HiFi, add ports. Eventually, however, I get to this:

ALSA device (null) roles: null
Check device Mic1 conformance with 0 other devices
First device in combination, number 1
Add port [In] Mic1: Mic / Line / Instrument In 1
Port [In] Mic1 direction input, priority 200
Adding profile HiFi to port [In] Mic1.
Check device Mic1 conformance with 0 other devices
First device in combination, number 1
Port [In] Mic1 direction input, priority 200
ALSA device (null) roles: null
Found 0 jacks.
activate profile: pro-audio (2)
Device: Pro mapping 'Pro' (pro-output-0).
Device: Pro mapping 'Pro' (pro-input-0).
No ELD device found for port [Out] SPDIF1 (0).
No ELD device found for port [Out] Headphones2 (0).
No ELD device found for port [Out] Headphones1 (0).
No ELD device found for port [Out] Line5 (0).
No ELD device found for port [Out] Line4 (0).
No ELD device found for port [Out] Line3 (0).
No ELD device found for port [Out] Line2 (0).
No ELD device found for port [Out] Line1 (0).
No ELD device found for port [In] SPDIF4 (0).
No ELD device found for port [In] Line10 (0).
No ELD device found for port [In] Line9 (0).
No ELD device found for port [In] Line8 (0).
No ELD device found for port [In] Line7 (0).
No ELD device found for port [In] Line6 (0).
No ELD device found for port [In] Mic2 (0).
No ELD device found for port [In] Mic1 (0).
card 0: profiles:3 devices:18 ports:16
properties: (11)
use-ucm = "true"
verbose = "true"
alsa.card = "0"
alsa.card_name = "828"
alsa.long_card_name = "MOTU 828 at usb-0000:59:00.0-9, high speed"
alsa.driver_name = "snd_usb_audio"
alsa.mixer_name = "USB Mixer"
alsa.components = "USB07fd:000e"
alsa.id = "D828"
device.string = "0"
device.description = "828"

Cleanup for consistency and added notes for future iterations
@beatboxa
Copy link
Contributor Author

The above configuration seems to work as a baseline. Note the comments at the beginning of the file: there are some future features to be done, including adding missing ports--namely two banks of 8-channel ADAT ports--because the macro only appears to work with up to 2 channels of parameters.

Copy link
Contributor Author

@beatboxa beatboxa left a comment

Choose a reason for hiding this comment

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

This is a clean and working instance.
However, there are 16 input and 16 output channels missing
(8x Optical A in, 8x Optical A out, 8x Optical B in, 8x Optical B out).

I don't know how to do an 8-channel source or sink.

perexg added a commit to perexg/alsa-ucm-conf that referenced this pull request May 14, 2024
MOTU 828 has up to 32 hardware channels. Add support for this
configuration to common/pcm/split.conf.

Also, add support for up to 8 channels for the abstact devices
(like 7.1 surround).

Note that this change requires recent alsa-lib (Syntax 7).

Link: alsa-project#416
Signed-off-by: Jaroslav Kysela <[email protected]>
@perexg
Copy link
Member

perexg commented May 14, 2024

Comments: I added support up to 32 channels / 8 logical channels to PR #417 . Note that this requires recent (not yet released) alsa-lib and Syntax 7 in USB-Audio.conf.

To describe conflicts - use ConflictingDevice section. Look to other configuration files for an example. E.g. if two devices are sharing same channels, mark them as conflicting. It's enough to add this section to one conflicting device. The dependencies will be resolved automatically.

@beatboxa
Copy link
Contributor Author

Thank you, @perexg . Also, a question: I noticed that in both the command line and in gnome's sound settings, the port orders are reversed (eg. Line 3-4 shows up before Line 1-2). Is this a bug, or should I define the configuration in reverse order, in order to have the devices show up in logical/intuitive order in applications?

@perexg
Copy link
Member

perexg commented May 14, 2024

The sound servers should show the device list sorted according the priority value. It looks like a problem somewhere else (pipewire or pulseaudio). I suggest to check the list also using the alsaucm tool like alsaucm -c hw:1 dump text | grep -E "(Device.|Priority)".

@beatboxa
Copy link
Contributor Author

In testing the results, I don't think the priority has anything to do with the order that the devices are shown. I can go into the D828-HiFi file, change the order of a device, without changing the priority.

The result is that for the alsaucm command you recommended, the order is consistent with the order written in the D828-HiFi file (top to bottom, not by priority); but the spa-acp-tool and in gnome settings, the order is reversed.

So, for example, in my latest D828-HiFi.conf file, in one part, I have the following consecutive order for 3 devices (top to bottom):

  1. Line 3 - Priority 175
  2. Mics 1-2 - Priority 195
  3. Optical A spdif - Priority 120

In alsaucm, these show up in the order listed above.

However, in spa-acp-tool and in gnome settings (under sound), these show up as:

  1. Optical A spdif
  2. Mics 1-2
  3. Line 3

(reverse ordered)

I had earlier linked a separate issue; and within it, there is this comment that seems to have the same observations as mine: alsa-project/alsa-lib#245 (comment)
It appears that somewhere between alsa-lib 1.2.4 and 1.2.7, the probe order has reversed.

For now, I will reorder my devices as I add mono/stereo conflict resolution, so that they show up correctly in my GUI's settings panel. It is relatively simple to reverse the order again, should there be a future change to alsa-lib or whatever the root cause turns out to be.

- Added alternate stereo/mono devices for line inputs
- prefaced names with [mono] or [stereo] to improve UX
- Adopted naming convention for line devices to make code easier to follow
- Reordered devices to show up in an intuitive order to improve UX
- Added comments
- Cleanup
Copy link
Contributor Author

@beatboxa beatboxa left a comment

Choose a reason for hiding this comment

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

Made some updates:

  • Mono / stereo line sources
  • Naming convention
  • Reordering
  • comments

@perexg
Copy link
Member

perexg commented May 15, 2024

  1. order is wrong from the configuration POV, the sound servers should keep the UCM device order or sort devices by priority - you should report your issue there

  2. UCM device naming has rules - https://github.com/alsa-project/alsa-lib/blob/master/include/use-case.h#L132-L144 (also see the above comment)

Removed and cleaned up previous naming convention, to follow alsa-lib naming rules

Reordered devices
perexg added a commit that referenced this pull request Aug 2, 2024
MOTU 828 has up to 32 hardware channels. Add support for this
configuration to common/pcm/split.conf.

Also, add support for up to 8 channels for the abstact devices
(like 7.1 surround).

Note that this change requires recent alsa-lib (Syntax 7).

Closes: #417
Link: #416
Signed-off-by: Jaroslav Kysela <[email protected]>
@perexg perexg closed this in 16c7166 Aug 2, 2024
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