Improve SDR device naming and fix airband audio display

- Show descriptive device names: RTL-SDR #0 (serial) instead of SDR 0
- Include last 4 digits of serial number for identification
- Add tooltip with full device name and serial
- Hide audio player element (no visible playback bar)
- Add debug logging for airband device selection

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-01-15 16:10:45 +00:00
parent 130bc8a51c
commit a891160f98
+15 -9
View File
@@ -274,7 +274,7 @@
</div>
</div>
</div>
<audio id="airbandPlayer" controls style="display: none; width: 100%; max-width: 300px; height: 32px; margin-top: 8px;"></audio>
<audio id="airbandPlayer" style="display: none;"></audio>
</div>
</main>
@@ -1947,21 +1947,27 @@ ACARS: ${r.statistics.acarsMessages} messages`;
} else {
devices.forEach((dev, i) => {
const idx = dev.index !== undefined ? dev.index : i;
const name = dev.name || dev.type || 'RTL-SDR';
const shortName = `SDR ${idx}`;
// Build descriptive label
const type = dev.sdr_type || dev.driver || 'RTL-SDR';
const typeName = type.toUpperCase().replace('RTLSDR', 'RTL-SDR');
const shortSerial = dev.serial ? ` (${dev.serial.slice(-4)})` : '';
const displayName = `${typeName} #${idx}${shortSerial}`;
const fullName = dev.name || `${typeName} Device ${idx}`;
const tooltip = `${fullName}${dev.serial ? ' - Serial: ' + dev.serial : ''}`;
// Add to ADS-B selector
const adsbOpt = document.createElement('option');
adsbOpt.value = idx;
adsbOpt.textContent = shortName;
adsbOpt.title = name;
adsbOpt.textContent = displayName;
adsbOpt.title = tooltip;
adsbSelect.appendChild(adsbOpt);
// Add to Airband selector
const airbandOpt = document.createElement('option');
airbandOpt.value = idx;
airbandOpt.textContent = shortName;
airbandOpt.title = name;
airbandOpt.textContent = displayName;
airbandOpt.title = tooltip;
airbandSelect.appendChild(airbandOpt);
});
@@ -2992,6 +2998,8 @@ sudo make install</code>
const device = parseInt(document.getElementById('airbandDeviceSelect').value);
const squelch = parseInt(document.getElementById('airbandSquelch').value);
console.log('[AIRBAND] Starting with device:', device, 'freq:', frequency, 'squelch:', squelch);
// Check if ADS-B tracking is using this device
if (isTracking && adsbActiveDevice !== null && device === adsbActiveDevice) {
const useAnyway = confirm(
@@ -3073,7 +3081,6 @@ sudo make install</code>
document.getElementById('airbandStatus').textContent = frequency.toFixed(3) + ' MHz';
document.getElementById('airbandStatus').style.color = 'var(--accent-green)';
document.getElementById('airbandVisualizerContainer').style.display = 'flex';
document.getElementById('airbandPlayer').style.display = 'block';
} catch (err) {
console.error('[AIRBAND] Error:', err);
@@ -3090,7 +3097,6 @@ sudo make install</code>
const audioPlayer = document.getElementById('airbandPlayer');
audioPlayer.pause();
audioPlayer.src = '';
audioPlayer.style.display = 'none';
fetch('/listening/audio/stop', { method: 'POST' })
.then(r => r.json())