6 printf "%4s" `lshal -l -u "$1"|grep "$2 ="|cut -d"(" -f2|cut -d")" -f1|cut -dx -f2`|
tr ' ' '0'
10 lshal
-l -u "$1"|
grep "$2 = "|cut
-d"=" -f2|cut
-d' ' -f2
14 lshal
-l -u "$1"|
grep "$2 ="|cut
-d"'" -f2
17 createAlsaEntryFromHal
()
19 subsystem
=`getString "$2" "info\.subsystem"`
20 test -z "$subsystem" && subsystem
=`getString "$2" "linux\.subsystem"`
21 vendor
=`getString "$2" "$subsystem\\.vendor"`
22 product
=`getString "$2" "$subsystem\\.product"`
23 vendor_id
=`getId "$2" "$subsystem\\.vendor_id"`
24 product_id
=`getId "$2" "$subsystem\\.product_id"`
26 comment
="$vendor $product"
27 if test "$subsystem" = "usb"; then
28 id
="usb:$vendor_id:$product_id"
30 elif test "$subsystem" = "pci"; then
31 subsys_vendor
=`getString "$2" "\\.subsys_vendor"`
32 subsys_vendor_id
=`getId "$2" "\\.subsys_vendor_id"`
33 subsys_product_id
=`getId "$2" "\\.subsys_product_id"`
34 id
="pci:$vendor_id:$product_id:$subsys_vendor_id:$subsys_product_id"
35 comment
="$comment $subsys_vendor"
37 alsa_device
=`getNumber "$1" "alsa\\.device"`
38 id
="$id:$3:alsa:$alsa_device"
39 if echo -e "$found_ids"|
grep -q -v "$id"; then
40 found_ids
="$found_ids $id"
41 card_id
=`getString "$1" "alsa\\.card_id"`
42 device_id
=`getString "$1" "alsa\\.device_id"`
43 comment
="$comment $card_id $device_id"
44 if echo -e "$card_id $device_id"|
grep -q -E -i "(spdif|s/pdif|iec958)"; then
47 all_entries
="$all_entries\n# $comment\t[$id]\tname=$card_id ($device_id)\tinitialPreference=$pref\t"
52 createOssEntryFromHal
()
54 subsystem
=`getString "$2" "info\.subsystem"`
55 test -z "$subsystem" && subsystem
=`getString "$2" "linux\.subsystem"`
56 vendor
=`getString "$2" "$subsystem\\.vendor"`
57 product
=`getString "$2" "$subsystem\\.product"`
58 vendor_id
=`getId "$2" "$subsystem\\.vendor_id"`
59 product_id
=`getId "$2" "$subsystem\\.product_id"`
61 comment
="$vendor $product"
62 if test "$subsystem" = "usb"; then
63 id
="usb:$vendor_id:$product_id"
65 elif test "$subsystem" = "pci"; then
66 subsys_vendor
=`getString "$2" "\\.subsys_vendor"`
67 subsys_vendor_id
=`getId "$2" "\\.subsys_vendor_id"`
68 subsys_product_id
=`getId "$2" "\\.subsys_product_id"`
69 id
="pci:$vendor_id:$product_id:$subsys_vendor_id:$subsys_product_id"
70 comment
="$comment $subsys_vendor"
73 if echo -e "$found_ids"|
grep -q -v "$id"; then
74 found_ids
="$found_ids $id"
75 card_id
=`getString "$1" "oss\\.card_id"`
76 device_id
=`getString "$1" "oss\\.device_id"`
77 comment
="$comment $card_id $device_id"
78 if echo -e "$card_id $device_id"|
grep -q -E -i "(spdif|s/pdif|iec958)"; then
81 all_entries
="$all_entries\n# $comment\t[$id]\tname=$card_id ($device_id)\tinitialPreference=$pref\t"
86 echo "/proc/asound/cards:"
87 cat /proc
/asound
/cards
88 echo -e "\n/proc/asound/pcm:"
90 for card
in `cat /proc/asound/cards|cut -c1-2`; do
92 codec
="/proc/asound/card$card/codec#$num"
93 while test -e "$codec"; do
97 codec
="/proc/asound/card$card/codec#$num"
100 codec
="/proc/asound/card$card/codec97#$num"
101 while test -d "$codec"; do
102 echo -e -n "\n$codec/ac97#"?
-?
104 cat "$codec/ac97#"?
-?
106 codec
="/proc/asound/card$card/codec97#$num"
110 alsaplayback
=`lshal -s|grep _alsa_playback`
111 for playback_udi
in $alsaplayback; do
112 card_udi
="${playback_udi%_alsa_playback_*}"
113 card_udi
="${card_udi%_sound_card_*}"
114 createAlsaEntryFromHal
"$playback_udi" "$card_udi" "playback"
116 alsacapture
=`lshal -s|grep _alsa_capture`
117 for capture_udi
in $alsacapture; do
118 card_udi
="${capture_udi%_alsa_capture_*}"
119 card_udi
="${card_udi%_sound_card_*}"
120 createAlsaEntryFromHal
"$capture_udi" "$card_udi" "capture"
122 oss
=`lshal -s|grep _oss_pcm`
124 card_udi
="${udi%_oss_pcm*}"
125 card_udi
="${card_udi%_sound_card_*}"
126 createOssEntryFromHal
"$udi" "$card_udi"
129 echo -e "$all_entries"|
sort|
sed "s,\t,\n,g"