Skip to content

Commit aa29d4d

Browse files
committed
Issue #2083 - Fix scraping for mixer devices.
The list of mixer devices was limited to 1 due to 'head -1' in the command pipeline. This means you could only every set and persist the first mixer device of a card. Remove the 'head -1' call so all mixer devices are scraped.
1 parent 01d7bff commit aa29d4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/boot/FPPINIT.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,13 +1091,13 @@ static void setupAudio() {
10911091
break;
10921092
}
10931093
PutFileContents("/root/.asoundrc", asoundrc);
1094-
std::string mixers = execAndReturn("/usr/bin/amixer -c " + std::to_string(card) + " scontrols | head -1 | cut -f2 -d\"'\"");
1094+
std::string mixers = execAndReturn("/usr/bin/amixer -c " + std::to_string(card) + " scontrols | cut -f2 -d\"'\"");
10951095
if (mixers.empty()) {
10961096
// for some sound cards, the mixer devices won't show up
10971097
// until something is played. Play one second of silence
10981098
exec("/usr/bin/aplay -d 1 /opt/fpp/media/silence_5sec.wav >> /dev/null 2>&1 &");
10991099
std::this_thread::sleep_for(std::chrono::milliseconds(200));
1100-
mixers = execAndReturn("/usr/bin/amixer -c " + std::to_string(card) + " scontrols | head -1 | cut -f2 -d\"'\"");
1100+
mixers = execAndReturn("/usr/bin/amixer -c " + std::to_string(card) + " scontrols | cut -f2 -d\"'\"");
11011101
}
11021102
TrimWhiteSpace(mixers);
11031103
std::string mixer;

0 commit comments

Comments
 (0)