Commit Graph

4155 Commits

Author SHA1 Message Date
trekhopton 2cb5475959 Merge branch 'master' into treat-make 2024-05-03 14:58:16 +09:30
Trek Hopton 9f56bee095 cmd/treatment: remove build tags for treatment
This was done because I don't know why this wouldn't build on circleci with the standard pi audio command in pi.go.

cmd/treatment: merge pi.go into main.go

There's no need for two files

Approved-by: Alan Noble
2024-04-17 07:17:57 +00:00
trekhopton 1f5bd11a99 cmd/treatment: customise makefile and put install files in directory
This is to make the makefile in init less complicated.
2024-04-17 16:26:30 +09:30
Saxon Milton 2dd2c464c6 Simplify createOrUpdate method
Every time we want to create or update, let's just start a new
revid pipeline. Now that our frequency of requests to vidforward
to create or update are much lower (because of the new state
machine) we can deal with the overhead of creating a new pipeline
and reduce the complexity of the code.

Approved-by: Trek Hopton
2024-04-10 22:17:40 +00:00
trekhopton 34097ae91a Merge branch 'treat-pi' into treat-make 2024-04-10 16:24:02 +09:30
trekhopton b5703a88fe cmd/treatment: remove circleci tag
This was done because I don't know why this wouldn't build on circleci with the standard pi audio command in pi.go.
2024-04-10 16:14:55 +09:30
trekhopton 4747b800c7 cmd/treatment: straight copy of init/Makefile
This commit is made so that modifications to this file to strip out the rv related stuff can be tracked.
2024-04-10 16:06:00 +09:30
trekhopton 48051e5d76 cmd/treatment: change pi3 build tags to pi
This is done because we will use the pi zero to drive the speakers for treatment
2024-04-10 15:26:13 +09:30
Saxon Milton b992358fd6 Recover control request panics
When running a go service, especially as a background systemd
service, it's not obvious when there is a panic in a handler, so
we're now recovering any panics on our level and logging.

Approved-by: Alan Noble
2024-04-07 11:48:15 +00:00
Saxon Milton d519f50fe5 Return from Noop lex routine
In the Noop lexer we start a routine that's responsible for output
of the written frames at a consistent rate (to make certain
destinations happy i.e. youtube). We weren't however returning
from this in the case that the lexing function is returned, we'd
therefore then be left with a hanging routine (this would
eventually keep happening until stack overflow if had long enough
runtime for the service; not a big deal for systemd services, but
still crappy). So, now we create a context which is cancelled when
when the lex function returns and can detect this in the output
routine.

Approved-by: Alan Noble
2024-04-07 11:47:31 +00:00
Saxon Milton d4af5c0194 Always try closing manual input reader
Approved-by: Alan Noble
2024-04-07 11:46:27 +00:00
Saxon Milton 66a1687316 Print stacktrace in questionable situations
It would be useful to see what the stack looks like when we get
consecutive watchdog patting failures. We can then try to work out
what's ultimately causing this issue.

