zelloptt / zello-channel-api

WebSocket-based API and SDKs to connect to Zello channels (BETA)
MIT License
86 stars 34 forks source link

Getting "Failed to create Zello audio stream" error on sending start_stream command #119

Open tedtally opened 3 years ago

tedtally commented 3 years ago

I'm trying to run the Github version of the python example. I created the account, the token and a channel that calls another account I have setup. When running the example I receive the "Failed to create Zello audio stream" error when the code calls the start_stream command. I added a print call to see what the ws response looks like and I got this:

{"command":"on_channel_status","channel":"XXXXXXX","status":"online","users_online":2,"images_supported":true,"texting_supported":true,"locations_supported":true} instead of the start_stream response. Has anyone come across this issue?

ihorserba commented 3 years ago

Hi Ted,

Do you face with this issue all the time or just once? Could you please provide:

The json {"command":"on_channel_status","channel":"XXXXXXX","status":"online","users_online":2,"images_supported":true,"texting_supported":true,"locations_supported":true} is sent by Zello server as a response on successful login and should be handled by authenticate() function, not zello_stream_start()

tedtally commented 3 years ago

I am faced with this issue every time whether via Python , C# or Js at the same exact point where start_stream is being called. I am using the exact codebase from the github repo in examples with my specific config information in the .conf file. I didn't change the codebase except for an occasional print() method in the python version. The Zello Server never replaces the request from the previous authentic() call.

On Thu, Nov 5, 2020 at 1:13 AM Ihor notifications@github.com wrote:

Hi Ted,

Do you face with this issue all the time or just once? Could you please provide:

  • the full log
  • the patch with the changes you have used in order to debug

The json

{"command":"on_channel_status","channel":"XXXXXXX","status":"online","users_online":2,"images_supported":true,"texting_supported":true,"locations_supported":true} is sent by Zello server as a response on successful login and should be handled by authenticate() function, not zello_stream_start()

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zelloptt/zello-channel-api/issues/119#issuecomment-722166034, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAW6YUXTKZ4Y7M5WPDBRK3SOI7AHANCNFSM4TKPIA6A .

ihorserba commented 3 years ago

I'm not able to reproduce the issue on my side. I need more information in order to investigate it. Could you please patch the python sources using: debug.patch.zip Following is a detail scenario how to do it:

tedtally commented 3 years ago

Sorry I forgot to mention that I am running this in Windows 10 python 3.7

On Thu, Nov 5, 2020 at 5:41 AM Ihor notifications@github.com wrote:

I'm not able to reproduce the issue on my side. I need more information in order to investigate it. Could you please patch the python sources using: debug.patch.zip https://github.com/zelloptt/zello-channel-api/files/5493603/debug.patch.zip Following is a detail scenario how to do it:

  • Download the attached zip and save to your zello-channel-api root directory
  • Go to your zello-channel-api root directory

cd <.../zello-channel-api> unzip debug.patch.zip patch -p1 < debug.patch

  • Go to the python example directory and launch as usual:

cd examples/py/ python3 main.py

I need the logs produced by the patched application. There is no sensitive data in the logs like credentials, tokens and channel name.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zelloptt/zello-channel-api/issues/119#issuecomment-722294935, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAW6YVQH2OULTMM3J6LJGLSOJ6MFANCNFSM4TKPIA6A .

tedtally commented 3 years ago

Here you go. I'm not sure if I did this correctly.

On Thu, Nov 5, 2020 at 5:41 AM Ihor notifications@github.com wrote:

I'm not able to reproduce the issue on my side. I need more information in order to investigate it. Could you please patch the python sources using: debug.patch.zip https://github.com/zelloptt/zello-channel-api/files/5493603/debug.patch.zip Following is a detail scenario how to do it:

  • Download the attached zip and save to your zello-channel-api root directory
  • Go to your zello-channel-api root directory

cd <.../zello-channel-api> unzip debug.patch.zip patch -p1 < debug.patch

  • Go to the python example directory and launch as usual:

cd examples/py/ python3 main.py

I need the logs produced by the patched application. There is no sensitive data in the logs like credentials, tokens and channel name.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zelloptt/zello-channel-api/issues/119#issuecomment-722294935, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAW6YVQH2OULTMM3J6LJGLSOJ6MFANCNFSM4TKPIA6A .

ihorserba commented 3 years ago

Hi Ted,

I don't see any logs attached. I have created separate branch with the mentioned patch to simplify the procedure. Open a Command Prompt and follow:

