diff --git a/package.json b/package.json index 597c07f..6bc1bdb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fm-dx-webserver", - "version": "1.3.6", + "version": "1.3.6.1", "description": "FM DX Webserver", "main": "index.js", "scripts": { diff --git a/server/datahandler.js b/server/datahandler.js index 7467ab6..eac6735 100644 --- a/server/datahandler.js +++ b/server/datahandler.js @@ -206,7 +206,6 @@ const updateInterval = 75; var dataToSend = { pi: '?', freq: 87.500.toFixed(3), - prevFreq: 87.500.toFixed(3), sig: 0, sigRaw: '', sigTop: -Infinity, diff --git a/server/server_config.js b/server/server_config.js index ac72500..1be8796 100644 --- a/server/server_config.js +++ b/server/server_config.js @@ -43,6 +43,7 @@ let serverConfig = { audioDevice: "Microphone (High Definition Audio Device)", audioChannels: 2, audioBitrate: "128k", + audioBoost: false, softwareMode: false, startupVolume: "0.95" }, diff --git a/server/stream/index.js b/server/stream/index.js index 9979df9..32961a4 100644 --- a/server/stream/index.js +++ b/server/stream/index.js @@ -9,7 +9,7 @@ function enableAudioStream() { const flags = `-fflags +nobuffer+flush_packets -flags low_delay -rtbufsize 6192 -probesize 32`; const codec = `-acodec pcm_s16le -ar 48000 -ac ${serverConfig.audio.audioChannels}`; - const output = `-f s16le -fflags +nobuffer+flush_packets -packetsize 384 -flush_packets 1 -bufsize 960`; + const output = `${serverConfig.audio.audioBoost == true ? '$-af "volume=3.5"' : ''} -f s16le -fflags +nobuffer+flush_packets -packetsize 384 -flush_packets 1 -bufsize 960`; if (process.platform === 'win32') { // Windows diff --git a/server/tx_search.js b/server/tx_search.js index 895790f..38220e5 100644 --- a/server/tx_search.js +++ b/server/tx_search.js @@ -7,6 +7,8 @@ let lastFetchTime = 0; const fetchInterval = 1000; const esSwitchCache = {"lastCheck":0, "esSwitch":false}; const esFetchInterval = 300000; +var currentPiCode = ''; +var currentRdsPs = ''; const usStatesGeoJsonUrl = "https://raw.githubusercontent.com/PublicaMundi/MappingAPI/master/data/geojson/us-states.json"; let usStatesGeoJson = null; // To cache the GeoJSON data for US states @@ -73,7 +75,11 @@ async function fetchTx(freq, piCode, rdsPs) { if (isNaN(freq)) { return; } - if (now - lastFetchTime < fetchInterval || serverConfig.identification.lat.length < 2 || freq < 87) { + if (now - lastFetchTime < fetchInterval + || serverConfig.identification.lat.length < 2 + || freq < 87 + || (currentPiCode == piCode && currentRdsPs == rdsPs)) + { return Promise.resolve(); } @@ -90,7 +96,7 @@ async function fetchTx(freq, piCode, rdsPs) { if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`); const data = await response.json(); cachedData[freq] = data; - await loadUsStatesGeoJson(); + if(serverConfig.webserver.rdsMode == true) await loadUsStatesGeoJson(); return processData(data, piCode, rdsPs); } catch (error) { console.error("Error fetching data:", error); @@ -106,6 +112,8 @@ async function processData(data, piCode, rdsPs) { let maxDistance; let esMode = checkEs(); let detectedByPireg = false; + currentPiCode = piCode; + currentRdsPs = rdsPs; function evaluateStation(station, city, distance) { let weightDistance = distance.distanceKm; diff --git a/web/css/helpers.css b/web/css/helpers.css index 6f846f2..9eae422 100644 --- a/web/css/helpers.css +++ b/web/css/helpers.css @@ -305,7 +305,7 @@ table .input-text { .hide-phone { display: none; } - .m-0 { + .m-0, .center-phone { margin: auto !important; } } diff --git a/web/css/main.css b/web/css/main.css index aa4a554..d4a4a60 100644 --- a/web/css/main.css +++ b/web/css/main.css @@ -105,6 +105,10 @@ a:hover { border-bottom: 1px solid var(--color-4); } +a.hide-underline:hover { + border-bottom: none; +} + hr { color: var(--color-4); } diff --git a/web/index.ejs b/web/index.ejs index 21887ed..45b3112 100644 --- a/web/index.ejs +++ b/web/index.ejs @@ -345,7 +345,8 @@
-This option will boost the audio volume globally, recommended for the Headless TEF.
+ <%- include('_components', {component: 'checkbox', cssClass: '', label: 'Audio Boost', id: 'audio-audioBoost'}) %> +If you use an USB audio card on Linux, enabling this option might fix your audio issues.
<%- include('_components', {component: 'checkbox', cssClass: '', label: 'ALSA Software mode', id: 'audio-softwareMode'}) %>When you become a FMDX.org supporter, you can host your webserver without the need of a public IP address.
+
When you become an FMDX.org supporter, you can host your webserver without the need of a public IP address & port forwarding.
When you become a supporter, you can message the Founders on Discord for your login details.