diff options
| author | Craig Jennings <c@cjennings.net> | 2026-02-26 17:51:40 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-02-26 17:51:40 -0600 |
| commit | f47573e8eddb02db7f3cbf79a8c1825bf1b32323 (patch) | |
| tree | 6344a17cd78053e99530730de060307b822f4364 /tests | |
| parent | 46af687f2444754657000116178eeb80addd5a52 (diff) | |
fix(recording): remove drift detection that overrides explicit sink choice
Validation Check 2 (default sink drifted) would silently replace the
user's explicit sink selection from quick-setup with the default sink's
monitor on every recording start. Removed it — if the device still
exists, trust the user's choice. The no-audio warning (Check 3) already
catches wrong-sink scenarios.
Also fix commentary: device selection does not persist across sessions
(both vars are plain defvar), and update validation section to match
the two remaining checks.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-video-audio-recording-validate-system-audio.el | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/tests/test-video-audio-recording-validate-system-audio.el b/tests/test-video-audio-recording-validate-system-audio.el index a8aaed12..ee85d94c 100644 --- a/tests/test-video-audio-recording-validate-system-audio.el +++ b/tests/test-video-audio-recording-validate-system-audio.el @@ -73,32 +73,30 @@ (should (cl-some (lambda (m) (string-match-p "no longer exists" m)) messages)))) (test-validate-teardown))) -(ert-deftest test-validate-system-audio-normal-drifted-default-auto-updates () - "Test that device is updated when default sink has drifted." +(ert-deftest test-validate-system-audio-normal-respects-explicit-non-default-choice () + "Test that an existing non-default device is NOT overridden by drift detection." (test-validate-setup) (unwind-protect - (let ((cj/recording-system-device "alsa_output.pci-0000.hdmi-stereo.monitor") - (messages nil)) + (let ((cj/recording-system-device "alsa_output.pci-0000.hdmi-stereo.monitor")) (cl-letf (((symbol-function 'shell-command-to-string) (lambda (cmd) (cond ((string-match-p "sources short" cmd) - ;; Old device still exists + ;; Device still exists (concat "65\talsa_output.pci-0000.hdmi-stereo.monitor\tPipeWire\ts32le 2ch 48000Hz\tSUSPENDED\n" "69\talsa_output.usb-Jabra-00.analog-stereo.monitor\tPipeWire\ts32le 2ch 48000Hz\tSUSPENDED\n")) ((string-match-p "sinks short" cmd) - "69\talsa_output.usb-Jabra-00.analog-stereo\tPipeWire\ts32le 2ch 48000Hz\tSUSPENDED\n") - ((string-match-p "sink-inputs" cmd) "Sink Input #1\n\tSink: 69\n") - ;; But default has changed to Jabra + "65\talsa_output.pci-0000.hdmi-stereo\tPipeWire\ts32le 2ch 48000Hz\tRUNNING\n") + ((string-match-p "sink-inputs" cmd) "Sink Input #1\n\tSink: 65\n") + ;; Default is Jabra, but user explicitly chose HDMI ((string-match-p "get-default-sink" cmd) "alsa_output.usb-Jabra-00.analog-stereo") (t "")))) - ((symbol-function 'message) - (lambda (fmt &rest args) - (push (apply #'format fmt args) messages)))) + ((symbol-function 'message) (lambda (_fmt &rest _args) nil)) + ((symbol-function 'cj/log-silently) (lambda (_fmt &rest _args) nil))) (cj/recording--validate-system-audio) - (should (equal "alsa_output.usb-Jabra-00.analog-stereo.monitor" - cj/recording-system-device)) - (should (cl-some (lambda (m) (string-match-p "default output changed" m)) messages)))) + ;; Should keep the user's explicit HDMI choice, not drift to Jabra + (should (equal "alsa_output.pci-0000.hdmi-stereo.monitor" + cj/recording-system-device)))) (test-validate-teardown))) (ert-deftest test-validate-system-audio-normal-no-audio-warns () |
