30 #include <sys/types.h>
37 #define LOC QString("ELDUTILS: ")
94 "DSD (One Bit Audio)",
142 GRAB_BITS(
const char* buf,
size_t byte, uint8_t lowbit, uint8_t bits)
143 {
return (buf[
byte] >> lowbit) & ((1 << bits) - 1); };
172 for (
int i = 0; i < 7; i++)
173 if ((val & (1 << i)) != 0)
187 VBAUDIO(
"audio coding type 0 not expected");
221 VBAUDIO(QString(
"audio coding xtype %1 not expected")
258 m_e.
port_id = qFromLittleEndian<quint64>(buf + 8);
266 VBAUDIO(QString(
"out of range MNL %1").arg(mnl));
279 VBAUDIO(QString(
"out of range SAD %1").arg(i));
305 static const std::array<const uint32_t,12> rates {
306 5512, 8000, 11025, 16000, 22050, 32000, 44100, 48000, 88200,
307 96000, 176400, 192000 };
308 QString result = QString();
310 for (
size_t i = 0; i < rates.size(); i++)
312 if ((pcm & (1 << i)) != 0)
314 result += QString(
" %1").arg(rates[i]);
326 static const std::array<const uint8_t,3> bits { 16, 20, 24 };
327 QString result = QString();
329 for (
size_t i = 0; i < bits.size(); i++)
331 if ((pcm & (1 << i)) != 0)
333 result += QString(
" %1").arg(bits[i]);
346 QString buf2 =
", bits =";
351 buf2 = QString(
", max bitrate = %1").arg(a->
max_bitrate);
355 return QString(
"supports coding type %1:"
356 " channels = %2, rates =%3%4")
363 QString result = QString();
379 case 2:
return "CEA-861D or below";
380 case 31:
return "partial";
381 default:
return "reserved";
389 case 0:
return "no CEA EDID Timing Extension block present";
390 case 1:
return "CEA-861";
391 case 2:
return "CEA-861-A";
392 case 3:
return "CEA-861-B, C or D";
393 default:
return "reserved";
399 QString result = QString(
"manufacture_id\t\t0x%1\n")
401 result += QString(
"product_id\t\t0x%1\n").arg(
m_e.
product_id, 0, 16);
402 result += QString(
"port_id\t\t\t0x%1\n").arg((
long long)
m_e.
port_id);
406 result += QString(
"sad_count\t\t%1\n").arg(
m_e.
sad_count);
422 VBAUDIO(QString(
"Detected monitor %1 at connection type %2")
427 VBAUDIO(QString(
"available speakers:%1")
457 channels = std::max(a->
channels, channels);
469 channels = std::max(a->
channels, channels);
476 QString result = QString();
477 bool found_one =
false;