From a170d9fd1953ef754c513b92b785711fcf6fa4ec Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Sat, 7 Jan 2023 08:35:34 +0100 Subject: [PATCH 01/20] First iteration --- Standards/CCSMB-5.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Standards/CCSMB-5.md diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md new file mode 100644 index 0000000..0c20f26 --- /dev/null +++ b/Standards/CCSMB-5.md @@ -0,0 +1,22 @@ +# CCSMB-5: Radio Transmissions +```md +*Author: Emma Beurskens <@emmaknijn>* +*Version: v1.0.0* +*Last updated: YYYY-MM-DD* +``` + +## Design +A client will only listen to packets while the audio is being transmitted from a server +The server will communicate to the client over modem + +## Packet +A packet consists of the following fields in a table: +- buffer: Signed 8-bit PCM @ 48kHz +- id: A random number that identifies the radio station +- stationName: The name of the radio station +- songName: The song that is currently being played + +A client must be able to accept the buffer field in order to be compliant +A server must be able to transmit all of the fields in order to be compliant +A server must time the packets appropriately in a way that the client is just able to play back the buffer in order to be compliant +A client must be able to deal with crosstalk \ No newline at end of file From 01afc241d6daf388d6c9fed2b4b4b230549cdc6e Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Sat, 7 Jan 2023 08:42:00 +0100 Subject: [PATCH 02/20] Change songName to be more generic --- Standards/CCSMB-5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md index 0c20f26..3136e4a 100644 --- a/Standards/CCSMB-5.md +++ b/Standards/CCSMB-5.md @@ -14,7 +14,7 @@ A packet consists of the following fields in a table: - buffer: Signed 8-bit PCM @ 48kHz - id: A random number that identifies the radio station - stationName: The name of the radio station -- songName: The song that is currently being played +- title: The song that is currently being played A client must be able to accept the buffer field in order to be compliant A server must be able to transmit all of the fields in order to be compliant From 08e8161a1a013acf247263c7b556f13aff8d19e7 Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Sat, 7 Jan 2023 08:49:20 +0100 Subject: [PATCH 03/20] Drop the id field --- Standards/CCSMB-5.md | 1 - 1 file changed, 1 deletion(-) diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md index 3136e4a..abd4a6a 100644 --- a/Standards/CCSMB-5.md +++ b/Standards/CCSMB-5.md @@ -12,7 +12,6 @@ The server will communicate to the client over modem ## Packet A packet consists of the following fields in a table: - buffer: Signed 8-bit PCM @ 48kHz -- id: A random number that identifies the radio station - stationName: The name of the radio station - title: The song that is currently being played From b8fab170b3503263a1a4c38874f00ce4d42e6d28 Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Sat, 7 Jan 2023 09:02:58 +0100 Subject: [PATCH 04/20] Add protocol field and clarify the types in the fields --- Standards/CCSMB-5.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md index abd4a6a..22d2001 100644 --- a/Standards/CCSMB-5.md +++ b/Standards/CCSMB-5.md @@ -11,9 +11,10 @@ The server will communicate to the client over modem ## Packet A packet consists of the following fields in a table: -- buffer: Signed 8-bit PCM @ 48kHz -- stationName: The name of the radio station -- title: The song that is currently being played +- buffer: A table that contains Signed 8-bit PCM @ 48kHz audio +- station: A string that contains the name of the radio station +- title: A string that contains the song that is currently being played +- protocol: A string that contains the protocol used (for example "CCSMB-5") A client must be able to accept the buffer field in order to be compliant A server must be able to transmit all of the fields in order to be compliant From a7a79e5469a8a523ec811fb313d398a4fedf6cea Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Sat, 7 Jan 2023 09:21:01 +0100 Subject: [PATCH 05/20] Enforce protocol to be CCSMB-5 --- Standards/CCSMB-5.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md index 22d2001..c0e4507 100644 --- a/Standards/CCSMB-5.md +++ b/Standards/CCSMB-5.md @@ -14,8 +14,9 @@ A packet consists of the following fields in a table: - buffer: A table that contains Signed 8-bit PCM @ 48kHz audio - station: A string that contains the name of the radio station - title: A string that contains the song that is currently being played -- protocol: A string that contains the protocol used (for example "CCSMB-5") +- protocol: A string that contains the protocol used +The protocol field must be "CCSMB-5" in order to be compliant A client must be able to accept the buffer field in order to be compliant A server must be able to transmit all of the fields in order to be compliant A server must time the packets appropriately in a way that the client is just able to play back the buffer in order to be compliant From 3445da9ac2b7b4b12ec4b2a12e6545cd7d6f5d81 Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Sat, 7 Jan 2023 11:37:45 +0100 Subject: [PATCH 06/20] Fix markdown formatting Co-authored-by: Erlend --- Standards/CCSMB-5.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md index c0e4507..8be78cf 100644 --- a/Standards/CCSMB-5.md +++ b/Standards/CCSMB-5.md @@ -1,9 +1,7 @@ # CCSMB-5: Radio Transmissions -```md *Author: Emma Beurskens <@emmaknijn>* *Version: v1.0.0* *Last updated: YYYY-MM-DD* -``` ## Design A client will only listen to packets while the audio is being transmitted from a server From 8ca7b64bee8af45b596fc1cef9cf8feb57059e5f Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Sat, 7 Jan 2023 11:41:45 +0100 Subject: [PATCH 07/20] Restructure compliancy and expand on crosstalk --- Standards/CCSMB-5.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md index 8be78cf..5603f57 100644 --- a/Standards/CCSMB-5.md +++ b/Standards/CCSMB-5.md @@ -14,8 +14,10 @@ A packet consists of the following fields in a table: - title: A string that contains the song that is currently being played - protocol: A string that contains the protocol used -The protocol field must be "CCSMB-5" in order to be compliant -A client must be able to accept the buffer field in order to be compliant -A server must be able to transmit all of the fields in order to be compliant -A server must time the packets appropriately in a way that the client is just able to play back the buffer in order to be compliant -A client must be able to deal with crosstalk \ No newline at end of file +In order to be compliant the +- protocol field must be "CCSMB-5" +- client must be able to accept the buffer field +- client must be able to deal with crosstalk by allowing the user to select a station if there are multiple stations on a single channel +- client must reject a packet with an invalid protocol field +- server must be able to transmit all of the fields +- server must time the packets appropriately in a way that the client is just able to play back the buffer \ No newline at end of file From bccaf859201becb5bcd329e5d84930d2d643412f Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Sun, 8 Jan 2023 07:30:36 +0100 Subject: [PATCH 08/20] Improve based on some reviews --- Standards/CCSMB-5.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md index 5603f57..b0b6108 100644 --- a/Standards/CCSMB-5.md +++ b/Standards/CCSMB-5.md @@ -7,17 +7,17 @@ A client will only listen to packets while the audio is being transmitted from a server The server will communicate to the client over modem + ## Packet A packet consists of the following fields in a table: -- buffer: A table that contains Signed 8-bit PCM @ 48kHz audio -- station: A string that contains the name of the radio station -- title: A string that contains the song that is currently being played -- protocol: A string that contains the protocol used +- `buffer`: A table that contains Signed 8-bit PCM @ 48kHz audio +- `id`: The ID of the server sending the message +- `station`: A string that contains the name of the radio station +- `title`: A string that contains the song that is currently being played, or other relevant metadata +- `protocol`: A string that contains the protocol used In order to be compliant the - protocol field must be "CCSMB-5" -- client must be able to accept the buffer field - client must be able to deal with crosstalk by allowing the user to select a station if there are multiple stations on a single channel -- client must reject a packet with an invalid protocol field -- server must be able to transmit all of the fields +- client must reject a packet with an invalid `protocol` field - server must time the packets appropriately in a way that the client is just able to play back the buffer \ No newline at end of file From aa863e19a314d87ea59c639842e69c80f6d78a71 Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Sun, 8 Jan 2023 13:04:26 +0100 Subject: [PATCH 09/20] Add port allocation --- Standards/CCSMB-5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md index b0b6108..ad7c12b 100644 --- a/Standards/CCSMB-5.md +++ b/Standards/CCSMB-5.md @@ -6,7 +6,7 @@ ## Design A client will only listen to packets while the audio is being transmitted from a server The server will communicate to the client over modem - +It is recommended that servers use channels 2048-4096 ## Packet A packet consists of the following fields in a table: From c5a8320e737890eeafa83cb232134339fd7d2895 Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Tue, 28 Feb 2023 08:43:32 +0000 Subject: [PATCH 10/20] Add a base for the discovery packet --- Standards/CCSMB-5.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md index ad7c12b..742a628 100644 --- a/Standards/CCSMB-5.md +++ b/Standards/CCSMB-5.md @@ -9,7 +9,7 @@ The server will communicate to the client over modem It is recommended that servers use channels 2048-4096 ## Packet -A packet consists of the following fields in a table: +An audio packet consists of the following fields in a table: - `buffer`: A table that contains Signed 8-bit PCM @ 48kHz audio - `id`: The ID of the server sending the message - `station`: A string that contains the name of the radio station @@ -20,4 +20,13 @@ In order to be compliant the - protocol field must be "CCSMB-5" - client must be able to deal with crosstalk by allowing the user to select a station if there are multiple stations on a single channel - client must reject a packet with an invalid `protocol` field -- server must time the packets appropriately in a way that the client is just able to play back the buffer \ No newline at end of file +- server must time the packets appropriately in a way that the client is just able to play back the buffer + +## Discovery +A discovery packet is sent over channel 759 and must contain the following fields in a table: +- `type`: The type of request + +The following fields are only for servers responding to a discovery packet +- `channel`: An integer that contains the modem channel of the radio station +- `station`: A string that contains the name of the radio station +- `title`: A string that contains the song that is currently being played, or other relevant metadata \ No newline at end of file From 2f87bec61dfbea51f5d0ef38e6e26e571f6e0086 Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Mon, 13 Mar 2023 17:01:57 +0100 Subject: [PATCH 11/20] Add a couple things that people requested --- Standards/CCSMB-5.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md index 742a628..4b2e951 100644 --- a/Standards/CCSMB-5.md +++ b/Standards/CCSMB-5.md @@ -6,16 +6,23 @@ ## Design A client will only listen to packets while the audio is being transmitted from a server The server will communicate to the client over modem -It is recommended that servers use channels 2048-4096 +All servers must be on seperate channels ## Packet An audio packet consists of the following fields in a table: - `buffer`: A table that contains Signed 8-bit PCM @ 48kHz audio - `id`: The ID of the server sending the message - `station`: A string that contains the name of the radio station -- `title`: A string that contains the song that is currently being played, or other relevant metadata +- `metadata`: A table that contains additional metadata - `protocol`: A string that contains the protocol used +The metadata can contain the following fields: +- `song`: A string that contains the song name, if one is being played, not required +- `artist`: A string that contains the song artist, if a song is being played, not required +- `owner`: A string that contains the station owner's (ingame or discord) username, not required +- `alternative`: A table that contains alternative station channels, with integers inside, not required + + In order to be compliant the - protocol field must be "CCSMB-5" - client must be able to deal with crosstalk by allowing the user to select a station if there are multiple stations on a single channel @@ -26,7 +33,12 @@ In order to be compliant the A discovery packet is sent over channel 759 and must contain the following fields in a table: - `type`: The type of request -The following fields are only for servers responding to a discovery packet +The following fields are required only for servers responding to a discovery packet - `channel`: An integer that contains the modem channel of the radio station - `station`: A string that contains the name of the radio station -- `title`: A string that contains the song that is currently being played, or other relevant metadata \ No newline at end of file +- `metadata`: The metadata that is also sent with an audio packet +- `protocol`: A string that contains the protocol used + +In order to be compliant the +- protocol field must be "CCSMB-5" +- client must set the `type` field to `discovery` if they intend to request servers \ No newline at end of file From 1b026dd79c001d36c55f26b7d3d2f80ae6bfb88c Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Thu, 26 Oct 2023 16:53:51 +0200 Subject: [PATCH 12/20] Add reference to RFC 2119 --- Standards/CCSMB-5.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md index 4b2e951..b78e04d 100644 --- a/Standards/CCSMB-5.md +++ b/Standards/CCSMB-5.md @@ -5,9 +5,13 @@ ## Design A client will only listen to packets while the audio is being transmitted from a server + The server will communicate to the client over modem + All servers must be on seperate channels +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119. + ## Packet An audio packet consists of the following fields in a table: - `buffer`: A table that contains Signed 8-bit PCM @ 48kHz audio From eb04510e427a21a2b791536a04030efc10628f33 Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Thu, 26 Oct 2023 16:55:53 +0200 Subject: [PATCH 13/20] Add clarification for the packet timing --- Standards/CCSMB-5.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md index b78e04d..daaeb8d 100644 --- a/Standards/CCSMB-5.md +++ b/Standards/CCSMB-5.md @@ -32,6 +32,7 @@ In order to be compliant the - client must be able to deal with crosstalk by allowing the user to select a station if there are multiple stations on a single channel - client must reject a packet with an invalid `protocol` field - server must time the packets appropriately in a way that the client is just able to play back the buffer +- The server must wait exactly as long as the piece of audio being sent when timing the packets, if this doesn't happen the audio might skip or stutter on the client ## Discovery A discovery packet is sent over channel 759 and must contain the following fields in a table: From 51228238641b9c7703b4c4ef98b821633fb8702a Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Thu, 26 Oct 2023 16:56:31 +0200 Subject: [PATCH 14/20] Change title --- Standards/CCSMB-5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md index daaeb8d..b3d87af 100644 --- a/Standards/CCSMB-5.md +++ b/Standards/CCSMB-5.md @@ -1,4 +1,4 @@ -# CCSMB-5: Radio Transmissions +# CCSMB-5: PCM Audio Transmissions over modem *Author: Emma Beurskens <@emmaknijn>* *Version: v1.0.0* *Last updated: YYYY-MM-DD* From 70dba1ff93db691c56f84ad5b0db32466a03dd5c Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Thu, 26 Oct 2023 17:00:00 +0200 Subject: [PATCH 15/20] Change the protocol name to PASC --- Standards/CCSMB-5.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md index b3d87af..1a8e70e 100644 --- a/Standards/CCSMB-5.md +++ b/Standards/CCSMB-5.md @@ -10,6 +10,8 @@ The server will communicate to the client over modem All servers must be on seperate channels +PASC refers to "Protocol for Audio Streaming in Computercraft" + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119. ## Packet @@ -28,7 +30,7 @@ The metadata can contain the following fields: In order to be compliant the -- protocol field must be "CCSMB-5" +- protocol field must be "PASC" - client must be able to deal with crosstalk by allowing the user to select a station if there are multiple stations on a single channel - client must reject a packet with an invalid `protocol` field - server must time the packets appropriately in a way that the client is just able to play back the buffer @@ -45,5 +47,5 @@ The following fields are required only for servers responding to a discovery pac - `protocol`: A string that contains the protocol used In order to be compliant the -- protocol field must be "CCSMB-5" +- protocol field must be "PASC" - client must set the `type` field to `discovery` if they intend to request servers \ No newline at end of file From 779b4e916cb608dccecba650a54facf4203dba1b Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Thu, 26 Oct 2023 17:01:41 +0200 Subject: [PATCH 16/20] Grammatical changes --- Standards/CCSMB-5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md index 1a8e70e..e12ca40 100644 --- a/Standards/CCSMB-5.md +++ b/Standards/CCSMB-5.md @@ -43,7 +43,7 @@ A discovery packet is sent over channel 759 and must contain the following field The following fields are required only for servers responding to a discovery packet - `channel`: An integer that contains the modem channel of the radio station - `station`: A string that contains the name of the radio station -- `metadata`: The metadata that is also sent with an audio packet +- `metadata`: The same metadata that is also sent with an audio packet - `protocol`: A string that contains the protocol used In order to be compliant the From 2d2b02f5ee94f85bf0d8079cd437f52c3d674de0 Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Thu, 26 Oct 2023 17:08:43 +0200 Subject: [PATCH 17/20] Grammatical fix --- Standards/CCSMB-5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md index e12ca40..f4071c6 100644 --- a/Standards/CCSMB-5.md +++ b/Standards/CCSMB-5.md @@ -34,7 +34,7 @@ In order to be compliant the - client must be able to deal with crosstalk by allowing the user to select a station if there are multiple stations on a single channel - client must reject a packet with an invalid `protocol` field - server must time the packets appropriately in a way that the client is just able to play back the buffer -- The server must wait exactly as long as the piece of audio being sent when timing the packets, if this doesn't happen the audio might skip or stutter on the client +- server must wait exactly as long as the piece of audio being sent when timing the packets, if this doesn't happen the audio might skip or stutter on the client ## Discovery A discovery packet is sent over channel 759 and must contain the following fields in a table: From f6179e09fa6708930db2139a222401aac7769459 Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Thu, 26 Oct 2023 17:10:07 +0200 Subject: [PATCH 18/20] Recommendation on packet length --- Standards/CCSMB-5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md index f4071c6..9a07edf 100644 --- a/Standards/CCSMB-5.md +++ b/Standards/CCSMB-5.md @@ -34,7 +34,7 @@ In order to be compliant the - client must be able to deal with crosstalk by allowing the user to select a station if there are multiple stations on a single channel - client must reject a packet with an invalid `protocol` field - server must time the packets appropriately in a way that the client is just able to play back the buffer -- server must wait exactly as long as the piece of audio being sent when timing the packets, if this doesn't happen the audio might skip or stutter on the client +- server must wait exactly as long as the piece of audio being sent when timing the packets, if this doesn't happen the audio might skip or stutter on the client. The recommended amount for a single packet is about 2.5 seconds ## Discovery A discovery packet is sent over channel 759 and must contain the following fields in a table: From 05e49600f5516828fd4228bc4bebee5976105cea Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Fri, 29 Mar 2024 07:40:41 +0100 Subject: [PATCH 19/20] Add multiple channels, clean up some stuff, add example packet --- Standards/CCSMB-5.md | 57 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 11 deletions(-) diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md index 9a07edf..e864e6e 100644 --- a/Standards/CCSMB-5.md +++ b/Standards/CCSMB-5.md @@ -1,4 +1,4 @@ -# CCSMB-5: PCM Audio Transmissions over modem +# CCSMB-5: PCM Audio Transmissions over modem (PASC) *Author: Emma Beurskens <@emmaknijn>* *Version: v1.0.0* *Last updated: YYYY-MM-DD* @@ -16,25 +16,60 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "S ## Packet An audio packet consists of the following fields in a table: -- `buffer`: A table that contains Signed 8-bit PCM @ 48kHz audio +- `buffer`: A table that contains up to 8 tables of signed 8-bit PCM @ 48kHz audio - `id`: The ID of the server sending the message - `station`: A string that contains the name of the radio station - `metadata`: A table that contains additional metadata - `protocol`: A string that contains the protocol used -The metadata can contain the following fields: + +The metadata MAY contain the following fields: - `song`: A string that contains the song name, if one is being played, not required - `artist`: A string that contains the song artist, if a song is being played, not required -- `owner`: A string that contains the station owner's (ingame or discord) username, not required -- `alternative`: A table that contains alternative station channels, with integers inside, not required +- `owner`: A string that contains the station owner's (ingame or discord) username. The discord username should start with an @ to identify it from an ingame username, not required +- `album`: A string that contains the name of the album the song is in, not required +- `alternative`: A table that contains alternative station channels, with integers, inside, not required + +A valid packet should look like this. Being transmitted on channel `5836` with replyChannel `759` + +```lua +{ + buffer = { + {... PCM DATA ...}, + {... PCM DATA ...} + }, + id = 1234, + station = "Knijn Radio", + protocol = "PASC", + metadata = { + song = "BOOWOMP", + artist = "Ditorism", + album = "BATTERY ACID", + owner = "@emmaknijn", + alternative = {5836, 5837, 7956} + } +} +``` In order to be compliant the -- protocol field must be "PASC" -- client must be able to deal with crosstalk by allowing the user to select a station if there are multiple stations on a single channel -- client must reject a packet with an invalid `protocol` field -- server must time the packets appropriately in a way that the client is just able to play back the buffer -- server must wait exactly as long as the piece of audio being sent when timing the packets, if this doesn't happen the audio might skip or stutter on the client. The recommended amount for a single packet is about 2.5 seconds +- protocol field MUST be "PASC" +- client MUST be able to deal with crosstalk by allowing the user to select a station if there are multiple stations on a single channel +- client MUST reject a packet with an invalid `protocol` field +- server MUST include all broadcasting channels in the `metadata.alternative` field (including the channel the packet is being sent on), except if no `metadata.alternative` field is provided. +- server MUST time the packets appropriately in a way that the client is just able to play back the buffer. +- server MUST wait exactly as long as the piece of audio being sent when timing the packets, if this doesn't happen the audio might skip or stutter on the client. The recommended amount for a single packet is about 2.5 seconds +- client MUST be able to support 2 audio channels and MAY be able to support 3-8 audio channels. +- server MUST order the first 2 audio channels of the buffer to + ``` + buffer[1] = leftChannel, + buffer[2] = rightChannel + ``` +- client MUST play back the first buffer as the left channel, and the second buffer as the right channel +- client SHOULD mix audio channels 1 and 2 together if there is only 1 speaker connected +- client SHOULD copy audio channel 1 to the left and right audio channel if there are two speakers connected + +The other audio channels are free to be assigned to whatever is desired ## Discovery A discovery packet is sent over channel 759 and must contain the following fields in a table: @@ -48,4 +83,4 @@ The following fields are required only for servers responding to a discovery pac In order to be compliant the - protocol field must be "PASC" -- client must set the `type` field to `discovery` if they intend to request servers \ No newline at end of file +- client must set the `type` field to `discovery` if they intend to request stations From 953963f54e9f650f99439babce01278b68c6d36e Mon Sep 17 00:00:00 2001 From: EmmaKnijn <64010592+EmmaKnijn@users.noreply.github.com> Date: Fri, 29 Mar 2024 07:47:36 +0100 Subject: [PATCH 20/20] Enforce 759 for replyChannel --- Standards/CCSMB-5.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Standards/CCSMB-5.md b/Standards/CCSMB-5.md index e864e6e..cd71c44 100644 --- a/Standards/CCSMB-5.md +++ b/Standards/CCSMB-5.md @@ -51,10 +51,10 @@ A valid packet should look like this. Being transmitted on channel `5836` with r } ``` - In order to be compliant the - protocol field MUST be "PASC" - client MUST be able to deal with crosstalk by allowing the user to select a station if there are multiple stations on a single channel +- server MUST set the replyChannel to 759, the discovery channel - client MUST reject a packet with an invalid `protocol` field - server MUST include all broadcasting channels in the `metadata.alternative` field (including the channel the packet is being sent on), except if no `metadata.alternative` field is provided. - server MUST time the packets appropriately in a way that the client is just able to play back the buffer. @@ -72,7 +72,7 @@ In order to be compliant the The other audio channels are free to be assigned to whatever is desired ## Discovery -A discovery packet is sent over channel 759 and must contain the following fields in a table: +A discovery packet MUST be sent over channel 759 and MUST contain the following fields in a table: - `type`: The type of request The following fields are required only for servers responding to a discovery packet