Skip to content

Commit

Permalink
fix: re-set-up multimedia (#228)
Browse files Browse the repository at this point in the history
* fix: specify only custom config file

When we specify both an upstream defconfig and a local custom
full-config, buildroot gets very confused and seems to use neither of
them, which I think we can all agree isn't right. This is why none of
our modules seemed to be there.

* fix: audio modules, alsa config for sound output

Before the update, I think we had a pretty simple audio setup and after
the update we were missing the driver modules for audio on our soc.
Bringing the driver modules back is pretty easy, but we now also need a
bunch of extra alsa configuration to make sure that the volume is at
100% because at 50% it's completely inaudible.

We can use amixer (NOT alsamixer, that's a TUI interactive mixer) to set
the volume high, and alsactl to store it, but we also need to make sure
we have somewhere for alsactl's state file, and then bam we've got
persistent volume across reboots.

* fix: reenable video capture

Another set of kernel modules that got lost were the ones for the
drivers that let us capture video from the camera. This re-adds them.
  • Loading branch information
sfoster1 authored Apr 1, 2024
1 parent 2060b71 commit e29e5b4
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 9 deletions.
98 changes: 93 additions & 5 deletions board/opentrons/ot2/kernel.config
Original file line number Diff line number Diff line change
Expand Up @@ -3095,7 +3095,7 @@ CONFIG_MEDIA_SUPPORT=m
#
# Multimedia core support
#
# CONFIG_MEDIA_CAMERA_SUPPORT is not set
CONFIG_MEDIA_CAMERA_SUPPORT=y
# CONFIG_MEDIA_ANALOG_TV_SUPPORT is not set
# CONFIG_MEDIA_DIGITAL_TV_SUPPORT is not set
# CONFIG_MEDIA_RADIO_SUPPORT is not set
Expand All @@ -3108,7 +3108,7 @@ CONFIG_MEDIA_SUPPORT=m
#
# Media drivers
#
# CONFIG_MEDIA_USB_SUPPORT is not set
CONFIG_MEDIA_USB_SUPPORT=y

#
# Supported MMC/SDIO adapters
Expand Down Expand Up @@ -3295,8 +3295,59 @@ CONFIG_LOGO=y
# CONFIG_LOGO_LINUX_MONO is not set
# CONFIG_LOGO_LINUX_VGA16 is not set
CONFIG_LOGO_LINUX_CLUT224=y
# CONFIG_SOUND is not set

CONFIG_SOUND=y
CONFIG_SND=m
CONFIG_SND_HRTIMER=m
CONFIG_SND_SEQUENCER=m
CONFIG_SND_SEQ_DUMMY=m
CONFIG_SND_DUMMY=m
CONFIG_SND_ALOOP=m
CONFIG_SND_VIRMIDI=m
CONFIG_SND_MTPAV=m
CONFIG_SND_SERIAL_U16550=m
CONFIG_SND_MPU401=m
CONFIG_SND_USB_AUDIO=m
CONFIG_SND_USB_UA101=m
CONFIG_SND_USB_CAIAQ=m
CONFIG_SND_USB_CAIAQ_INPUT=y
CONFIG_SND_USB_6FIRE=m
CONFIG_SND_USB_HIFACE=m
CONFIG_SND_SOC=m
CONFIG_SND_BCM2835=m
CONFIG_SND_BCM2835_SOC_I2S=m
CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD=m
CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC=m
CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS=m
CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m
CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m
CONFIG_SND_BCM2708_SOC_RPI_CIRRUS=m
CONFIG_SND_BCM2708_SOC_RPI_DAC=m
CONFIG_SND_BCM2708_SOC_RPI_PROTO=m
CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m
CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m
CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m
CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m
CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m
CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m
CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m
CONFIG_SND_DIGIDAC1_SOUNDCARD=m
CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m
CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m
CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m
CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m
CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m
CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE=m
CONFIG_SND_BCM2708_SOC_ALLO_KATANA_DAC=m
CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m
CONFIG_SND_PISOUND=m
CONFIG_SND_SOC_ADAU1701=m
CONFIG_SND_SOC_ADAU7002=m
CONFIG_SND_SOC_AK4554=m
CONFIG_SND_SOC_CS4265=m
CONFIG_SND_SOC_CS4271_I2C=m
CONFIG_SND_SOC_SPDIF=m
CONFIG_SND_SOC_WM8804_I2C=m
CONFIG_SND_SIMPLE_CARD=m
#
# HID support
#
Expand Down Expand Up @@ -4149,7 +4200,44 @@ CONFIG_FB_TFT_FBTFT_DEVICE=m
CONFIG_BCM_VIDEOCORE=y
CONFIG_BCM2835_VCHIQ=y
CONFIG_BCM2835_VCHIQ_SUPPORT_MEMDUMP=y

CONFIG_VIDEO_BCM2835=m
CONFIG_VIDEO_CODEC_BCM2835=m
CONFIG_VIDEO_ISP_BCM2835=m
CONFIG_USB_VIDEO_CLASS=m
CONFIG_VIDEO_MUX=m
CONFIG_VIDEO_BCM2835_UNICAM=m
CONFIG_VIDEO_ARDUCAM_64MP=m
CONFIG_VIDEO_ARDUCAM_PIVARIETY=m
CONFIG_V4L_PLATFORM_DRIVERS=y
CONFIG_VIDEO_ARDUCAM_PIVARIETY=m
CONFIG_VIDEO_IMX219=m
CONFIG_VIDEO_IMX258=m
CONFIG_VIDEO_IMX290=m
CONFIG_VIDEO_IMX296=m
CONFIG_VIDEO_IMX477=m
CONFIG_VIDEO_IMX519=m
CONFIG_VIDEO_IMX708=m
CONFIG_VIDEO_MT9V011=m
CONFIG_VIDEO_OV2311=m
CONFIG_VIDEO_OV5647=m
CONFIG_VIDEO_OV64A40=m
CONFIG_VIDEO_OV7251=m
CONFIG_VIDEO_OV7640=m
CONFIG_VIDEO_OV9282=m
CONFIG_VIDEO_AD5398=m
CONFIG_VIDEO_AK7375=m
CONFIG_VIDEO_BU64754=m
CONFIG_VIDEO_DW9807_VCM=m
CONFIG_VIDEO_SONY_BTF_MPX=m
CONFIG_VIDEO_UDA1342=m
CONFIG_VIDEO_ADV7180=m
CONFIG_VIDEO_TC358743=m
CONFIG_VIDEO_TVP5150=m
CONFIG_VIDEO_TW2804=m
CONFIG_VIDEO_TW9903=m
CONFIG_VIDEO_TW9906=m
CONFIG_VIDEO_IRS1125=m
CONFIG_VIDEO_I2C=m
#
# USB Power Delivery and Type-C drivers
#
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Creates alsactl's state saving directory if necessary, and uses the lack of such
# a directory as an indication that this is a first-run and we should tweak up the
# volume.
[Unit]
Description=Create ALSA config file and set initial volume
ConditionPathExists=!/var/lib/alsa/asound.state

[Service]
Type=oneshot
ExecStart=/usr/bin/mkdir -p /var/lib/alsa/
ExecStart=/usr/bin/amixer set PCM 100%
ExecStart=/usr/bin/amixer set PCM unmute
ExecStart=/usr/sbin/alsactl store
Before=alsa-restore.service

[Install]
WantedBy=alsa-restore.service
WantedBy=sound.target
10 changes: 6 additions & 4 deletions configs/ot2_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,6d27aa156c26977dfd079a7107e31670127d17d3)/linux-6d27aa156c26977dfd079a7107e31670127d17d3.tar.gz"
BR2_LINUX_KERNEL_PATCH="board/opentrons/ot2/kernel-patches"
BR2_LINUX_KERNEL_DEFCONFIG="bcm2709"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/opentrons/ot2/kernel.config"
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/opentrons/ot2/bcm2907-frag.config"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2710-rpi-3-b bcm2710-rpi-3-b-plus bcm2710-rpi-cm3"
Expand Down Expand Up @@ -78,6 +79,10 @@ BR2_PACKAGE_PYTHON_PIP=y
BR2_PACKAGE_PYTHON_PYRSISTENT=y
BR2_PACKAGE_PYTHON_SYSTEMD=y
BR2_PACKAGE_ALSA_LIB=y
BR2_PACKAGE_ALSA_UTILS=y
BR2_PACKAGE_ALSA_UTILS_ALSACTL=y
BR2_PACKAGE_ALSA_UTILS_APLAY=y
BR2_PACKAGE_ALSA_UTILS_AMIXER=y
BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_LIBRESSL=y
BR2_PACKAGE_LIBRESSL_BIN=y
Expand Down Expand Up @@ -162,7 +167,4 @@ BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="board/opentrons/ot2/busybox-add-compr
BR2_PACKAGE_UTIL_LINUX_LIBMOUNT=y
BR2_TARGET_GENERIC_GETTY=n
BR2_PACKAGE_NETWORK_MANAGER_CLI=y
BR2_LINUX_KERNEL_USE_DEFCONFIG=y
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/opentrons/ot2/kernel.config"
BR2_PACKAGE_RASPI_GPIO=y

0 comments on commit e29e5b4

Please sign in to comment.