NixOS / nixos-hardware

A collection of NixOS modules covering hardware quirks.
Creative Commons Zero v1.0 Universal
2.08k stars 646 forks source link

`raspberry-pi."4".audio.enable = true;` broken: DTOVERLAY[error]: can't find symbol 'audio' #703

Open Ramblurr opened 1 year ago

Ramblurr commented 1 year ago

With these options

hardware.raspberry-pi."4".apply-overlays-dtmerge.enable = true;
hardware.raspberry-pi."4".audio.enable = true;
hardware.deviceTree.filter = "bcm2711-rpi-4-*.dtb";
boot.kernelPackages = pkgs.linuxPackages_rpi4;

It fails with:


building Nix...
building the system configuration...
these 3 derivations will be built:
  /nix/store/nziz4xlb0jdf11zxrpxghcr092bp09yw-dtbs-filtered.drv
  /nix/store/ilrh3myjvzdrj1161yy42y0q00fmwryk-device-tree-overlays.drv
  /nix/store/fqy0aj92zra5s20kydph2kg0754p97q6-nixos-system-ovos-23.05.3023.74e5bdc5478e.drv
building '/nix/store/nziz4xlb0jdf11zxrpxghcr092bp09yw-dtbs-filtered.drv'...
./broadcom -> /nix/store/qwjd22886siziv4cfg9yqhpk58arajgh-dtbs-filtered/./broadcom
'./broadcom/bcm2711-rpi-4-b.dtb' -> '/nix/store/qwjd22886siziv4cfg9yqhpk58arajgh-dtbs-filtered/./broadcom/bcm2711-rpi-4-b.dtb'
building '/nix/store/ilrh3myjvzdrj1161yy42y0q00fmwryk-device-tree-overlays.drv'...
./broadcom -> /nix/store/qp09vsgjqmymb3rs8my6n17268j17phv-device-tree-overlays/./broadcom
'./broadcom/bcm2711-rpi-4-b.dtb' -> '/nix/store/qp09vsgjqmymb3rs8my6n17268j17phv-device-tree-overlays/./broadcom/bcm2711-rpi-4-b.dtb'
Applying overlay hifiberry-dacplusadc to bcm2711-rpi-4-b.dtb... ok
Applying overlay rpi4-cpu-revision to bcm2711-rpi-4-b.dtb... ok
Applying overlay audio-on-overlay to bcm2711-rpi-4-b.dtb... DTOVERLAY[error]: can't find symbol 'audio'
error: builder for '/nix/store/ilrh3myjvzdrj1161yy42y0q00fmwryk-device-tree-overlays.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/fqy0aj92zra5s20kydph2kg0754p97q6-nixos-system-ovos-23.05.3023.74e5bdc5478e.drv' failed to build

Version info:

$ sudo nix-channel --list
nixos https://nixos.org/channels/nixos-23.05
nixos-hardware https://github.com/NixOS/nixos-hardware/archive/master.tar.gz
jmoggr commented 1 year ago

I am experiencing the same issue.

ri0t commented 1 year ago

Yep, here too. I also don't get any SPI or ~i2c~ devices :crying_cat_face:

Edit: i2c-1 now appears. Still no SPI or audio.

illegalprime commented 1 year ago

same issue. this is because a kernel update broke it. downgrading to a 5.x kernel worked for me:

  # these are pinned so pi kernel is 5.x, which keeps the audio overlay working
  inputs.nixpkgs.url = github:NixOS/nixpkgs/release-22.11;
  inputs.nixos-hardware.url = github:NixOS/nixos-hardware/a6aa8174fa61e55bd7e62d35464d3092aefe0421;
Mic92 commented 11 months ago

Does upstream have an updated version of audio-on-overlay?

vs49688 commented 11 months ago

Knowing virtually nothing about device trees, it looks like the symbol's been removed: https://github.com/raspberrypi/linux/blob/342c7ee49e862edc30c893f141f55b9211b7a43b/arch/arm/boot/dts/bcm2711-rpi-cm4s.dts#L290

audio = <&chosen>,"bootargs{on='snd_bcm2835.enable_hdmi=1',off='snd_bcm2835.enable_hdmi=0'}";

But if I'm reading this right, then boot.kernelParams = [ "snd_bcm2835.enable_hdmi=1" ]; should be all we need.

ManOfDiamond commented 10 months ago

Knowing virtually nothing about device trees, it looks like the symbol's been removed: https://github.com/raspberrypi/linux/blob/342c7ee49e862edc30c893f141f55b9211b7a43b/arch/arm/boot/dts/bcm2711-rpi-cm4s.dts#L290

audio = <&chosen>,"bootargs{on='snd_bcm2835.enable_hdmi=1',off='snd_bcm2835.enable_hdmi=0'}";

But if I'm reading this right, then boot.kernelParams = [ "snd_bcm2835.enable_hdmi=1" ]; should be all we need.

I can confirm that this works

mzabani commented 9 months ago

This worked for me as well, with the caveat that you can't keep hardware.raspberry-pi."4".audio.enable = true; in the configuration (perhaps this is obvious to most, but wasn't to me).

madorian commented 6 months ago

I've added that kernelParams, but I still get no audio from Kodi. Is that all you did?

[root@pi:~]# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default
    Default Audio Device (via PulseAudio)
sysdefault:CARD=Headphones
    bcm2835 Headphones, bcm2835 Headphones
    Default Audio Device
nixos-discourse commented 5 months ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/why-do-i-get-conflicting-definiton-values-for-hardware-devicetree-filter-for-pi4/45214/5