Turning on aud_mclk from software driver

Per this topic NoDebugFS I cannot force the aud_mclk on using sysfs.

I can turn it on with a dummy gstreamer pipeline

gst-launch-1.0 -e alsasrc device=hw:1,2 ! fakesink

That is less reliable than forcing on the clock via the sysfs.

I was thinking of creating a modified version of the alsa+gst driver that sets the clock on and leaves it; but finding the relevant code has proved to be difficult.

Can anybody provide a pointer to the relevant code?


We don’t have much experience about the usecase. Could you please go to gstreamer forum. Users in the forum may have more experience in constructing audio pipelines in gsreamer.

This is question of how the gstreamer alsa code integrates with TX2 Audio subsystem to turn on the audio clock.
The goal was to extract that low level logic from the driver and use it in a self contained mechanism. The goal was to eliminate the gstreamer pipeline , since it is only used for the side effect of enabling the audio clock.
I had assumed that logic was Jetson specific, hence the question on this forum.

The topic is specific to accessing clk/aud_mclk/state on PKC+SBK fused TX2i. Is this a duplicate or asking about non-fused TX2i?

It is a duplicate in terms of required functionality: Force on aud_mclk.

I would prefer that Nvidia provide a means to access the debug sysfs for a fused TX2i since that would be the same mechanism for both fused and unfused. It is also much simpler, requiring only an echo 1 to the file.
The other ticket covers that lack of sysfs problem (which also impacts control over the encode/decode clocks)

Next option is a custom piece of code using the relevant logic from the alsa driver to turn on the clock. This ticket covers that idea.

The last option is a dummy gstreamer pipeline referencing an unused I2S port and fakesink. This is my current solution. This consumes more power and is less robust than using the sysfs solution.