cd <...\zello-channel-api>
git pull
git checkout failed_create_stream_debug_logs
cd "examples\py"    
python3 main.py

Then copy-paste the output here

tedtally commented 3 years ago

(base) PS C:\Projects\zello-channel-api> git checkout failed_create_stream_debug_logs Switched to a new branch 'failed_create_stream_debug_logs' Branch 'failed_create_stream_debug_logs' set up to track remote branch 'failed_create_stream_debug_logs' from 'origin'. (base) PS C:\Projects\zello-channel-api> cd examples\py (base) PS C:\Projects\zello-channel-api\examples\py> python main.py 13:45:52.231 DEBUG: Using selector: SelectSelector 13:45:52.386 DEBUG: Logon request is sent 13:45:52.414 DEBUG: Got response with: 13:45:52.415 DEBUG: Authentication failed (base) PS C:\Projects\zello-channel-api\examples\py> python main.py 13:47:12.449 DEBUG: Using selector: SelectSelector 13:47:12.562 DEBUG: Logon request is sent 13:47:12.811 DEBUG: Got response with: "refresh_token" "success": "True" 13:47:12.878 DEBUG: Got response with: "command": "on_channel_status" "status": "online" 13:47:12.879 DEBUG: User has been authenticated on channel 13:47:12.881 DEBUG: "start_stream" request is sent. "codec_header": "QB8BFA==", "packet_duration": 20 13:47:12.887 DEBUG: Got response with: "command": "on_channel_status" "status": "online" 13:47:12.935 DEBUG: Failed to create Zello audio stream

On Thu, Nov 5, 2020 at 10:21 AM Ihor notifications@github.com wrote:

Hi Ted,

I don't see any logs attached. I have created separate branch https://github.com/zelloptt/zello-channel-api/tree/failed_create_stream_debug_logs with the mentioned patch to simplify the procedure. Open a Command Prompt and follow:

cd <.../zello-channel-api> git pull git checkout failed_create_stream_debug_logs cd "examples\py" python3 main.py

Then copy-paste the output here

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zelloptt/zello-channel-api/issues/119#issuecomment-722445147, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAW6YWYSUDZVCFTJZSG2U3SOK7HLANCNFSM4TKPIA6A .

tedtally commented 3 years ago

Does anything look out of the ordinary?

On Thu, Nov 5, 2020, 10:21 AM Ihor notifications@github.com wrote:

Hi Ted,

I don't see any logs attached. I have created separate branch https://github.com/zelloptt/zello-channel-api/tree/failed_create_stream_debug_logs with the mentioned patch to simplify the procedure. Open a Command Prompt and follow:

cd <.../zello-channel-api> git pull git checkout failed_create_stream_debug_logs cd "examples\py" python3 main.py

Then copy-paste the output here

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zelloptt/zello-channel-api/issues/119#issuecomment-722445147, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAW6YWYSUDZVCFTJZSG2U3SOK7HLANCNFSM4TKPIA6A .

vocoded commented 3 years ago

@tedtally we've published an update to the client code, please give it a shot

ihorserba commented 3 years ago

Hi Ted,

the issue should be fixed now. please update the sources:

cd <...\zello-channel-api>
git checkout master
git pull

Let me know if the problem persists. Thank you

tedtally commented 3 years ago

Getting close. The audio will play for .03 seconds then the audio goes out. I receive the following error in my console: "Cannot write to closing transport"

On Tue, Nov 10, 2020 at 9:24 AM Ihor notifications@github.com wrote:

Hi Ted,

the issue should be fixed now. please update the sources:

cd <...\zello-channel-api> git checkout master git pull

Let me know if the problem persists. Thank you

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zelloptt/zello-channel-api/issues/119#issuecomment-724734546, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAW6YXSNT3GL5FWJWJJPPDSPFELHANCNFSM4TKPIA6A .

tedtally commented 3 years ago

I tried the js example as well and get the same results with the following error: "Connection has been closed unexpectedly"

On Tue, Nov 10, 2020 at 9:46 AM ted taliaferro tedtally@gmail.com wrote:

Getting close. The audio will play for .03 seconds then the audio goes out. I receive the following error in my console: "Cannot write to closing transport"

On Tue, Nov 10, 2020 at 9:24 AM Ihor notifications@github.com wrote:

Hi Ted,

the issue should be fixed now. please update the sources:

cd <...\zello-channel-api> git checkout master git pull

