diff --git a/README.md b/README.md index ce90b65..8a8e22b 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ first, the normal args, like `pifmrds -arg argtoarg?`
`-rawchannels` - change the sample rate if raw
`-rawsamplerate` - same stuff but sample rate
`-cutofffreq` - fm broadcast uses a cut off freq around 16-18 khz, to avoid interferance with the 19khz stereo pilot
-`-audiogain` - audio too loud or too quiet? use this, this defines how many times the audio can be, here pass in int, but you can pass in `GAI {float}` on the fifo pipe (dont ask)
+`-audiogain` - audio too loud or too quiet? use this, this defines how many times the audio can be
`-power` - for now works only for rpi3, but you can change the code very easy to fix it for your pi
`-disablerds` - same arg as bfr, pass this in and no rds anymore
`-disablecompressor` - same as bfr, dont pass this please, DO NOT
@@ -168,6 +168,7 @@ now you know what you can pass as the args to the program, but theres a pipe sti `COA` - change compressor attack
`RDV` - gain but not audio but rds gain
`PAU` - pause, kinda, it will cancel out any audio, you could use `GAI 0` but you could forgor the old gain value, right?
+`PIV` - gain but not audio or rds but stereo pilot gain

and thats all, and remember kids dont pirate diff --git a/src/pifmrds/control_pipe.c b/src/pifmrds/control_pipe.c index 1f65bc5..2682e4b 100644 --- a/src/pifmrds/control_pipe.c +++ b/src/pifmrds/control_pipe.c @@ -187,6 +187,12 @@ ResultAndArg poll_control_pipe() { if(togg) printf("ON\n"); else printf("OFF\n"); resarg.res = CONTROL_PIPE_PAUSE_SET; resarg.arg_int = togg; + } else if(fifo[0] == 'P' && fifo[1] == 'I' && fifo[2] == 'V') { + printf("Set Stereo Pilot Volume to "); + printf(arg); + printf("\n"); + resarg.res = CONTROL_PIPE_PILVOL_SET; + resarg.arg = arg; } } return resarg; diff --git a/src/pifmrds/control_pipe.h b/src/pifmrds/control_pipe.h index d79c5df..7e019f3 100644 --- a/src/pifmrds/control_pipe.h +++ b/src/pifmrds/control_pipe.h @@ -23,6 +23,7 @@ #define CONTROL_PIPE_CT_SET 16 #define CONTROL_PIPE_RDSVOL_SET 17 #define CONTROL_PIPE_PAUSE_SET 18 +#define CONTROL_PIPE_PILVOL_SET 19 //fitting typedef struct { int res; diff --git a/src/pifmrds/pi_fm_rds.cpp b/src/pifmrds/pi_fm_rds.cpp index 793c845..57e2711 100644 --- a/src/pifmrds/pi_fm_rds.cpp +++ b/src/pifmrds/pi_fm_rds.cpp @@ -223,6 +223,8 @@ int tx(uint32_t carrier_freq, char *audio_file, uint16_t pi, char *ps, char *rt, rds_volume = std::stof(pollResult.arg); } else if(pollResult.res == CONTROL_PIPE_PAUSE_SET) { paused = pollResult.arg_int; + } else if(pollResult.res == CONTROL_PIPE_PILVOL_SET) { + pilot_volume = std::stof(pollResult.arg); } }