From 44274084d3d87d6affe2b49b933d2409e11ef668 Mon Sep 17 00:00:00 2001 From: Paul Dino Jones Date: Fri, 17 Jan 2025 10:28:25 -0500 Subject: [PATCH] added a few commands to help with sound setup --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b610a23..da5a762 100644 --- a/README.md +++ b/README.md @@ -73,11 +73,19 @@ cmake -DUSE_PULSEAUDIO=YES .. ``` ## Bass Shaker Sound Devices -When using pulseaudio it is necesarry to provide a devid in the configuration. You can find this with: (you need to look at the full output of pactl if you don't know which one you want) +When using pulseaudio it is necesarry to provide a devid in the configuration. This command should list available sound cards with the "Name" being the "devid" needed in the monocoque config. ``` -pactl list sinks|grep -E -i 'index:|name:' +pactl list sinks | grep -E -i 'index:|name:' -A 4 ``` -analyze the output to determine the appropriate hardware to which you would like to output the effects. ( Need to research how to do this with pipewire. ) +One can generate sample sine waves at specific frequency on a specific channel on a specific sound card with this command +``` +ffmpeg -f lavfi -i "sine=f=440" -af "pan=7.1|c1=c0,surround=level_out=10" -f wav pipe:1 | paplay --no-remap --no-remix -d alsa_output.pci-0000_00_1b.0.analog-stereo -n "Monocoque" --stream-name="Haptic Test" +``` +(the -n and --stream-name are optional but it helps you identify the stream in pavucontrol) +The channel map from the pactl command is the order of channels. Change c1 in this above command to the desired output channel. + +The effects generated by monocoque should match the effects generated by this ffmpeg command. The frequency will differ slightly due to having to [fit in the buffer size](https://stackoverflow.com/questions/40078417/how-to-calculate-minimum-cycles-of-sine-wave-to-have-integer-n-cycles-in-a-buffe) +(monocoque lowers the target frequency until it fits in the audio buffer). ## Using Arduino Devices