# For more options and information see:
# https://www.raspberrypi.com/documentation/computers/config_txt.html

# Some settings may impact device functionality. See link above for details

# Additional overlays and parameters are documented here:
# /boot/overlays/README

initramfs initramfs-linux.img followkernel


# automatically load overlays for detected DSI displays
display_auto_detect=1

# don't have the firmware create an initial video= setting in cmdline.txt.
# Use the kernel's default instead.
disable_fw_kms_setup=1

# disable compensation for displays with overscan
disable_overscan=1

# pretends HDMI hotplug signal is asserted so it appears a HDMI display is attached
hdmi_force_hotplug=1


# uncomment if you want to disable wifi or bluetooth respectively
#dtoverlay=disable-wifi
#dtoverlay=disable-bt


# removes the warning overlay
#avoid_warnings=1


# configures the base Raspberry Pi hardware
dtparam=audio=on        # enable the onboard ALSA audio interface (HDMI and/or Jack)
dtparam=i2s=on          # enable the i2s interface on GPIO pins
dtparam=i2c_arm=on      # enable the ARM's i2c interface

# enables mmap support in the bcm2708-i2s driver
#dtoverlay=i2s-mmap



# ---------------------------------------------------------------------------------------------------------------------
# AUDIO CARD
# activate (uncomment) only one audio card at a time
# ---------------------------------------------------------------------------------------------------------------------

# -- name: hifiberry-dacplusadc
# -- info: Configures the HifiBerry DAC+ADC audio card
# -- url: https://www.hifiberry.com/shop/boards/hifiberry-dac-adc/
# -- require: dtparam=i2s=on
#dtoverlay=hifiberry-dacplusadc

# -- name: hifiberry-dacplusadcpro
# -- info: Configures the HifiBerry DAC+ADC PRO audio card
# -- url: https://www.hifiberry.com/shop/boards/hifiberry-dac-adc-pro/
# -- require: dtparam=i2s=on
#dtoverlay=hifiberry-dacplusadcpro

# -- name: iqaudio-codec / rpi-codeczero
# -- info: Configures the IQaudIO Pi-Codec+ or the Pi-CodecZero audio card
# -- url: http://www.iqaudio.com/
#
# activate this overlay for the Pi-CodecZero audio card with models
#  - Raspberry Pi 2 and Raspberry Pi 3 (ARMv7)
#  - Raspberry Pi 4 and Raspberry Pi Zero 2 (AARCH64)
# for ARMv6 models, e.g. Raspberry Pi zero, force the use of the old overlay "iqaudio-codec" below which supports the
# same DA7212 chip. For the same reason, on ARMv7/AARCH64 processors, the older IQaudIO card is also recognised with 
# this "rpi-codeczero" overlay, 100% functional, but will not be named correctly.
dtoverlay=rpi-codeczero
#
# activate this overlay with the original IQaudIO Pi-Codec hat for all Raspberry Pi models
# or for the new Pi-CodecZero card on ARMv6 models
#dtoverlay=iqaudio-codec

# -- name: pisound
# -- info: Configures the Blokas Labs pisound card
# -- url: https://blokas.io/pisound/
#dtoverlay=pisound

# -- name: audioinjector-ultra
# -- info: Configures the Audio Injector Ultra 2 audio card
# -- url: http://www.audioinjector.net/rpi-ultra
# -- disable: dtparam=*
#dtoverlay=audioinjector-ultra

# -- name: audioinjector-wm8731-audio
# -- info: Configures the Audio Injector Stereo audio card
# -- url: http://www.audioinjector.net/rpi-hat
# -- disable: dtparam=*
#dtoverlay=audioinjector-wm8731-audio

# -- name: audioinjector-addons
# -- info: Configures the Audio Injector Octo audio card
# -- url: http://www.audioinjector.net/rpi-octo-hat
# -- disable: dtparam=*
#dtoverlay=audioinjector-addons

# -- name: cirrus-wm5102
# -- info: Configures the Cirrus Logic/Wolfson audio card
# -- require: i2s-mmap, dtparam=i2s=on
# -- disable: dtparam=i2c_arm=on
#
# activate this overlay with models
#  - Raspberry Pi 2 and Raspberry Pi 3 (ARMv7)
#  - Raspberry Pi 4 and Raspberry Pi Zero 2 (AARCH64)
#dtoverlay=cirrus-wm5102
# or this overlay on ARMv6 models
#dtoverlay=rpi-cirrus-wm5102

# -- name: seeed-2mic-voicecard
# -- info: Configures the The ReSpeaker 2 Mic Array audio card
# -- url: https://respeaker.io/2_mic_array/
# -- require: dtparam=i2s=on, dtparam=i2c_arm=on
#dtoverlay=seeed-2mic-voicecard

# -- name: seeed-4mic-voicecard
# -- info: Configures the The ReSpeaker 4 Mic Array audio card
# -- url: https://respeaker.io/4_mic_array/
# -- require: dtparam=i2s=on, dtparam=i2c_arm=on
#dtoverlay=seeed-4mic-voicecard

# -- name: seeed-8mic-voicecard
# -- info: Configures the The ReSpeaker 6 Mic Array audio card
# -- url: https://respeaker.io/6_mic_array/
# -- require: dtparam=i2s=on, dtparam=i2c_arm=on
#dtoverlay=seeed-8mic-voicecard



# DEVICE NOT RECOGNISED ?
# ----------------------
# this could be caused by typos above or blacklisted drivers.
# Uncoment line below, SSH to your Raspberry PI and have a look at the output of both command:
#
#	dmesg
# 	sudo /opt/vc/bin/vcdbg log msg
#
#dtdebug=on


# ---------------------------------------------------------------------------------------------------------------------
# SPECIFIC CONFIGURATIONS
# ---------------------------------------------------------------------------------------------------------------------

# enable the USB virtual network gadget (Pi-zero)
# ('modules-load=dwc2,g_ether' must be inserted at the end, at least after the 'rootwait' in the cmdline.txt file)
# dtoverlay=dwc2

[pi4]
# run as fast as firmware / board allows
arm_boost=1

[cm4]
# enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1

[cm5]
# selects the DWC2 USB controller driver
# with dual role mode set to "host"
dtoverlay=dwc2,dr_mode=host

[all]