Approved-by: Trek Hopton
2024-04-07 20:19:59 +09:30
Saxon Nelson-Milton a40faaa23e Increase debug logging 2024-04-07 00:48:40 +00:00
David Sutton 391db6b210 Merged in 441-fix-check-samplerate (pull request #533)
alsa: Fix sample rate negotiation (#441)

Approved-by: Trek Hopton
2024-02-29 04:54:52 +00:00
David Sutton c8f846f87d alsa: Fix sample rate negotiation (#441)
This change fixes the sample rate negotiation functionality, by making a comparison against the value of the slice and not the index.
2024-02-29 15:20:42 +10:30
Trek Hopton 839188d808 Bump iot 142
go mod tidy
2024-02-20 02:54:33 +00:00
David Sutton 262e5fb5b4 Merged in 441-fix-check-samplerate (pull request #532)
audio-netsender: Fix sample rate validation

* audio-netsender: Fix sample rate validation

This change makes a simple change that makes the function compare the requested sample rate against the valid rates instead of the indices of the valid rates.


Approved-by: Alan Noble
2024-02-09 06:28:45 +00:00
David Sutton 60e208fdab Merged in wav-format-converter (pull request #530)
codec/wav: Add type conversion map for wav encoding type.

Approved-by: Trek Hopton
2024-01-29 01:23:28 +00:00
David Sutton a26983c8f3 codec/wav: Add type conversion map for wav encoding type. 2024-01-29 11:52:49 +10:30
Alan Noble 268b253389 Shutdown mode
Approved-by: Saxon Milton
2023-12-15 05:12:28 +00:00
David Sutton 578e60823b codec/wav: Implement a wav encoder
A wav encoder will be useful for returning easily playable audio files to users of vidgrind that are not familiar with PCM audio. Currently the encoder only support PCM data, but can be updated with other types. The encoder implements the writer interface.

* codec/wav: Add unit tests for wav encoder

Merged in create-wav-encoder (pull request #529)
Approved-by: Trek Hopton
2023-12-04 00:36:29 +00:00
Trek Hopton 19b696683b cmd: add program for unwrapping MTS media to a local file
This is useful in the case that we want to playback media using players that don't support MPEG-TS eg. audacity for audio.

Approved-by: Saxon Milton
2023-11-30 03:52:25 +00:00
Alan Noble 59bf9d15a8 Include PID in mts.FindPid error
Approved-by: Trek Hopton
Approved-by: David Sutton
2023-11-12 06:42:45 +00:00
David Sutton d9301fe40c file_test.go: Update Tests (#421)
(b *Broadcast) UnmarshalJSON no longer starts revid (see PR #510).

(m *BroadcastManager) MarshalJSON no longer needs to worry about slate exit signals due to broadcast status (see PR #511).

Merged in 421-fix-JSON-marshalling (pull request #528)
Approved-by: Saxon Milton
2023-10-20 08:27:06 +00:00
Trek Hopton d0cca977f5 scripts/wifi-off-delay: turn wifi off after 20 minutes regardless of connection
This is done so that a SCUHU users can see the pi IP address has connected to their hotspot without having to then log in via SSH to turn the wifi off before deployment.


Approved-by: David Sutton
2023-10-20 06:25:10 +00:00
Trek Hopton ba550e286a SCUHU: configure SCUHU and add services and scripts to run at startup on pi
This is so that the software required for SCUHU will run at startup on the pi.

Approved-by: Alan Noble
Approved-by: Saxon Milton
2023-10-20 03:49:55 +00:00
Trek Hopton a266587397 revid: added basic disk and file size checking
* revid: reordered the file write method to exit earlier and remove a flag that wasn't needed
* revid: add comments to MaxFileSize to specify that it is in bytes

Approved-by: Alan Noble
Approved-by: Saxon Milton
2023-10-20 03:29:36 +00:00
Alan Noble a2aaa605fd Merged in enable-mts-timestamps (pull request #522)
Enable MTS timestamps with audio input

* Enable MTS timestamps with audio input.


Approved-by: Saxon Milton
2023-10-19 23:11:20 +00:00
Trek Hopton 3bb8d0bde2 exp/rvcl: remove nil option from netsender
This was a programmer's mistake.

Approved-by: Alan Noble
2023-10-18 07:49:11 +00:00
Trek H 9131409d08 exp/rvcl: remove nil option from netsender 2023-10-17 20:12:58 +10:30
Saxon Milton 524e010fe1 * vidforward: actually set revid pipeline
We need to actually get the returned value from
initOrStartPipeline and set the pipeline.

* vidforward: add some logging to config load

* vidforward: update utils version

Approved-by: Alan Noble
Approved-by: Trek Hopton
2023-10-14 00:49:42 +00:00
Saxon Milton c98fffe722 revid: fix manual input reader and writer
The reader and writer pipes should be created on call to Start
and not in NewManualInput. This is so that if Close is called,
which will close the reader and the writer, a call to start will
create them again.

Approved-by: Alan Noble
Approved-by: David Sutton
2023-10-14 00:34:08 +00:00
Saxon Milton 072f069d1a Merged in init-or-start (pull request #514)
vidforward: initOrStartPipeline

This function checks whether a revid pipeline has been created,
and if not creates it. It then also checks to see if it has been
started, and if not, starts the pipeline.
2023-10-14 00:32:10 +00:00
David Sutton 5761f81315 Skip senders tests in CI - Resolves #413
Using a env var in CircleCI, these tests will be skipped when commits are pushed to bitbucket.
NOTE: this is a temporary patch, and these tests should be properly reviewed.

Approved-by: Trek Hopton
2023-10-09 08:02:38 +00:00
Trek Hopton 14482e8945 init: check if build tags exist before running go build
Resolves issue #415
2023-10-03 07:52:52 +00:00
Saxon Nelson-Milton 4587f31c42 vidforward: remove run_script from create_service.sh
We no longer use a run script; the vidforward executable is started
directly from the service.
2023-09-20 21:59:35 +00:00
Saxon Nelson-Milton 79d3e7280b vidforward: Remove RUN_SCRIPT_DIR parameter from Makefile
This is no longer needed considering there's no longer a run
script; instead we call the binary directly in the service file.
2023-09-20 21:57:36 +00:00
Saxon Nelson-Milton e4263464ef vidforward: remove reference to non-existent run.sh file
This file used to be used for startup, but now we just start the
process directly in the service. It probably existed in the dir
last time this was tested so no errors were thrown, but on a clean
install this was a problem.
2023-09-20 21:57:18 +00:00
Saxon Milton 19eafa3228 vidforward: save manager state at end of process request
As added redundancy, let's save the manager state at the end of
the process request method as well.
2023-09-20 21:25:04 +00:00
Saxon Nelson-Milton 1621dc709b vidforward: add SIGKILL to signal.Notify for term callback
Just for further redundancy, let's also call the termination
callback (which saves the manager state in our case) for SIGKILL.
2023-09-19 10:47:10 +00:00
Saxon Milton da9ed6d689 vidforward: getPipeline handles revid creation and start
It simplifies things if getPipeline handles creation and starting
of the revid pipeline. We don't need to be doing this in multiple
places.

Approved-by: Trek Hopton
2023-09-18 23:28:51 +00:00
Saxon Milton 4087be907a vidforward: simplify manager file save/load
When saving and loading manager state to and from file, we don't
need to worry about the slate exit signals. Now that we have
broadcast status i.e. "play" or "slate", we can derive whether we
need an exit signal based only on that.

Approved-by: Trek Hopton
2023-09-18 23:25:28 +00:00
Saxon Nelson-Milton db84c5bfcf Use correct log level global variable 2023-09-17 23:16:30 +00:00
Saxon Nelson-Milton 16df4ed2aa Add more logging to createOrUpdate function
It'd be useful to see more of what's going on in here.
2023-09-17 11:03:30 +00:00
Trek Hopton a978e27e4f Merged in withcv-fix (pull request #509)
filter: change build tags to allow build withcv

Resolves Issue #412
2023-09-06 09:00:14 +00:00
Trek H 0ab1e7c38f filter: change build tags to allow build withcv 2023-09-06 18:27:55 +09:30
Saxon Milton a3c526b2e0 Merged in fix-rtmpurl-variable-load (pull request #508)
revid: Don't append Config.RTMPURL

Resolves issue #409
2023-07-24 22:57:14 +00:00
Saxon Nelson-Milton 79b0a49994 revid: don't append Config.RTMPURL
Config.RTMPURL was being appended when updated, which means that
it would just continue to grow, and by the time we actually try
to use the RTMP URLs that are stored, we end up using old ones.
Instead this should just be completely replaced.
2023-07-16 06:49:49 +00:00
David Sutton 47b2b1576f Merged in issue-399-software-channels (pull request #502)
Software Channels

Approved-by: Trek Hopton
2023-07-10 01:30:31 +00:00
David Sutton bbbd6baecb Better handle errors in setChannels 2023-07-10 10:35:17 +09:30