Here's what I found:
After running set_startup.sh with the -c arguments as above, startup_env looks like this:
If I manually add the arguments to ARGS, it works on startup the way it's supposed to:
ARGS=--hp-level 0 --pga-gain-left 30 --pga-gain-right 30
Now, looking at set_startup.sh, I noticed a strange thing (keep in mind I'm not well-versed in bash or make scripts). The -c arguments are assigned to the variable COMMAND_ARGS:
while [ -n "$1" ]
case $1 in
...but the make command looks like it's constructed using a different variable name, OPTARG:
MAKE_COMMAND="make --no-print-directory -C $BBB_BELA_HOME PROJECT=$BBB_PROJECT_NAME CL=\"$OPTARG\""
I tried changing this to reference the COMMAND_ARGS variable:
MAKE_COMMAND="make --no-print-directory -C $BBB_BELA_HOME PROJECT=$BBB_PROJECT_NAME CL=\"$COMMAND_ARGS\""
After which, running set_startup.sh produces a startup_env file that looks appropriate:
ARGS=--hp-level 0 --pga-in-left 30 --pga-gain-right 30
However, after this modification the project does not boot at startup!
1) I can manually edit startup_env to include my command-line arguments, and it works as expected
2) If I "fix" set_startup.sh it seems to create a proper startup_env file but something else breaks and the project won't launch at startup
I can happily work with the workaround of editing startup_env, and hopefully this post provides some clues that will help trace the root cause and/or help lurkers who might be having the same problem.