diff --git a/scripts/audio-setup-utils.sh b/scripts/audio-setup-utils.sh index 60862da..d879fa2 100755 --- a/scripts/audio-setup-utils.sh +++ b/scripts/audio-setup-utils.sh @@ -8,14 +8,10 @@ GOVERNOR="performance" MAX_SPEED="0" MIN_SPEED="0" " | sudo tee -a /etc/default/cpufrequtils -# Install other useful tools -sudo apt-get install htop git perl vim - # Set CPU governor sudo sed -i 's/exit 0/sudo cpufreq-set -r -g performance/g' /etc/rc.local sudo echo "exit 0" | sudo tee -a /etc/rc.local - # Set realtime priority and memlock sudo echo " @audio nice -15 @@ -29,4 +25,4 @@ sudo echo " sudo echo " vm.swappiness = 10 fs.inotify.max_user_watches = 524288 -" | sudo tee /etc/sysctl.conf \ No newline at end of file +" | sudo tee /etc/sysctl.conf diff --git a/scripts/setup-audio.sh b/scripts/setup-audio.sh index 936a568..0aa73f1 100755 --- a/scripts/setup-audio.sh +++ b/scripts/setup-audio.sh @@ -1,5 +1,23 @@ #!/bin/sh -# Install jackd +# Get ID and number of the USB audio device -# Audio setup utils \ No newline at end of file +card_number=$(aplay -l | grep -i usb | grep -i audio | cut -d ' ' -f 2 | cut -d ':' -f 1) + +# Change default audio device + +sudo touch /etc/asound.conf + +sudo cat << EOF | sudo tee -a /etc/asound.conf +pcm.!default { + type plug + slave { + pcm "hw:$card_number,0" + } +} + +ctl.!default { + type hw + card $card_number +} +EOF diff --git a/scripts/setup-pressure-depth.sh b/scripts/setup-pressure-depth.sh new file mode 100644 index 0000000..96b4b06 --- /dev/null +++ b/scripts/setup-pressure-depth.sh @@ -0,0 +1 @@ +#!/bin/sh \ No newline at end of file diff --git a/scripts/start-all.sh b/scripts/start-all.sh index 17cbbb4..8630d40 100755 --- a/scripts/start-all.sh +++ b/scripts/start-all.sh @@ -1,3 +1,3 @@ #!/bin/sh -(trap 'kill 0' SIGINT; ./scripts/start-gps.sh & ./scripts/start-audio.sh) +(trap 'kill 0' SIGINT; ./scripts/start-gps.sh & ./scripts/start-audio.sh & ./scripts/start-pressure-depth.sh) diff --git a/scripts/start-audio.sh b/scripts/start-audio.sh index c82669e..cfc0680 100755 --- a/scripts/start-audio.sh +++ b/scripts/start-audio.sh @@ -1,9 +1,7 @@ #!/bin/sh -# Start jack server +AUDIO_TARGET_LOCATION="/home/shared/hydrophonitor/audio-logger/target/release" +AUDIO_TARGET_EXECUTABLE="audio" +OPTIONS="" -sh scripts/start-jack.sh - -# Start recording - -cd audio-logger && cargo run \ No newline at end of file +cd $AUDIO_TARGET_LOCATION && ./AUDIO_TARGET_EXECUTABLE $OPTIONS \ No newline at end of file diff --git a/scripts/start-gps.sh b/scripts/start-gps.sh index be7cf51..08ba09d 100755 --- a/scripts/start-gps.sh +++ b/scripts/start-gps.sh @@ -1,3 +1,6 @@ #!/usr/bin/sh -python /home/shared/logger-raspi-setup/gps-logger/record-gps.py +GPS_TARGET_LOCATION="/home/shared/hydrophonitor/gps-logger" +OPTIONS="" + +cd $GPS_TARGET_LOCATION && python record-gps.py $OPTIONS diff --git a/scripts/start-jack.sh b/scripts/start-jack.sh deleted file mode 100755 index c587dcf..0000000 --- a/scripts/start-jack.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Get soundcard name -soundcard=$(grep USB /proc/asound/cards | grep -oe "\[.*]" | tr -d "[] ") - -# Start jack server -/usr/bin/jackd -P75 -d alsa -d hw:${soundcard} -r 44100 -p 512 -n 3 & diff --git a/scripts/start-pressure-depth.sh b/scripts/start-pressure-depth.sh new file mode 100644 index 0000000..f7ff23a --- /dev/null +++ b/scripts/start-pressure-depth.sh @@ -0,0 +1,6 @@ +#!/usr/bin/sh + +DEPTH_TARGET_LOCATION="/home/shared/hydrophonitor/depth-logger" +OPTIONS="" + +cd $DEPTH_TARGET_LOCATION && python record-depth.py $OPTIONS