FE-PI Audio Z V2 line in not working

Hi,

I tried to configure FE-PI Audio Z V2 hat for the Jetson Nano. I was using:
sudo /opt/nvidia/jetson-io/jetson-io.py
Where I choose the ‘Configure Jetson for compatible hardware’ and then the ‘FE-PI Audio Z V2’ option and then save and reboot.

The audio output is working fine, but I had no luck for the line in. I could not find any relevant information about this on the forum or elsewhere as I see the most of the issues were raised about the audio output, but there is no mention of the line-in. Is the line in working for anybody? Or did I missed something with the setup?

Thanks,
Peter

Hello!

Currently only the Mic input is supported. We are working on adding support for the Line input as well. I believe that all we need to update is the following in this file

--- a/kernel-dts/overlays/jetson-fe-pi-audio.dts
+++ b/kernel-dts/overlays/jetson-fe-pi-audio.dts
@@ -52,7 +52,9 @@
                        nvidia,audio-routing =
                                "x Headphone",          "x HP_OUT",
                                "x MIC_IN",             "x Mic",
-                               "x ADC",                "x Mic Bias";
+                               "x ADC",                "x Mic Bias",
+                               "x LINE_IN",            "x Line In",
+                               "x Line Out",           "x LINE_OUT";
                };
        };

Hopefully, the next L4T release (due out shortly) will have this.

Regards,
Jon

Hi Jon!

Thanks for the tip, I will check this.

What do you mean by ‘only the Mic input is supported’? I tried to use the jack labeled as ‘HEADPHONE / MIC’ on the board with a regular earphone with mic but that didn’t worked either. If I understood you right then it should?

Thanks!

Hi Jon!

Can you give me an example how can we do the update ourselves? I just saw that the L4T R32.4.4 was released a few days ago (which not containing this fix) and the R32.4.3 was released back in July so we wont be able to wait for the next release.

Thanks!

Bests,
Peter

Hello Peter,

Can you try the following on Nano …

$ sudo cp /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo.bak
$ fdtdump /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo | grep nvidia,audio-routing
            nvidia,audio-routing = "x Headphone", "x HP_OUT", "x MIC_IN", "x Mic", "x ADC", "x Mic Bias";
$ sudo fdtput -t s /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo /fragment@2/__overlay__/ nvidia,audio-routing "x Headphone x" "HP_OUT x" "MIC_IN x" "Mic x" "ADC x" "Mic Bias x" "LINE_IN x" "Line In x" "Line Out x" "LINE_OUT"
$ fdtdump /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo | grep nvidia,audio-routing
            nvidia,audio-routing = "x Headphone x", "HP_OUT x", "MIC_IN x", "Mic x", "ADC x", "Mic Bias x", "LINE_IN x", "Line In x", "Line Out x", "LINE_OUT";
$ sudo /opt/nvidia/jetson-io/config-by-hardware.py -o dtb -n ‘FE-PI Audio Z V2’
$ sudo reboot

Regards,
Jon

Hi Jon,

Thank you for the detailed instructions!

As I see you are using a different version of the Nano dev board (I have the b00 and as I see for this board there are dtb files in the /boot directory, not dtbo files. Im not sure if this is an issue or not), so I modified you commands like this:
sudo cp /boot/tegra210-p3448-0000-p3449-0000-b00-fe-pi-audio-z-v2.dtb /boot/tegra210-p3448-0000-p3449-0000-b00-fe-pi-audio-z-v2.dtb.20201029

in the output of fdtdump, I can see it finds the string (there are 2 hits for string)
fdtdump /boot/tegra210-p3448-0000-p3449-0000-b00-fe-pi-audio-z-v2.dtb | grep nvidia,audio-routing
nvidia,audio-routing = “x Headphone”, “x HP_OUT”, “x MIC_IN”, “x Mic”, “x ADC”, “x Mic Bias”;
nvidia,audio-routing = “x Headphone Jack”, “x HPO L Playback”, “x Headphone Jack”, “x HPO R Playback”, “x IN1P”, “x Mic Jack”, “x Int Spk”, “x SPO Playback”, “x DMIC L1”, “x Int Mic”, “x DMIC L2”, “x Int Mic”, “x DMIC R1”, “x Int Mic”, “x DMIC R2”, “x Int Mic”, “y Headphone”, “y OUT”, “y IN”, “y Mic”, “a IN”, “a Mic”, “b IN”, “b Mic”;

