From ca6e9d5c95a915d5bed3eb12c2116b0763c37874 Mon Sep 17 00:00:00 2001 From: onefang Date: Fri, 23 May 2025 15:28:08 +1000 Subject: Maximize the volume, and turn on IEC958 for everything, so we can hear everything. --- aataaj.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'aataaj.lua') diff --git a/aataaj.lua b/aataaj.lua index 31b0cd2..7375811 100755 --- a/aataaj.lua +++ b/aataaj.lua @@ -231,9 +231,20 @@ print(s) -- io.flush() end --- TODO - Need to maximize the volume, and turn on IEC958 for the devices / sub devices. Coz seems they might default to "can't hear it" states. if 'start' == cmd then print('Your ' .. cnt .. ' audio devices are - ') + + for k = 0, cnt do + -- Turn on IEC958 for everything, they seem to default to off, so can't hear them. + for l, m in ipairs(__("amixer -c " .. k .. " scontrols | grep 'IEC958' | cut -d ',' -f 2"):noErr():Do().lines) do + __("amixer -c " .. k .. " set IEC958," .. m .. " on"):Do() + end + -- Turn the volume to maximum for everything. + for l, m in ipairs(__("amixer -c " .. k .. " controls | grep ' Playback Volume' | cut -d ',' -f 1"):noErr():Do().lines) do + __("amixer -c " .. k .. " cset iface=MIXER,name='PCM Playback Volume'," .. m .. " 100% "):Do() + end + end + for k,C in pairs(Cards) do for j,c in ipairs(C['playbackDevs']) do speak(C.name, nil, C.card - 1, 'Your ' .. cnt .. ' audio devices are - ', false, true, 'your', numbers[cnt], 'devices') -- cgit v1.1