Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/DMDUtil/DMD.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class DMDUTILAPI DMD
bool m_dumpSuffixValid = false;

bool m_hasUpdateBuffered = false;
static bool m_finding;
static std::atomic<bool> m_finding;

#if !( \
(defined(__APPLE__) && ((defined(TARGET_OS_IOS) && TARGET_OS_IOS) || (defined(TARGET_OS_TV) && TARGET_OS_TV))) || \
Expand Down
2 changes: 1 addition & 1 deletion platforms/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

LIBZEDMD_SHA=dc6613ddfabece90dcb345001aa5ff313d40a1e1
LIBSERUM_SHA=579c557d474e4728d17dd525bb3c30eb8f2680c1
LIBSERUM_SHA=ea1d6a31e60e0708d04ccd05d60fdaaef72a4448
LIBPUPDMD_SHA=cd186754ba0dcc1ea418d5557d59d7bf2ed628a3
LIBVNI_SHA=ba43c5abff7fbbb831a4beb9be54447df1532f0c
LIBUSB_SHA=15a7ebb4d426c5ce196684347d2b7cafad862626
Expand Down
37 changes: 31 additions & 6 deletions src/DMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class DMDServerConnector
sockpp::tcp_connector* m_pConnector;
};

bool DMD::m_finding = false;
std::atomic<bool> DMD::m_finding{false};

void DMD::Update::convertToHostByteOrder()
{
Expand Down Expand Up @@ -514,7 +514,7 @@ bool DMD::ConnectDMDServer()
return (m_pDMDServerConnector);
}

bool DMD::IsFinding() { return m_finding; }
bool DMD::IsFinding() { return m_finding.load(std::memory_order_acquire); }

bool DMD::HasDisplay() const
{
Expand Down Expand Up @@ -1015,7 +1015,7 @@ bool DMD::WaitForSerumColorizeCapture(uint64_t sourceOrdinal, SerumCapture& capt

void DMD::FindDisplays()
{
if (m_finding) return;
if (m_finding.load(std::memory_order_acquire)) return;

Config* const pConfig = Config::GetInstance();

Expand All @@ -1026,7 +1026,7 @@ void DMD::FindDisplays()

if (pConfig->IsLocalDisplaysActive())
{
m_finding = true;
m_finding.store(true, std::memory_order_release);

std::thread(
[this]()
Expand Down Expand Up @@ -1146,7 +1146,7 @@ void DMD::FindDisplays()
}
#endif

m_finding = false;
m_finding.store(false, std::memory_order_release);
})
.detach();
}
Expand Down Expand Up @@ -1510,6 +1510,13 @@ void DMD::SerumThread()
{
if (strcmp(m_romName, name) != 0)
{
// don't load Serum until all displays are found
if (m_finding.load(std::memory_order_acquire))
{
QueueBuffer();
continue;
}

strcpy(name, m_romName);

if (m_pSerum)
Expand All @@ -1523,10 +1530,28 @@ void DMD::SerumThread()

if (m_altColorPath[0] == '\0') strcpy(m_altColorPath, Config::GetInstance()->GetAltColorPath());
flags = 0;
const bool zedmdOnly = m_pZeDMD && m_rgb24DMDs.empty() && m_levelDMDs.empty()
#if !( \
(defined(__APPLE__) && ((defined(TARGET_OS_IOS) && TARGET_OS_IOS) || (defined(TARGET_OS_TV) && TARGET_OS_TV))) || \
defined(__ANDROID__))
&& !m_pPixelcadeDMD
#endif
#if defined(DMDUTIL_ENABLE_PIN2DMD) && !((defined(__APPLE__) && ((defined(TARGET_OS_IOS) && TARGET_OS_IOS) || \
(defined(TARGET_OS_TV) && TARGET_OS_TV))) || \
defined(__ANDROID__))
&& !m_PIN2DMDConnected
#endif
;

if (zedmdOnly)
{
// A single ZeDMD only needs the frame height it can actually render.
flags = (m_pZeDMD->GetHeight() == 64) ? FLAG_REQUEST_64P_FRAMES : FLAG_REQUEST_32P_FRAMES;
}

// At the moment, ZeDMD HD and RGB24DMD are the only devices supporting 64P frames. Not requesting 64P
// saves memory.
if (m_pZeDMD)
if (!zedmdOnly && m_pZeDMD)
{
if (m_pZeDMD->GetHeight() == 64)
flags |= FLAG_REQUEST_64P_FRAMES;
Expand Down
4 changes: 2 additions & 2 deletions src/convertSerum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ int main(int argc, char* argv[])
uint8_t flags = FLAG_REQUEST_32P_FRAMES | FLAG_REQUEST_64P_FRAMES;
if (opt_strip_sd)
{
flags = FLAG_REQUEST_64P_FRAMES;
flags = FLAG_REQUEST_64P_FRAMES | FLAG_REQUEST_FORCE;
}
else if (opt_strip_hd)
{
flags = FLAG_REQUEST_32P_FRAMES;
flags = FLAG_REQUEST_32P_FRAMES | FLAG_REQUEST_FORCE;
}

if (opt_logging)
Expand Down
Loading