Lines 5-10
Link Here
|
5 |
|
5 |
|
6 |
alsastatedir=/var/lib/alsa |
6 |
alsastatedir=/var/lib/alsa |
7 |
alsascrdir=/etc/alsa.d |
7 |
alsascrdir=/etc/alsa.d |
|
|
8 |
loaded_modules="" |
8 |
|
9 |
|
9 |
opts="save restore" |
10 |
opts="save restore" |
10 |
|
11 |
|
Lines 46-51
Link Here
|
46 |
if ! grep -q "^${DMOD} " /proc/modules ; then |
47 |
if ! grep -q "^${DMOD} " /proc/modules ; then |
47 |
ebegin "Loading: ${DRIVER}" |
48 |
ebegin "Loading: ${DRIVER}" |
48 |
modprobe ${DRIVER} |
49 |
modprobe ${DRIVER} |
|
|
50 |
loaded_modules="${DRIVER} ${loaded_modules}" |
49 |
eend $? |
51 |
eend $? |
50 |
fi |
52 |
fi |
51 |
done |
53 |
done |
Lines 58-63
Link Here
|
58 |
if ! grep -q "^${DMOD} " /proc/modules ; then |
60 |
if ! grep -q "^${DMOD} " /proc/modules ; then |
59 |
ebegin "Loading: ${SEQUENCER}" |
61 |
ebegin "Loading: ${SEQUENCER}" |
60 |
modprobe ${SEQUENCER} |
62 |
modprobe ${SEQUENCER} |
|
|
63 |
loaded_modules="${SEQUENCER} ${loaded_modules}" |
61 |
eend $? |
64 |
eend $? |
62 |
fi |
65 |
fi |
63 |
done |
66 |
done |
Lines 78-83
Link Here
|
78 |
eerror "ERROR: Failed to load necessary drivers" |
81 |
eerror "ERROR: Failed to load necessary drivers" |
79 |
return 1 |
82 |
return 1 |
80 |
fi |
83 |
fi |
|
|
84 |
|
85 |
mkdir -p /var/run/alsasound |
86 |
if [ ! -d /var/run/alsasound ] ; then |
87 |
eerror "ERROR: Failed to create alsasound directory" |
88 |
return 1 |
89 |
fi |
90 |
|
91 |
echo "${loaded_modules}" > /var/run/alsasound/alsa.modules |
92 |
|
93 |
if [ ! -f /var/run/alsasound/alsa.modules ] ; then |
94 |
eeror "ERROR: Unable to create alsa.modules" |
95 |
fi |
81 |
} |
96 |
} |
82 |
|
97 |
|
83 |
unload_modules_24() { |
98 |
unload_modules_24() { |
Lines 105-110
Link Here
|
105 |
} |
120 |
} |
106 |
|
121 |
|
107 |
unload_modules_26() { |
122 |
unload_modules_26() { |
|
|
123 |
# ensure drivers and sequencers are unloaded before everything else. |
124 |
# see Gentoo bug: 232875 |
125 |
for module in `cat /var/run/alsasound/alsa.modules`; do |
126 |
unload_modules_recursive "${module}" |
127 |
done |
128 |
|
108 |
# First of all, remove the snd module and all the modules depending |
129 |
# First of all, remove the snd module and all the modules depending |
109 |
# on it, this should remove already most of ALSA modules. |
130 |
# on it, this should remove already most of ALSA modules. |
110 |
lsmod | grep -q "^snd[[:space:]]" && unload_modules_recursive snd |
131 |
lsmod | grep -q "^snd[[:space:]]" && unload_modules_recursive snd |
Lines 114-119
Link Here
|
114 |
unload_modules_recursive "${module}" |
135 |
unload_modules_recursive "${module}" |
115 |
done |
136 |
done |
116 |
|
137 |
|
|
|
138 |
rm -rf /var/run/alsasound |
117 |
lsmod | grep -vq "^snd" |
139 |
lsmod | grep -vq "^snd" |
118 |
} |
140 |
} |
119 |
|
141 |
|