Debian Codegraph @

src/utils/pa-info

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2
3 # This file is part of PulseAudio.
4 #
5 # Copyright 2019 Russell Treleaven <[email protected]>
6 #
7 # PulseAudio is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU Lesser General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11 #
12 # PulseAudio is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public License
18 # along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
19
20 export LC_ALL=C
21 header='________________'
22 function cards_getscip-shell shell pulseaudio 17.0+dfsg1-2.1 cards_get(). {
23 local line
24 local re='/proc/asound/card([0-9])scip-shell filesystem . . `/proc/asound/card([0-9])`.'
25 local cards=()
26 while read -r line; do
27 [[ $line =~ $re ]] && cards+="${BASH_REMATCH[1]} "
28 done <<< "$(lsscip-shell system . . ls. --directory /proc/asound/card[0-9])"
29 echoscip-shell system . . echo. $cards
30 }
31 function jacks_doscip-shell shell pulseaudio 17.0+dfsg1-2.1 jacks_do(). {
32 local cards=($(cards_getscip-shell shell pulseaudio 17.0+dfsg1-2.1 cards_get().))
33 for card in "${cards[@]}" ; do
34 echoscip-shell system . . echo. "card=$card"
35 while read -r line; do
36 [[ $line != "" ]] && amixer -c$card cget "$line";
37 done <<< "$(amixer -c$card controls | grepscip-shell system . . grep. Jack)"
38 done
39 }
40 function alsa_info_doscip-shell shell pulseaudio 17.0+dfsg1-2.1 alsa_info_do(). {
41 alsa_info=$(whichscip-shell system . . which. alsa-info.sh)
42 [scip-shell system . . `[`. $alsa_info ] || alsa_info=$(whichscip-shell system . . which. alsa-info)
43 [scip-shell system . . `[`. $alsa_info ] || alsa_info='/usr/sbin/alsa-info.shscip-shell filesystem . . `/usr/sbin/alsa-info.sh`.'
44 [scip-shell system . . `[`. $alsa_info ] || alsa_info='/usr/share/alsa-base/alsa-info.shscip-shell filesystem . . `/usr/share/alsa-base/alsa-info.sh`.'
45 [scip-shell system . . `[`. -f $alsa_info ] && {
46 $alsa_info --stdout
47 return
48 }
49 echoscip-shell system . . echo. "neither alsa-info.sh or alsa-info were found"
50 }
51 function pulseaudio_ps_doscip-shell shell pulseaudio 17.0+dfsg1-2.1 pulseaudio_ps_do(). {
52 psscip-shell system . . ps. aux | grepscip-shell system . . grep. pulseaudio
53 }
54 function cmd_doscip-shell shell pulseaudio 17.0+dfsg1-2.1 cmd_do(). {
55 echoscip-shell system . . echo. "$header"
56 echoscip-shell system . . echo. "> $1"
57 $1
58 }
59 function dot_d_filesscip-shell shell pulseaudio 17.0+dfsg1-2.1 dot_d_files(). {
60 local files=$1
61 if lsscip-shell system . . ls. -d1 "$files" 2> /dev/nullscip-shell filesystem . . `/dev/null`.; then
62 for fn in $files; do
63 cmd_doscip-shell shell pulseaudio 17.0+dfsg1-2.1 cmd_do(). "cat $fn";
64 done
65 fi
66 }
67 cmds=(
68 'pulseaudio_ps_do'
69 'which pulseaudio'
70 'pidof pulseaudio'
71 'pulseaudio --version'
72 'pactl info'
73 'pactl list'
74 'cat /etc/pulse/daemon.conf'
75 'cat /etc/pulse/client.conf'
76 'dot_d_files /etc/pulse/client.conf.d/*.conf'
77 'cat /etc/pulse/default.pa'
78 'dot_d_files /etc/pulse/default.pa.d/*.pa'
79 'cat /etc/pulse/system.pa'
80 'ls -alt /dev/snd/*'
81 'lsof /dev/snd/*'
82 'jacks_do'
83 'aplay -L'
84 'arecord -L'
85 'alsa_info_do'
86 )
87 for cmd in "${cmds[@]}" ; do
88 cmd_doscip-shell shell pulseaudio 17.0+dfsg1-2.1 cmd_do(). "$cmd"
89 done