Let me know if the problem persists. Thank you

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zelloptt/zello-channel-api/issues/119#issuecomment-724734546, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAW6YXSNT3GL5FWJWJJPPDSPFELHANCNFSM4TKPIA6A .

tedtally commented 3 years ago

ConnectionResetError error : Cannot write to closing transport Stack: ['Traceback (most recent call last):', ' File "main.py", line 77, in zello_stream_audio_to_channel', ' await zello_stream_send_audio(session, ws, stream_id, opus_stream)', ' File "main.py", line 186, in zello_stream_send_audio', ' send_audio_packet(ws, packet), packet_duration_sec * 0.8', ' File "C:\ProgramData\Anaconda3\lib\asyncio\tasks.py", line 442, in wait_for', ' return fut.result()', ' File "main.py", line 155, in send_audio_packet', ' await ws.send_bytes(packet)', ' File "C:\ProgramData\Anaconda3\lib\site-packages\aiohttp\client_ws.py", line 155, in send_bytes', ' await self._writer.send(data, binary=True, compress=compress)', ' File "C:\ProgramData\Anaconda3\lib\site-packages\aiohttp\http_websocket.py", line 685, in send', ' await self._send_frame(message, WSMsgType.BINARY, compress)', ' File "C:\ProgramData\Anaconda3\lib\site-packages\aiohttp\http_websocket.py", line 598, in _send_frame', ' raise ConnectionResetError("Cannot write to closing transport")', 'ConnectionResetError: Cannot write to closing transport']

On Tue, Nov 10, 2020 at 10:38 AM ted taliaferro tedtally@gmail.com wrote:

I tried the js example as well and get the same results with the following error: "Connection has been closed unexpectedly"

On Tue, Nov 10, 2020 at 9:46 AM ted taliaferro tedtally@gmail.com wrote:

Getting close. The audio will play for .03 seconds then the audio goes out. I receive the following error in my console: "Cannot write to closing transport"

On Tue, Nov 10, 2020 at 9:24 AM Ihor notifications@github.com wrote:

Hi Ted,

the issue should be fixed now. please update the sources:

cd <...\zello-channel-api> git checkout master git pull

Let me know if the problem persists. Thank you

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zelloptt/zello-channel-api/issues/119#issuecomment-724734546, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAW6YXSNT3GL5FWJWJJPPDSPFELHANCNFSM4TKPIA6A .

ihorserba commented 3 years ago

Hi Ted, could you please share the audio file you are trying to stream? Thanks, Igor

tedtally commented 3 years ago

The audio files I used were the sample.opus from the Git repo and the only attached. Both gave me the same results.

On Thu, Nov 12, 2020 at 4:00 AM Ihor notifications@github.com wrote:

Hi Ted, could you please share the audio file you are trying to stream? Thanks, Igor

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zelloptt/zello-channel-api/issues/119#issuecomment-725941343, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAW6YV3FWF6URTFDQTLKKLSPOP33ANCNFSM4TKPIA6A .

tedtally commented 3 years ago

plus I can't create the Zelloe audio stream anymore in Python as well.

On Thu, Nov 12, 2020 at 4:00 AM Ihor notifications@github.com wrote:

Hi Ted, could you please share the audio file you are trying to stream? Thanks, Igor

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zelloptt/zello-channel-api/issues/119#issuecomment-725941343, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAW6YV3FWF6URTFDQTLKKLSPOP33ANCNFSM4TKPIA6A .

tedtally commented 3 years ago

Igor,

I changed to another network and both opus files worked.

Ted

On Thu, Nov 12, 2020 at 4:00 AM Ihor notifications@github.com wrote:

Hi Ted, could you please share the audio file you are trying to stream? Thanks, Igor

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zelloptt/zello-channel-api/issues/119#issuecomment-725941343, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAW6YV3FWF6URTFDQTLKKLSPOP33ANCNFSM4TKPIA6A .

ihorserba commented 3 years ago

Great, feel free to contact us if you face with any issues. Best regards, Igor

tedtally commented 3 years ago

Igor,

Were any changes recently rolled back? I am getting the Failed to Create Zello Audio stream again. I've tried from different networks and get the same result.

Ted

On Thu, Nov 12, 2020 at 12:49 PM Ihor notifications@github.com wrote:

Great, feel free to contact us if you face with any issues. Best regards, Igor

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zelloptt/zello-channel-api/issues/119#issuecomment-726235766, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAW6YVKTBNDPPQ4P7OBWKDSPQN37ANCNFSM4TKPIA6A .