User avatar
Recalbox
Posts: 30
Joined: Mon May 03, 2021 9:41 am

Kernel 6.1 and dts: brcm,disable-headphones removed

Sat Sep 16, 2023 11:35 am

Hello. I used to enable headphones on rpi4 with an overlay containing brcm,disable-headphones brcm,disable-headphones = <0>; targeting &audio.

Since kernel 6.1, the correct data tree source for this usage is:
fragment@7 {
target = <&chosen>;
__overlay__ {
bootargs = "snd_bcm2835.enable_headphones=1";
};
};
It is ok and works as intended. But, we have a dtbo embedded in an eeprom for our HAT that we cannot update easily.
Is it possible in any way to ignore the fragment, or create a virtual audio node to make the eeprom dtbo load the system.

The dirty solution would be to disable the hat eeprom check in config.txt, and make the detection at boot, but there may be a better alternative ?

Thank you very much.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5607
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Kernel 6.1 and dts: brcm,disable-headphones removed

Mon Sep 18, 2023 10:18 am

It's a pity you didn't just put the name of the overlay in the EEPROM, but you are where you are.

Yours isn't the only HAT with this problem, and I'm thinking we could add a table of exceptions that lists known stale HAT UUIDs (or perhaps hashes of the overlays) and the names of overlays to load instead.

Does this sound like it could work for you? Does your HAT have a unique UUID as recommended? Would you want the replacement overlay built into the standard image or are you happy adding it to your images?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5607
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Kernel 6.1 and dts: brcm,disable-headphones removed

Thu Sep 21, 2023 3:45 pm

I think I've got this mechanism working in test builds. If you give me the UUID of your HAT and the name of an overlay to load instead I can get you a trial firmware build and new "hat_map.dtb" to make it all work.

User avatar
Recalbox
Posts: 30
Joined: Mon May 03, 2021 9:41 am

Re: Kernel 6.1 and dts: brcm,disable-headphones removed

Thu Sep 21, 2023 10:08 pm

Thank you very much for your answer.
It's a pity you didn't just put the name of the overlay in the EEPROM, but you are where you are.
Looks like it was a close call https://github.com/raspberrypi/hats/com ... 32ef35c28c

The board UUID is 1c955808-681f-4bbc-a2ef-b7ea47cd388e
The overlay is recalboxrgbdual.dtbo

Thank you.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5607
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Kernel 6.1 and dts: brcm,disable-headphones removed

Fri Sep 22, 2023 8:04 am

The latest rpi-update release includes firmware that understands the HAT map. The map itself will appear in future kernel releases, but for now you can download a version from here: https://drive.google.com/file/d/1VGNyPK ... sp=sharing

The file is called "hat_map.dtb", and should be placed in the overlays directory (were "overlay_map.dtb" already lives). With the updated firmware and this map file present, booting with your HAT attached should cause "recalboxrgbdual.dtbo" to be loaded instead (or nothing, if that overlay doesn't exist).

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5607
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Kernel 6.1 and dts: brcm,disable-headphones removed

Fri Sep 22, 2023 10:06 am

Note that if you have access to rpi-update in Recalbox then you can now run "sudo rpi-update pulls/5610" to install the latest kernel including the mapping for your HAT.

User avatar
Recalbox
Posts: 30
Joined: Mon May 03, 2021 9:41 am

Re: Kernel 6.1 and dts: brcm,disable-headphones removed

Fri Sep 22, 2023 10:25 am

I'm bumping the rpi-firmware in recalbox for the next beta, i'll check if it works soon and report here.

Thank you very much for the support !

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5607
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Kernel 6.1 and dts: brcm,disable-headphones removed

Fri Sep 22, 2023 10:38 am

So there's no misunderstanding, the firmware in our rpi-firmware repo (which is installed by "sudo rpi-update") does include support for the HAT map but does not include the HAT map itself - you'll need to add it from the Google drive link above.

User avatar
Recalbox
Posts: 30
Joined: Mon May 03, 2021 9:41 am

Re: Kernel 6.1 and dts: brcm,disable-headphones removed

Fri Sep 22, 2023 11:11 am

Yes i'm bumping to https://github.com/raspberrypi/firmware ... 5173fd04f1 and adding the dtb in /boot/overlay

Thank you :)

User avatar
Recalbox
Posts: 30
Joined: Mon May 03, 2021 9:41 am