But in the full fdtdump output it is visible that it is on a different “path” ( I will attach the output of my fdtdump), so I modified the command like this:

sudo fdtput -t s /boot/te[fdtdump_out.txt|attachment](upload://ePYEiRqSGymwtfGly45qkKWJmfR.txt) (507.0 KB) gra210-p3448-0000-p3449-0000-b00-fe-pi-audio-z-v2.dtb /fragment-e2614-common@0/overrides@9/_overlay_/ nvidia,audio-routing "x Headphone x" "HP_OUT x" "MIC_IN x" "Mic x" "ADC x" "Mic Bias x" "LINE_IN x" "Line In x" "Line Out x" "LINE_OUT"

But I get the following error:
Error at '/fragment-e2614-common@0/overrides@9/_overlay_/': FDT_ERR_NOTFOUND

Can you show an example how can I update dtb files?

Also I tried to create a custom overlay based on: Welcome — Jetson Linux<br/>Developer Guide 34.1 documentation documents “Configuring the 40-Pin Expansion Header - Creating a Simple Device Tree Overlay”

The contents of my overlay dts:

/dts-v1/;
/plugin/;
 
/ {
    overlay-name = "Fe-Pi v2 Line In";
    compatible = "nvidia,p3449-0000-b00+p3448-0000-b00";

    fragment@0 {
        target-path = <&tegra_sound>;
        __overlay__ {
		nvidia,audio-routing =
                                 "x Headphone",          "x HP_OUT",
                                 "x MIC_IN",             "x Mic",
                                 "x ADC",                "x Mic Bias",
                                 "x LINE_IN",            "x Line In",
                                 "x Line Out",           "x LINE_OUT";
        };
    };
};

Then I compiled it:
dtc -O dtb -o fe-pi2-linein.dtbo -@ fe-pi2-linein.dts

and moved it to the /boot directory. The config-by-hardware.py was able to list it

sudo /opt/nvidia/jetson-io/config-by-hardware.py -l

Configurations for the following hardware modules are available:

1. Adafruit SPH0645LM4H

2. FE-PI Audio Z V2

3. Fe-Pi v2 Line In

But when I try to apply it I get the following error:

sudo /opt/nvidia/jetson-io/config-by-hardware.py -n "Fe-Pi v2 Line In"
Traceback (most recent call last):
  File "/opt/nvidia/jetson-io/config-by-hardware.py", line 64, in <module>
    main()
  File "/opt/nvidia/jetson-io/config-by-hardware.py", line 60, in main
    configure_jetson(jetson, hwlist, args.name)
  File "/opt/nvidia/jetson-io/config-by-hardware.py", line 38, in configure_jetson
    fn = jetson.create_dtb_for_hw_addon(hw)
  File "/opt/nvidia/jetson-io/Jetson/board.py", line 228, in create_dtb_for_hw_addon
    dtc.overlay(self.dtb, dtb, dtbo)
  File "/opt/nvidia/jetson-io/Utils/dtc.py", line 53, in overlay
    raise RuntimeError("Failed to overlay %s with %s!" % (dtb, files))
RuntimeError: Failed to overlay /boot/dtb/tegra210-p3448-0000-p3449-0000-b00.dtb with /boot/fe-pi2-linein.dtbo!

Thanks!

Hello!

Yes I see you have a b00 and I have an a02. There is not too much different between the two versions and in fact if you look at the a02.dtbo files you will see that they have the compatible string for both a02 and b00. So if you edit the a02 overlay as instructed above and then apply it, it should update your b00 dtb. Can you try executing these commands and let me know if it works …

$ sudo cp /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo.bak
$ fdtdump /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo | grep nvidia,audio-routing
            nvidia,audio-routing = "x Headphone", "x HP_OUT", "x MIC_IN", "x Mic", "x ADC", "x Mic Bias";
$ sudo fdtput -t s /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo /fragment@2/__overlay__/ nvidia,audio-routing "x Headphone x" "HP_OUT x" "MIC_IN x" "Mic x" "ADC x" "Mic Bias x" "LINE_IN x" "Line In x" "Line Out x" "LINE_OUT"
$ fdtdump /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo | grep nvidia,audio-routing
            nvidia,audio-routing = "x Headphone x", "HP_OUT x", "MIC_IN x", "Mic x", "ADC x", "Mic Bias x", "LINE_IN x", "Line In x", "Line Out x", "LINE_OUT";
$ sudo /opt/nvidia/jetson-io/config-by-hardware.py -o dtb -n ‘FE-PI Audio Z V2’
$ sudo reboot

Cheers
Jon

Hello!

Yes this will not work, because this is not an overlay and the above node does not exist in the final dtb. However, you could also edit the dtb directly by doing something like …

$ sudo fdtput -t s /boot/tegra210-p3448-0000-p3449-0000-b00-fe-pi-audio-z-v2.dtb /sound nvidia,audio-routing "x Headphone x" "HP_OUT x" "MIC_IN x" "Mic x" "ADC x" "Mic Bias x" "LINE_IN x" "Line In x" "Line Out x" "LINE_OUT"

Cheers
Jon

Hello!

I believe that the problem with your overlay is that it is using ‘target-path’ and not ‘target’. You need to use ‘target’ when you are using a phandle and not an absolute path.

Also note that jetson-io just uses fdtoverlay to apply the overlay and so you can also try using this to apply the overlay directly …

$ fdtoverlay -i /boot/tegra210-p3448-0000-p3449-0000-b00.dtb -o /boot/tegra210-p3448-0000-p3449-0000-b00-fe-pi-linein.dtb fe-pi2-linein.dtbo

Although jetson-io also creates a new entry in /boot/extlinux/extlinux.conf and so you would need to manually update that too.

Cheers
Jon

Jon,

I am working with Peter on this.
When we try to apply the following as you instructed:

$ sudo cp /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo.bak
$ fdtdump /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo | grep nvidia,audio-routing
            nvidia,audio-routing = "x Headphone", "x HP_OUT", "x MIC_IN", "x Mic", "x ADC", "x Mic Bias";
$ sudo fdtput -t s /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo /fragment@2/__overlay__/ nvidia,audio-routing "x Headphone x" "HP_OUT x" "MIC_IN x" "Mic x" "ADC x" "Mic Bias x" "LINE_IN x" "Line In x" "Line Out x" "LINE_OUT"
$ fdtdump /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo | grep nvidia,audio-routing
            nvidia,audio-routing = "x Headphone x", "HP_OUT x", "MIC_IN x", "Mic x", "ADC x", "Mic Bias x", "LINE_IN x", "Line In x", "Line Out x", "LINE_OUT";
$ sudo /opt/nvidia/jetson-io/config-by-hardware.py -o dtb -n ‘FE-PI Audio Z V2’
$ sudo reboot

We are getting the following error:
falcon@falcon-nano:~$ sudo cp /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo.bak
[sudo] password for falcon:
falcon@falcon-nano:~$ fdtdump /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo | grep nvidia,audio-routing

**** fdtdump is a low-level debugging tool, not meant for general use.
**** If you want to decompile a dtb, you probably want
**** dtc -I dtb -O dts

        nvidia,audio-routing = "x Headphone", "x HP_OUT", "x MIC_IN", "x Mic", "x ADC", "x Mic Bias";

falcon@falcon-nano:~$ sudo fdtput -t s /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo /fragment@2/overlay/ nvidia,audio-routing “x Headphone x” “HP_OUT x” “MIC_IN x” “Mic x” “ADC x” “Mic Bias x” “LINE_IN x” “Line In x” “Line Out x” “LINE_OUT”
falcon@falcon-nano:~$ fdtdump /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo | grep nvidia,audio-routing

**** fdtdump is a low-level debugging tool, not meant for general use.
**** If you want to decompile a dtb, you probably want
**** dtc -I dtb -O dts

        nvidia,audio-routing = "x Headphone x", "HP_OUT x", "MIC_IN x", "Mic x", "ADC x", "Mic Bias x", "LINE_IN x", "Line In x", "Line Out x", "LINE_OUT";

falcon@falcon-nano:~$ sudo /opt/nvidia/jetson-io/config-by-hardware.py -o dtb -n ‘FE-PI Audio Z V2’
usage: Configure Jetson for a hardware module [-h] (-n NAME | -l)
Configure Jetson for a hardware module: error: unrecognized arguments: -o dtb Audio Z V2’
falcon@falcon-nano:~$

Please advise.

Thank you,
Laszlo

Hi Jon,

the “extlinux.conf” file points to :
LABEL FE-PI Audio Z V2
MENU LABEL FE-PI Audio Z V2
LINUX /boot/Image
FDT /boot/tegra210-p3448-0000-p3449-0000-b00-fe-pi-audio-z-v2.dtb
INITRD /boot/initrd
APPEND ${cbootargs} quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0

There is no “.dtbo” for the “b00” board and when I check the “nvidia,audio-routing” – “fdtdump /boot/tegra210-p3448-0000-p3449-0000-b00-fe-pi-audio-z-v2.dtb | grep nvidia,audio-routing” it lists the following:
" nvidia,audio-routing = “x Headphone”, “x HP_OUT”, “x MIC_IN”, “x Mic”, “x ADC”, “x Mic Bias”;
nvidia,audio-routing = “x Headphone Jack”, “x HPO L Playback”, “x Headphone Jack”, “x HPO R Playback”, “x IN1P”, “x Mic Jack”, “x Int Spk”, “x SPO Playback”, “x DMIC L1”, “x Int Mic”, “x DMIC L2”, “x Int Mic”, “x DMIC R1”, “x Int Mic”, “x DMIC R2”, “x Int Mic”, “y Headphone”, “y OUT”, “y IN”, “y Mic”, “a IN”, “a Mic”, “b IN”, “b Mic”;"

It seems updating the “tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo” doesn’t take any effect on the “tegra210-p3448-0000-p3449-0000-b00-fe-pi-audio-z-v2.dtb”.

Your earliest reply and fix will be greatly appreciated.
Thank you,
Laszlo

Hello!

Sorry, I think that is a typo that I have made. Please try …

$ sudo /opt/nvidia/jetson-io/config-by-hardware.py -n 'FE-PI Audio Z V2'

Regards,
Jon

Hello!

Yes that is expected because the a02 and b00 are compatible with regard to the 40-pin header and so both use the a02 version of the overlay.

Regards,
Jon

Jon,
With th ecorrected command it did updated the 'b00 . dtb file".
After “sudo reboot” the audio out stopped working entierly and actually nothing audio related is operational. Top on that when I start the same video from “youtube”, the video playback also messed up. (playing in perodical fast ffwd mode, so 15 sec add will take about 3 sec to finish, same as any video clip)

-fdtdump of tegra210-p3448-0000-p3449-0000-b00-fe-pi-audio-z-v2.dtb shows two “nvidia,audio-routing” entry:

falcon@falcon:~$ fdtdump /boot/tegra210-p3448-0000-p3449-0000-b00-fe-pi-audio-z-v2.dtb | grep nvidia,audio-routing

**** fdtdump is a low-level debugging tool, not meant for general use.
**** If you want to decompile a dtb, you probably want
**** dtc -I dtb -O dts

    nvidia,audio-routing = "x Headphone x", "HP_OUT x", "MIC_IN x", "Mic x", "ADC x", "Mic Bias x", "LINE_IN x", "Line In x", "Line Out x", "LINE_OUT";
                nvidia,audio-routing = "x Headphone Jack", "x HPO L Playback", "x Headphone Jack", "x HPO R Playback", "x IN1P", "x Mic Jack", "x Int Spk", "x SPO Playback", "x DMIC L1", "x Int Mic", "x DMIC L2", "x Int Mic", "x DMIC R1", "x Int Mic", "x DMIC R2", "x Int Mic", "y Headphone", "y OUT", "y IN", "y Mic", "a IN", "a Mic", "b IN", "b Mic";

Thank you,
Laszlo

Hello!

That is odd that there are two ‘nvidia,audio-routing’ nodes. Can you attach the complete fdtdump of both the overlay and the tegra210-p3448-0000-p3449-0000-b00-fe-pi-audio-z-v2.dtb file? That will give us a better idea of what is going on.

Thanks
Jon

Hello,

I hope this is what where you asked for. If not let me know what else would you need.

-$ fdtdump /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo | grep nvidia,audio-routing

**** fdtdump is a low-level debugging tool, not meant for general use.
**** If you want to decompile a dtb, you probably want
**** dtc -I dtb -O dts

        nvidia,audio-routing = "x Headphone", "x HP_OUT", "x MIC_IN", "x Mic", "x ADC", "x Mic Bias";

-$ sudo fdtput -t s /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo /fragment@2/overlay/ nvidia,audio-routing “x Headphone x” “HP_OUT x” “MIC_IN x” “Mic x” “ADC x” “Mic Bias x” “LINE_IN x” “Line In x” “Line Out x” “LINE_OUT”

-$ fdtdump /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo | grep nvidia,audio-routing

**** fdtdump is a low-level debugging tool, not meant for general use.
**** If you want to decompile a dtb, you probably want
**** dtc -I dtb -O dts

        nvidia,audio-routing = "x Headphone x", "HP_OUT x", "MIC_IN x", "Mic x", "ADC x", "Mic Bias x", "LINE_IN x", "Line In x", "Line Out x", "LINE_OUT";

-$ fdtdump of tegra210-p3448-0000-p3449-0000-b00-fe-pi-audio-z-v2.dtb shows two “nvidia,audio-routing” entry:

falcon@falcon:~$ fdtdump /boot/tegra210-p3448-0000-p3449-0000-b00-fe-pi-audio-z-v2.dtb | grep nvidia,audio-routing

**** fdtdump is a low-level debugging tool, not meant for general use.
**** If you want to decompile a dtb, you probably want
**** dtc -I dtb -O dts

    nvidia,audio-routing = "x Headphone x", "HP_OUT x", "MIC_IN x", "Mic x", "ADC x", "Mic Bias x", "LINE_IN x", "Line In x", "Line Out x", "LINE_OUT";
                nvidia,audio-routing = "x Headphone Jack", "x HPO L Playback", "x Headphone Jack", "x HPO R Playback", "x IN1P", "x Mic Jack", "x Int Spk", "x SPO Playback", "x DMIC L1", "x Int Mic", "x DMIC L2", "x Int Mic", "x DMIC R1", "x Int Mic", "x DMIC R2", "x Int Mic", "y Headphone", "y OUT", "y IN", "y Mic", "a IN", "a Mic", "b IN", "b Mic";

Thnak you,
Laszlo

Hello!

Not exactly. I would like to see the entire output from fdtdump and not just the nvidia,audio-routing node. In other words, attach the output from …

$ fdtdump /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo
$ fdtdump /boot/dtb/tegra210-p3448-0000-p3449-0000-b00.dtb
$ fdtdump /boot/tegra210-p3448-0000-p3449-0000-b00-fe-pi-audio-z-v2.dtb

Thanks
Jon

Hello,
Please find the file with data collected here:

Hello!

I see a problem with my previous instructions. Can you try …

$ sudo fdtput -t s /boot/tegra210-p3448-0000-p3449-0000-a02-fe-pi-audio-z-v2.dtbo /fragment@2/__overlay__/ nvidia,audio-routing "x Headphone" "x HP_OUT" "x MIC_IN" "x Mic" "x ADC" "x Mic Bias" "x LINE_IN" "x Mic" "x Headphone" "x LINE_OUT"
$ sudo /opt/nvidia/jetson-io/config-by-hardware.py -n ‘FE-PI Audio Z V2’
$ sudo reboot

I have verified that this is working with L4T r32.4.4 on my Nano. Please note that the volume on the line out is a bit quieter than on the headphones, but you can adjust the volume using the following mixer control …

$ amixer -c tegrasndt210ref sset "x Lineout" <val>

Where ‘val’ is between 0 and 31.

Regards,
Jon

Hello,

Thank you for this new set of commands and this did made the headphone out and Line out work.
I am still missing the Line In to work; tried to connect an audio source to the Line In but I am not getting any audio on either Headphone nor Line Out. Under sound settings “Input” tab there is no activity when Line In is connected to the audio source. We are almost there :)
Thank you,
Laszlo