Skip to content

Commit

Permalink
Merge pull request #2085 from octalthorpe/fix/2083
Browse files Browse the repository at this point in the history
Issue #2083 - Fix scraping for mixer devices.
  • Loading branch information
cpinkham authored Feb 1, 2025
2 parents cb8d079 + aa29d4d commit 089f3cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/boot/FPPINIT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1112,13 +1112,13 @@ static void setupAudio() {
break;
}
PutFileContents("/root/.asoundrc", asoundrc);
std::string mixers = execAndReturn("/usr/bin/amixer -c " + std::to_string(card) + " scontrols | head -1 | cut -f2 -d\"'\"");
std::string mixers = execAndReturn("/usr/bin/amixer -c " + std::to_string(card) + " scontrols | cut -f2 -d\"'\"");
if (mixers.empty()) {
// for some sound cards, the mixer devices won't show up
// until something is played. Play one second of silence
exec("/usr/bin/aplay -d 1 /opt/fpp/media/silence_5sec.wav >> /dev/null 2>&1 &");
std::this_thread::sleep_for(std::chrono::milliseconds(200));
mixers = execAndReturn("/usr/bin/amixer -c " + std::to_string(card) + " scontrols | head -1 | cut -f2 -d\"'\"");
mixers = execAndReturn("/usr/bin/amixer -c " + std::to_string(card) + " scontrols | cut -f2 -d\"'\"");
}
TrimWhiteSpace(mixers);
std::string mixer;
Expand Down

0 comments on commit 089f3cb

Please sign in to comment.