Webconf Audio Hardware parameters' syntax guide?

Hi @zynthianers!

I wonder where I could find a reference guide, for configuring Hifiberry audio devices, in terms of both performance optimisation and system integration.

Some of the parameters are intuitively traceable, in the audio hardware (advanced) configuration page of webconf (like sample rate and buffer size), others seem more techy and obscure. I assume that what is written and saved in webconf should go somewhere in the config.txt and/or cmdline.txt files, right?

More specifically: I need to modify the mixer parameters of a Hifiberry DAC + ADC Pro audio profile, in order to function correctly with the new DAC 8X model, so as Zynthian may see and expose four stereo audio outputs, and no ADC inputs.

Any suggestions? :slight_smile:

(PS: I cannot find a way to save custom audio and video device profiles in webconf).

1 Like

Hi @Aethermind ,

you won’t be able to use the 2 hifiberry boards simultaneously.

If you just need the 4 stéréo outputs, the hifiberry x4 DAC is enough.

Hi @le51,

Thank you for the feedback!

Actually, I didn’t refer to using two Hifiberry audio devices at once - which would be impossible of course - but to configuring the Mixer parameters, in order to drive the four available stereo outputs of the DAC 8X, hopefully on a chain basis.

Given the (surprising) lack of technical information on the part of the Hifiberry support themselves, I walked the road of modifying one of the existing Hifiberry audio hardware webconf profiles.

So far so good, providing that I have oriented correctly the ribbon cable (coupling Pin 1 - brown with the J3 symbol on the Hifiberry GPIO connector), but Oram only sees and uses one stereo output.

What I just need is to activate, on the mixer parameters bottom of the webconf page, the further three stereo outs of the DAC 8X (as the only Zynthian audio device) and arguably erasing the ADC input part, not supported by the board.

See the webconf screenshot attached, with my attempt at adapting the DAC + ADC profile.

Tentative Hifiberry DAC 8X configuration profile

Zynthian Oram will show all ports on the soundcard. Why have you restricted the quantity of inputs and outputs with the -i and -o parameters?

Hi @riban :blush:, thank you for chiming in!

I have not restricted the inputs and outputs, and I suspected that, not knowing the audio config syntax, simply changing the overlay command from DAC + ADC Pro to DAC 8X would not do the trick, of setting up the eight mono channels/four stereo outs adequately (as it turned out to be).

So, please, do freely suggest any useful modifications in the audio board configuration parameters, both in mixer and elsewhere!

EDIT [do you maybe mean substituting 8 for 2 in the -n, -i and -l parameters of the jackd config field? Can I maybe also enumerate the mixer parameters as: Digital 1 Left, PGA Gain 1 Left, Digital 1 Right, PGA Gain 1 Right … Digital 4 Left, PGA Gain 4 Left, Digital 4 Right, PGA Gain 4 Right?]

Remove the -i 2 -o 2 parameters. These are restricting inputs and outputs to two.

1 Like

Ah thanks @riban , will do :+1:

What about the mixer parameters?
See my EDIT note.

you have to change the overlay in audio config (you can use the default hifiberry-dac as basic setting (I mean for jackd, as it use the same pcm5102a DAC chip):

dtoverlay=hifiberry-dac8x

Thanks for the information @le51,

I will try to decode and use your reference method for the configuration of the Hifiberry DAC 8X.

All the best :slightly_smiling_face:

Hi @le51 and @riban :slight_smile:

I have made decisive progress with the multichannel audio outputs of my HifiBerry DAC 8X on Oram/Pi5.

I have cleaned the audio config, reloaded the proprietary overlay (driver) of DAC 8X and erased from the command the restriction to 2-channel output: now I can send the audio of each chain to whatever combination of four different stereo outputs, which finally makes possible my final goal of a Zynthian in octaphonic surround.

See the screenshot for how nicely Oram shows the cascade of available outputs in chain options.

I still have two issues to solve:

1] I am a bit puzzled at how the audio routing is implemented.

You can notice that for each stereo out there are both separate A and B channels and an A+B (mixed?) channel available. I seem to have found that activating A and B results in some kind of phasing/chorusing, with a narrower stereo image, while A+B alone seems to give a wider stereo field without phasing.
I might advance that maybe using separate A & B channels for each stereo out would serve a full multiphonic surround layout, possibly sending eight split mono signals to a mixer and then to eight mono speakers, while A+B is meant for a stereo amplification and loudspeakers setup.

Is that correct? The Oram Wiki is silent about this topic, and I reckon that it deserves some explanation. Moreover, why there is an audio feedback from the main mixbus, as an available audio input in an instrument chain?
It is activated by default, and of course it results in detectable audio phasing and volume gain. I struggle to devise the usage of this option, if not for audio chains with effect processors.

2] Also in the screenshots, you can see that audio levels are not exposed in the related Oram Main page, just a blank screen area where there should be graphical potentiometers for digital outputs (and inputs, but not in the case of my specific audio board).
The overlay for DAC 8X has set two Digital Output levels (0 and 1), but Oram does not show them in Main > audio levels.
Is there maybe something to change in webconf > hardware > audio > advanced view > mixer parameters, like enumerating the 0-7 digital outs? (see screenshot).
At HifiBerry they say that Zynthian should automatically set and expose everything, once the overlay is loaded, and that they do not know how to make it happen otherwise.