Re: Kernel 6.1 and dts: brcm,disable-headphones removed

Fri Sep 22, 2023 10:54 pm

Works like a charm on pi4 + last firmware.

Thank you very much for your help.

User avatar
Recalbox
Posts: 30
Joined: Mon May 03, 2021 9:41 am

Re: Kernel 6.1 and dts: brcm,disable-headphones removed

Sat Nov 18, 2023 11:23 am

@PhilE hello :)

The hat map seems to be working great on PI4, but I can't get it to work on PI5.

I tried with recalboxrgbdual.dtbo and recalboxrgbdual-pi5.dtbo cointaining exactly the same overlays, and I can't have it loaded automatically.
The command

Code: Select all

dtoverlay recalboxrgbdual
loads the dtbo correctly at runtime.

On boot, I can't see any message relative to the overlay or hatmap in var/log/messages

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5607
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Kernel 6.1 and dts: brcm,disable-headphones removed

Wed Nov 22, 2023 9:26 pm

Does "dtoverlay=recalboxrgbdual" in config.txt work?

The hat_map support was merged on September 20th. Pi 5 EEPROMs older than that won't include it. What does "vcgencmd bootloader_version" report?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5607
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Kernel 6.1 and dts: brcm,disable-headphones removed

Wed Nov 22, 2023 10:08 pm

It may save time if you can point me at the source for your recalboxrgbdual overlay.

User avatar
Recalbox
Posts: 30
Joined: Mon May 03, 2021 9:41 am

Re: Kernel 6.1 and dts: brcm,disable-headphones removed

Thu Nov 23, 2023 7:04 pm

Hello PhilE

Of course, here it is:
https://gitlab.com/recalbox/recalbox/-/ ... verlay.dts

I'll take any remarks about it :)

Tried on RPI5 with latest eeprom yesterday, and the dtbo loads and runs well:
- at runtimewith dtoverlay (last fixes on rpi-utils are great :) )
- with a dtoverlay=recalboxrgbdual-pi5 and with dtoverlay=recalboxrgbdual in config.txt (as recalboxrgbdual.dtbo and recalboxrgbdual-pi5.dtbo are the same)

Both only when I avoid reading eeprom for hat with force_eeprom_read=0 in config.txt

Without force_eeprom_read=0, I can't load any dtbo either with config.txt nor with dtoverlay (i2c1 does not load either).

I'm on EEPROM pieeprom-2023-11-20.bin
rpi-firmware on commit 7f14c6192dd536392efbad2280e990285447591a

Code: Select all

# vcgencmd bootloader_version
2023/11/20 19:40:17
version 361205c60f6077e57aa9b01e9d7d93d79c921dad (release)
timestamp 1700509217
update-time 1700611581
capabilities 0x0000007f
Thank you again for your time.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5607
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Kernel 6.1 and dts: brcm,disable-headphones removed

Fri Nov 24, 2023 12:54 pm

Interesting. Could you read out the EEPROM and upload it somewhere? The script eepflash (https://github.com/raspberrypi/hats/blo ... epflash.sh) should do the job:

Code: Select all

$ sudo ./eepflash.sh -r -f=rrd.eep -t=24c32 

User avatar
Recalbox
Posts: 30
Joined: Mon May 03, 2021 9:41 am

Re: Kernel 6.1 and dts: brcm,disable-headphones removed

Fri Nov 24, 2023 5:35 pm

:shock: I'm so sorry, I just tried again from a vanilla installation and it works. I don't know what mistake I did before to make it fail.

Please accept my apologize for the spoiled time on your side. And thank you again.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5607
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Kernel 6.1 and dts: brcm,disable-headphones removed

Fri Nov 24, 2023 5:39 pm

Possibly a "dtoverlay=" at the start of config.txt? Anyway, I'm happy it's working now. And it's looking like the hat_map is going to be useful for some soundcards that are out there.

User avatar
Recalbox
Posts: 30
Joined: Mon May 03, 2021 9:41 am

Re: Kernel 6.1 and dts: brcm,disable-headphones removed

Fri Nov 24, 2023 10:58 pm

PhilE wrote:Possibly a "dtoverlay=" at the start of config.txt?
I'm not sure :oops:
PhilE wrote:And it's looking like the hat_map is going to be useful for some soundcards that are out there.
Yes :)

Return to “Advanced users”