diff --git a/CHANGELOG.md b/CHANGELOG.md index 377e998..488fd53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # VocalFusion Raspberry Pi Setup Change Log +## 5.3.0 + + * Fix setup_dac.py script for XVF3615 + * Build I2S slave drivers for UA XVF3610 setup + * Save crontab settings in 'resources' directory + * Use different names for I2S slave and master scripts + ## 5.2.0 * Added copying of asoundrc file at bootup diff --git a/resources/clk_dac_setup/setup_dac.py b/resources/clk_dac_setup/setup_dac.py index 9a560b4..3c40794 100644 --- a/resources/clk_dac_setup/setup_dac.py +++ b/resources/clk_dac_setup/setup_dac.py @@ -1,5 +1,5 @@ #!usr/bin/python -# Copyright (c) 2018-2021, XMOS Ltd, All rights reserved +# Copyright (c) 2018-2022, XMOS Ltd, All rights reserved #run this on the raspberry pi to program the DAC @@ -23,7 +23,7 @@ def setup_dac(args): I2C_EXPANDER_ADDRESS = 0x20 - if args.hw == "xvf3600" or args.hw == "xvf3610" : + if "xvf36" in args.hw: # I2C expander register addresses I2C_EXPANDER_OUTPUT_PORT_REG = 0x01 @@ -55,12 +55,12 @@ def setup_dac(args): # Configure pin directions. Setting to 1 means input, or Hi-Z. So anything not mentioned # below will be an output. Note reset, int and boot_sel NOT driven because they are set high in the mask # use DAC_RST_N and level shift OE as driven outputs - # Configure the mute pin as input only for XVF3610 + # Configure the mute pin as input only for XVF361x if args.hw == "xvf3600": CONFIGURATION_MASK = (1< /dev/null # Copy the udev rules files if device is UA -if [[ -n "$UA_MODE" ]]; then +if [[ -n "$USB_MODE" ]]; then echo "Add UDEV rules for XMOS devices" sudo cp $RPI_SETUP_DIR/resources/99-xmos.rules /etc/udev/rules.d/ fi @@ -208,7 +209,7 @@ sudo /etc/init.d/alsa-utils restart if [[ -n "$I2S_MODE" ]]; then # Create the script to run after each reboot and make the soundcard available - i2s_driver_script=$RPI_SETUP_DIR/resources/load_i2s_driver.sh + i2s_driver_script=$RPI_SETUP_DIR/resources/load_i2s_${I2S_MODE}_driver.sh rm -f $i2s_driver_script # Sometimes with Buster on RPi3 the SYNC bit in the I2S_CS_A_REG register is not set before the drivers are loaded @@ -256,27 +257,34 @@ if [[ -n "$DAC_SETUP" ]]; then fi # Regenerate crontab file with new commands -rm -f $RPI_SETUP_DIR/resources/crontab +crontab_file=$RPI_SETUP_DIR/resources/crontab +if [ -n "$USB_MODE" ]; then + crontab_file="${crontab_file}_usb" +elif [ -n "$I2S_MODE" ]; then + crontab_file="${crontab_file}_i2s_${I2S_MODE}" +fi + +rm -f $crontab_file # Setup the crontab to restart I2S at reboot if [ -n "$I2S_MODE" ] || [ -n "$DAC_SETUP" ]; then if [[ -n "$I2S_MODE" ]]; then - echo "@reboot sh $i2s_driver_script" >> $RPI_SETUP_DIR/resources/crontab + echo "@reboot sh $i2s_driver_script" >> $crontab_file fi - if [[ -n "$DAC_SETUP" ]]; then - echo "@reboot sh $dac_and_clks_script" >> $RPI_SETUP_DIR/resources/crontab + echo "@reboot sh $dac_and_clks_script" >> $crontab_file fi popd > /dev/null fi + # Setup the crontab to copy the .asoundrc file at reboot # Delay the action by 10 seconds to allow the host to boot up # This is needed to address the known issue in Raspian Buster: # https://forums.raspberrypi.com/viewtopic.php?t=295008 -echo "@reboot sleep 15 && cp $ASOUNDRC_TEMPLATE ~/.asoundrc" >> $RPI_SETUP_DIR/resources/crontab +echo "@reboot sleep 15 && cp $ASOUNDRC_TEMPLATE ~/.asoundrc" >> $crontab_file # Update crontab -crontab $RPI_SETUP_DIR/resources/crontab +crontab $crontab_file echo "To enable all interfaces, this Raspberry Pi must be rebooted."