Thanks in advance for any help!

1 Like

Well done @Aethermind for getting the soundcard working. That is great news.

The audio routing allows you to decide whether the output of the chain (last processor in chain which may be mono or stereo) is fed to each physical audio output. For example, if your chain consists of a mono reverb and you select Output 1 then the reverbs single output is fed to Output 1. If you select Output 1 and select Output 2 then it is fed to both and similarly if you select Output 1+2 you get the same routing. If however your chain has a stereo processor, then selecting Output 1 will route both processor outputs to Output 1. Selecting Output 2 will route both processor outputs to Output 2. Selecting Output 1+2 will feed processor left output to Output 1 and processor right output to Output 2. This is a simple mechanism to allow mono or stereo routing of consecutive outputs. It isn’t as flexible as it could be but should suffice for most situations.

The phasing you describe sounds a bit like as issue I observed recently but have not had a chance to investigate. I wonder whether the left/right channels in the mixer are getting phase shifted slightly, maybe as little as one sample or possibly one processing cycle. This should not happen and I have previously successfully tested phase coherence so possibly this is a regression. It may be worth reporting it in the issue tracker so it doesn’t get forgotten.

You are right that the documentation does not yet cover audio routing. We will get to it one day…

I don’t recognise this scenario. There is a route to the main mixbus in output routing because most uses want their chains to go through the mixer and be summed to a stereo output. That main mixbus then has its own output routing which you can connect to any of your outputs, just like you can route chains directly to outputs.

Note that chains that are routed only to Main Mixbus use internal normalisation in the mixer whereas chains that are routed to direct outputs and Main Mixbus or that have post-fader effects use external loopback which adds one cycle latency to that feed and can create phasing.

If you click the ... button in webconf, below Mixer Controls you should be offered a list of the available input and output controls that you can select then remember to save the config on the webconf page.

2 Likes

Thank you @riban for your detailed feedback!

I attach a screenshot from the mixer controls in webconf: sadly, no parameters happen to be exposed (I had tried this before, to check if the audio card was somehow declaring its innards to the Z, but nope).

As for the audio routing: if I am understanding correctly your words, the normal real-world scenario of an everyday composition session, with plain stereo monitoring, would entail no direct outputs from the chains, but only mixbus activated on the chains and general output chosen as audio out of the main mixbus, in my case any of the four stereo couples.
Conversely, one should resort to individual direct outputs from the chains, with no mixbus output and only one channel at a time (no A+B), if the aim is to implement an 8-way surround, with either eight active speakers or also an external sub-mixer in between. Does it make sense to you?

BTW, I also realised in fact, by trial and error, that sending a chain’s audio to both main mixbus and direct outputs produces some kind of phasing, which by now you have coherently explained as generated by sample cycles delay.

Thanx again,

All the best :grinning:

1 Like

Yes your understanding of audio routing sounds right. This section of the wiki gives an overview of signal flow.

Shame about the controls. Maybe if you report it in the issue tracker we might track down why you don’t see the controls. It is not an area I have been involved with.

Hi @riban, of course, I will raise a ticket about the lack of exposed DAC 8X mixer parameters in webconf.

Enjoy your coming free days! :grinning: :wave:

Hi @zynthianers :slight_smile:

I would like to configure my HifiBerry DAC 8X in order to raise the buffer to 256 samples, since I am getting very occasional but consistent Xruns, in orchestral patches layered with Pianoteq 8.

The problem is that if I try to change the audio configuration line:

-P 70 -s -S -d alsa -d hw:sndrpihifiberry -r 48000 -p 128 -n 2 -X raw

as

-P 70 -s -S -d alsa -d hw:sndrpihifiberry -r 48000 -p 256 -n 2 -X raw

Zynthian reverts on reboot to the standard DAC+ profile, which I have used as a basis:

-P 70 -s -S -d alsa -d hw:sndrpihifiberry -r 48000 -p 128 -n 2 -i 2 -o 2 -X raw

that restricts the DAC 8X outputs to just 2, while my audio card features 8 (two of which are sent to a headphone amplifier).

HifiBerry seem to have a rather scant/basic technical support, very polite in customer handling but also quite prone to avoid specific questions that they should manage effortlessly (like how to configure one of their products in its native Raspberry environment).
They are based in Switzerland and their firm is called Modul 9, but honestly I wonder who is really designing and manufacturing their stuff, if they don’t have any electronic engineers to readily consult.

Any experience out there with DAC 8X configuration? Ideally, it would be nice if a dedicated aufio hardware profile was added to webconf (also, with the eight missing mixer level controls for the outputs, which the overlay driver does not seem to inform Zynthian about)

Best regards :slight_smile:

Custom Config should allow you to define the setting you are trying to achieve.

Select it in Kit from webconf.

Thanks @wyleu :+1:

Will try and let you know how it is going!

Try to explicitly configure the number of channels:

-P 70 -s -S -d alsa -d hw:sndrpihifiberry -r 48000 -p 128 -n 2 -o 8 -X raw

It should persist updates.

Regards

Ahhh! And please, when it’s fully working, send your full config so i can add it to the official configuration list.

Thanks!

Of course @jofemodo, thank you! :+1: :wink: