結局そこまで凝る必要は無かったのですが、やってしまいました。
機能としては以下の通り。
・SupportのI2S DAC対応表を取り込みし、Javascriptの配列化しています。
(将来的に対応カードが判明した場合は配列にリストを加えれば対応出来ます。
また、配列をJSONファイルにすれば外部読み込み対応可能です)
・テキストボックスにカーネルドライバ名を直接入力もしくはリストから選択すると、
当該ドライバ名と同ドライバで動作するデバイス名称が下のCardに表で表示されます。
(dtoverlayにカンマ付きでオプションを指定していてもカード名で検索するので追従します。)
あとはチップセットも対応表の配列には入っていますので、
これまで分類して表示できればさらに良いかも(とりあえず、今回はここまでということで)。
config.txt.20191120.html.zip
<script>
var i2sc=[
{"d":"Sabreberry32","c":"ES9018Q2C","k":"sabreberry32"},
{"d":"Audiophonics ES9018 DAC","c":"ES9018K2M","k":"i-sabre-k2m"},
{"d":"Allo Boss DAC","c":"Burr Brown PCM5122","k":"allo-boss-dac-pcm512x-audio"},
{"d":"Allo DigiOne","c":"Cirrus Logic WM8805","k":"allo-digione"},
{"d":"Allo MiniBoss DAC","c":"Burr Brown PCM5122","k":"allo-boss-dac-pcm512x-audio"},
{"d":"Allo Piano 2.1 Hi-Fi DAC","c":"Burr Brown PCM5142","k":"allo-piano-dac-plus-pcm512x-audio"},
{"d":"Allo Piano Hi-Fi DAC","c":"Burr Brown PCM5122","k":"allo-piano-dac-pcm512x-audio"},
{"d":"Audiophonics ES9023 DAC","c":"ESS Sabre ES9023","k":"hifiberry-dac"},
{"d":"Audiophonics ES9023 DAC LTE","c":"ESS Sabre ES9023","k":"hifiberry-dac"},
{"d":"Audiophonics ES9023 DAC TXCO","c":"ESS Sabre ES9023","k":"hifiberry-dac"},
{"d":"Audiophonics ES9028 DAC","c":"ESS Sabre ES9028Q2M","k":"rpi-dac"},
{"d":"Audiophonics PCM5102 DAC","c":"Burr Brown PCM5102A","k":"hifiberry-dac"},
{"d":"Audiophonics PCM5122 DAC","c":"Burr Brown PCM5122","k":"hifiberry-dacplus"},
{"d":"Audiophonics TDA1387 DAC","c":"Philips TDA1387","k":"hifiberry-dac"},
{"d":"Buffalo I","c":"ESS Sabre ES9008","k":"rpi-dac"},
{"d":"Buffalo II/IIIse","c":"ESS Sabre ES9018","k":"rpi-dac"},
{"d":"DDDAC1794 NOS","c":"Burr Brown PCM1794","k":"rpi-dac"},
{"d":"DIAL-DAC","c":"Burr Brown PCM1793","k":"rpi-dac"},
{"d":"DIYINHK ES9023 DAC","c":"ESS Sabre ES9023","k":"hifiberry-dac"},
{"d":"Denafrips Pontus R2R DAC (I2S)","c":"Altera MAX II CPLD","k":"rpi-dac"},
{"d":"Dion Audio LOCO","c":"PCM5242 DAC","k":"dionaudio-loco"},
{"d":"Durio Sound PRO","c":"Burr Brown PCM5102A","k":"hifiberry-dac"},
{"d":"G2 Labs BerryNOS","c":"Philips TDA1543","k":"hifiberry-dac"},
{"d":"G2 Labs BerryNOS","c":" RedPhilips TDA1543","k":"hifiberry-dac"},
{"d":"HIFI DAC","c":"Burr Brown PCM5102A","k":"hifiberry-dac"},
{"d":"HIFI DAC+","c":"Burr Brown PCM5122","k":"hifiberry-dacplus"},
{"d":"HIFI Digi","c":"Wolfson WM8804G","k":"hifiberry-digi"},
{"d":"HIFI Digi+","c":"Wolfson WM8804G","k":"hifiberry-digi"},
{"d":"HiFiBerry Amp(Amp+)","c":"Burr Brown TAS5713","k":"hifiberry-amp"},
{"d":"HiFiBerry DAC","c":"Burr Brown PCM5102A","k":"hifiberry-dac"},
{"d":"HiFiBerry DAC+","c":"Burr Brown PCM5122","k":"hifiberry-dacplus"},
{"d":"HiFiBerry DAC+ Light","c":"ESS Sabre ES9023","k":"hifiberry-dac"},
{"d":"HiFiBerry DAC+ Pro","c":"Burr Brown PCM5122","k":"hifiberry-dacplus"},
{"d":"HiFiBerry Digi(Digi+)","c":"Cirrus Logic WM8804","k":"hifiberry-digi"},
{"d":"HiFiBerry Digi+ Pro","c":"Cirrus Logic WM8804","k":"hifiberry-digi-pro"},
{"d":"Hifimediy ES9023","c":"ESS Sabre ES9023","k":"hifiberry-dac"},
{"d":"IQaudIO Pi-AMP+","c":"Burr Brown TPA3118","k":"iqaudio-dacplus"},
{"d":"IQaudIO Pi-DAC","c":"Burr Brown PCM5122","k":"iqaudio-dac"},
{"d":"IQaudIO Pi-DAC PRO","c":"Burr Brown PCM5242","k":"iqaudio-dacplus"},
{"d":"IQaudIO Pi-DAC+","c":"Burr Brown PCM5122","k":"iqaudio-dacplus"},
{"d":"IQaudIO Pi-DACZero","c":"Burr Brown PCM5122","k":"iqaudio-dacplus"},
{"d":"IQaudIO Pi-Digi+","c":"Wolfson WM8804","k":"iqaudio-digi-wm8804-audio"},
{"d":"IQaudIO Pi-DigiAMP+","c":"Burr Brown TAS5756","k":"iqaudio-dacplus"},
{"d":"IanFIFO II","c":"Altera Max II CPLD","k":"hifiberry-dac"},
{"d":"JustBoom AMP HAT(Zero)","c":"Burr Brown TAS5756","k":"justboom-dac"},
{"d":"JustBoom DAC HAT(Zero)","c":"Burr Brown PCM5122 (PCM5121)","k":"justboom-dac"},
{"d":"JustBoom Digi HAT(Zero)","c":"Wolfson WM8804G","k":"justboom-digi"},
{"d":"Lucid Labs Raspberry Pi DAC","c":"Burr Brown PCM5102A","k":"hifiberry-dac"},
{"d":"Mamboberry HiFi DAC+","c":"ESS Sabre ES9032","k":"hifiberry-dac"},
{"d":"Mamboberry LS DAC+","c":"ESS Sabre ES9023p","k":"hifiberry-dac"},
{"d":"Pi2Design 503HTA Hybrid Tube Amp","c":"Burr Brown PCM5102A","k":"hifiberry-dac"},
{"d":"Pimoroni pHAT DAC","c":"Burr Brown PCM5102A","k":"hifiberry-dac"},
{"d":"PlainAMP","c":"Burr Brown TAS5756","k":"iqaudio-dacplus"},
{"d":"PlainDAC","c":"Burr Brown PCM5100","k":"hifiberry-dac"},
{"d":"PlainDAC+","c":"Burr Brown PCM5121","k":"hifiberry-dacplus"},
{"d":"PlainDSP","c":"Burr Brown PCM5121","k":"hifiberry-dacplus"},
{"d":"RPi-DAC","c":"Burr Brown PCM1794A","k":"rpi-dac"},
{"d":"RaspyPlay4","c":"Burr Brown PCM5122","k":"iqaudio-dac"},
{"d":"Red Rocks Audio DigiDAC1","c":"Wolfson WM8742 (DAC) WM8804 (S/PDIF)","k":"rra-digidac1-wm8741-audio"},
{"d":"SB32+PRO DoP","c":"ESS Sabre ES9218P","k":"hifiberry-dacplus"},
{"d":"Soekris DAM1021/1121 (I2S)","c":"FPGA based","k":"rpi-dac"},
{"d":"Suptronics x400","c":"Burr Brown PCM5122","k":"iqaudio-dacplus"},
{"d":"Terra-BerryDAC 2","c":"AK4490EQ","k":"hifiberry-dac"}
];
var ary1 = [];
var ary2 = [];
for (var i = 0, lmt = i2sc.length; i < lmt; i++) {
ary1.push(i2sc[i].k);
}
ary2 = removeArrayDuplicates(ary1);
var scd = document.getElementById('scard');
for (var i = 0, lmt = ary2.length; i < lmt; i++) {
var opt = document.createElement("option");
opt.value = ary2[i];
scd.appendChild(opt);
opt = null;
}
$('#i2s').attr('list', 'scard');
change();
function removeArrayDuplicates(array) {
var exist = {}, result = [];
for (var i = 0, l = array.length; i < l; i++) {
var tmp = array[i];
if (!exist[tmp]) {
exist[tmp] = true;
result.push(tmp);
}
}
return result;
}
function change() {
var flg = 0;
$('#k').text(' ');
$('#d').text(' ');
var sample = $('#i2s').val().split(',');
for(var i = 0, lmt = i2sc.length; i < lmt; i++) {
if (sample[0] === i2sc[i].k) {
if(flg === 0) {
$('#k').text(i2sc[i].k);
$('#d').text(i2sc[i].d);
} else {
$('#d').text($('#d').text() + ',' + i2sc[i].d);
}
flg++;
}
}
}
</script>
<form>
<label class="control-label">dtoverlay</label><br/>
<input id="i2s" class="config" type="text" uri="/boot/config.txt" key="dtoverlay" style="width:100%;" autocomplete="off" onfocut="change();" onkeyup="change();"/><br/>
<datalist id="scard">
</datalist>
</form>
<br/>
<table style="width:100%" border="1">
<tr><th>Driver</th><th>Card</th></tr>
<tr><td id="k"> </td><td id="d"> </td></tr>
</table>