srs icon indicating copy to clipboard operation
srs copied to clipboard

code=1028(StreamBusy)(Stream already exists or busy)

Open terry8204 opened this issue 9 months ago • 10 comments

!!! Before submitting a new bug report, please ensure you have searched for any existing bugs. Duplicate issues or questions that are overly simple or already addressed in the documentation will be removed without any response.

Describe the bug Occasionally, one of the video streams fails to play while the other two streams work fine, requiring a restart of SRS to resume playback. However, the issue quickly reoccurs. This problem does not happen when switching to the SRS version 6.0-d4. Version version srs6.0-a1 6.0.155

To Reproduce Steps to reproduce the behavior:

  1. All video channels on the playback device, totaling three streams.
  2. Occasionally, one of the streams experiences both video and audio playback failure.
  3. Playback can only be resumed by restarting SRS.
  4. The logs indicate issues with both audio and video. /live/13920003917_1_0_1078_video is busy /live/13920003917_2_0_1078_audio is busy Expected behavior The video and audio can be played back normally. Screenshots

Additional context [2025-02-28 09:47:57.841][ERROR][5969][406y4882][11] serve error code=1028(StreamBusy)(Stream already exists or busy) : service cycle : rtmp: stream service : rtmp: stream /live/13920003917_1_0_1078_video is busy thread [5969][406y4882]: do_cycle() [./src/app/srs_app_rtmp_conn.cpp:263][errno=11] thread [5969][406y4882]: service_cycle() [./src/app/srs_app_rtmp_conn.cpp:457][errno=11] thread [5969][406y4882]: acquire_publish() [./src/app/srs_app_rtmp_conn.cpp:1078][errno=11](Resource temporarily unavailable) [2025-02-28 09:47:58.168][ERROR][5969][0129i879][11] serve error code=1028(StreamBusy)(Stream already exists or busy) : service cycle : rtmp: stream service : rtmp: stream /live/13920003917_3_0_1078_video is busy thread [5969][0129i879]: do_cycle() [./src/app/srs_app_rtmp_conn.cpp:263][errno=11] thread [5969][0129i879]: service_cycle() [./src/app/srs_app_rtmp_conn.cpp:457][errno=11] thread [5969][0129i879]: acquire_publish() [./src/app/srs_app_rtmp_conn.cpp:1078][errno=11](Resource temporarily unavailable) [2025-02-28 09:47:58.917][WARN][5969][5zo07876][0] client disconnect peer. ret=1007 [2025-02-28 09:47:59.064][WARN][5969][66519849][0] client disconnect peer. ret=1009 [2025-02-28 09:47:59.168][WARN][5969][70374r7n][0] client disconnect peer. ret=1007 [2025-02-28 09:47:59.169][WARN][5969][5in0972a][0] client disconnect peer. ret=1007 [2025-02-28 09:47:59.895][ERROR][5969][u688x6dh][11] serve error code=2001(RtmpChunkStart)(RTMP packet must be fresh chunk) : rtmp connect tcUrl : expect connect app response : recv message : recv interlaced message : read message header : fresh chunk expect fmt=0, actual=2, cid=39 thread [5969][u688x6dh]: do_cycle() [./src/app/srs_app_rtmp_conn.cpp:218][errno=11] thread [5969][u688x6dh]: connect_app() [./src/protocol/srs_protocol_rtmp_stack.cpp:2245][errno=11] thread [5969][u688x6dh]: expect_message() [./src/protocol/srs_protocol_rtmp_stack.hpp:308][errno=11] thread [5969][u688x6dh]: recv_message() [./src/protocol/srs_protocol_rtmp_stack.cpp:339][errno=11] thread [5969][u688x6dh]: recv_interlaced_message() [./src/protocol/srs_protocol_rtmp_stack.cpp:821][errno=11] thread [5969][u688x6dh]: read_message_header() [./src/protocol/srs_protocol_rtmp_stack.cpp:977][errno=11](Resource temporarily unavailable) [2025-02-28 09:48:00.277][WARN][5969][j0506pzn][0] client disconnect peer. ret=1007 [2025-02-28 09:48:00.278][WARN][5969][bb3zm95q][0] client disconnect peer. ret=1007 [2025-02-28 09:48:00.309][ERROR][5969][07g26555][11] serve error code=1028(StreamBusy)(Stream already exists or busy) : service cycle : rtmp: stream service : rtmp: stream /live/13920003917_2_0_1078_audio is busy thread [5969][07g26555]: do_cycle() [./src/app/srs_app_rtmp_conn.cpp:263][errno=11] thread [5969][07g26555]: service_cycle() [./src/app/srs_app_rtmp_conn.cpp:457][errno=11] thread [5969][07g26555]: acquire_publish() [./src/app/srs_app_rtmp_conn.cpp:1078][errno=11](Resource temporarily unavailable) [2025-02-28 09:48:00.473][WARN][5969][63qu12jz][0] client disconnect peer. ret=1007 [2025-02-28 09:48:01.520][WARN][5969][b0tt5jo7][0] client disconnect peer. ret=1007 [2025-02-28 09:48:01.768][WARN][5969][8e094c8b][11] avc ignore type=1 for no sequence header [2025-02-28 09:48:01.768][WARN][5969][8e094c8b][11] avc ignore type=1 for no sequence header [2025-02-28 09:48:01.840][WARN][5969][fs118737][0] client disconnect peer. ret=1009 [2025-02-28 09:48:01.904][ERROR][5969][p99260dv][11] serve error code=2001(RtmpChunkStart)(RTMP packet must be fresh chunk) : rtmp connect tcUrl : expect connect app response : recv message : recv interlaced message : read message header : fresh chunk expect fmt=0, actual=2, cid=52 thread [5969][p99260dv]: do_cycle() [./src/app/srs_app_rtmp_conn.cpp:218][errno=11]

TRANS_BY_GPT4

terry8204 avatar Mar 11 '25 03:03 terry8204

I also had the same problem.

version srs6.0-a1

Occasionally occurs after frequent streaming and disconnection operations. Unless SRS is restarted, the stream will remain busy.

https://github.com/ossrs/srs/issues/4140 https://github.com/ossrs/srs/pull/4141

Although there is a PR mentioning this issue, the problem still exists.

Using /api/v1/streams?count=9999 and /api/v1/clients?count=9999 does not provide any information about the busy stream.

lin557 avatar Mar 12 '25 02:03 lin557

The current switch to version a0 also results in: [2025-03-13 15:14:20.442][WARN][51569][05g4432b][11] VIDEO: Timestamp 269612874=>1177495, may need mix_correct. 13307187524[2025-03-13 15:14:20.569][ERROR][51569][8apgbp01][11] serve error code=1028(StreamBusy)(Stream already exists or busy) : service cycle : rtmp: stream service : rtmp: stream /live/13307187524_2_0_1078_video is busy thread [51569][8apgbp01]: do_cycle() [./src/app/srs_app_rtmp_conn.cpp:263][errno=11] thread [51569][8apgbp01]: service_cycle() [./src/app/srs_app_rtmp_conn.cpp:457][errno=11] thread [51569][8apgbp01]: acquire_publish() [./src/app/srs_app_rtmp_conn.cpp:1078][errno=11](Resource temporarily unavailable) [2025-03-13 15:14:20.594][ERROR][51569][2uu1618u][11] serve error code=1028(StreamBusy)(Stream already exists or busy) : service cycle : rtmp: stream service : rtmp: stream /live/13307187524_3_0_1078_video is busy thread [51569][2uu1618u]: do_cycle() [./src/app/srs_app_rtmp_conn.cpp:263][errno=11] thread [51569][2uu1618u]: service_cycle() [./src/app/srs_app_rtmp_conn.cpp:457][errno=11] thread [51569][2uu1618u]: acquire_publish() [./src/app/srs_app_rtmp_conn.cpp:1078][errno=11](Resource temporarily unavailable) [2025-03-13 15:14:20.766][ERROR][51569][d4027v67][11] serve error code=1028(StreamBusy)(Stream already exists or busy) : service cycle : rtmp: stream service : rtmp: stream /live/13307187524_4_0_1078_video is busy thread [51569][d4027v67]: do_cycle() [./src/app/srs_app_rtmp_conn.cpp:263][errno=11] thread [51569][d4027v67]: service_cycle() [./src/app/srs_app_rtmp_conn.cpp:457][errno=11] thread [51569][d4027v67]: acquire_publish() [./src/app/srs_app_rtmp_conn.cpp:1078][errno=11](Resource temporarily unavailable) [2025-03-13 15:14:21.348][WARN][51569][04c43gq8][11] avc ignore type=1 for no sequence header [2025-03-13 15:14:21.701][WARN][51569][04c43gq8][11] VIDEO: Timestamp 269632912=>1197577, may need mix_correct. [2025-03-13 15:14:21.799][WARN][51569][9x056859][11] avc ignore type=1 for no sequence header [2025-03-13 15:14:21.907][WARN][51569][9x056859][11] avc ignore type=1 for no sequence header [2025-03-13 15:14:21.914][WARN][51569][8616385b][0] client disconnect peer. ret=1007

TRANS_BY_GPT4

terry8204 avatar Mar 13 '25 07:03 terry8204

I am currently testing the D5 version and monitoring the logs. So far, there have been no instances of "busy" reported. The specific performance will need to be observed over the next few days. [2025-03-13 15:43:25.229][WARN][26925][740300k9][0] client disconnect peer. ret=1007 [2025-03-13 15:43:25.271][WARN][26925][1294206g][0] client disconnect peer. ret=1009 [2025-03-13 15:43:25.304][ERROR][26925][72n908hz][11] serve error code=2001(RtmpChunkStart)(RTMP packet must be fresh chunk) : rtmp connect tcUrl : expect connect app response : recv message : recv interlaced message : read message header : fresh chunk expect fmt=0, actual=3, cid=37 thread [26925][72n908hz]: do_cycle() [./src/app/srs_app_rtmp_conn.cpp:218][errno=11] thread [26925][72n908hz]: connect_app() [./src/protocol/srs_protocol_rtmp_stack.cpp:2248][errno=11] thread [26925][72n908hz]: expect_message() [./src/protocol/srs_protocol_rtmp_stack.hpp:308][errno=11] thread [26925][72n908hz]: recv_message() [./src/protocol/srs_protocol_rtmp_stack.cpp:341][errno=11] thread [26925][72n908hz]: recv_interlaced_message() [./src/protocol/srs_protocol_rtmp_stack.cpp:825][errno=11] thread [26925][72n908hz]: read_message_header() [./src/protocol/srs_protocol_rtmp_stack.cpp:981][errno=11](Resource temporarily unavailable) [2025-03-13 15:43:25.421][WARN][26925][75s621ed][0] client disconnect peer. ret=1007

TRANS_BY_GPT4

terry8204 avatar Mar 13 '25 07:03 terry8204

It is possible that your streaming connection has not been disconnected and remains in either the source or publish state, but there has been an anomaly with the audio or video being streamed. If you are experiencing a 'busy' issue, please provide the complete configuration file, logs, and steps to reproduce the problem, rather than segments of the logs.

TRANS_BY_GPT4

chundonglinlin avatar Mar 13 '25 07:03 chundonglinlin

I also had the same problem.

version srs6.0-a1

Occasionally occurs after frequent streaming and disconnection operations. Unless SRS is restarted, the stream will remain busy.

#4140 #4141

Although there is a PR mentioning this issue, the problem still exists.

Using /api/v1/streams?count=9999 and /api/v1/clients?count=9999 does not provide any information about the busy stream.

Please provide the logs and configuration to facilitate troubleshooting this issue.

TRANS_BY_GPT4

chundonglinlin avatar Mar 13 '25 08:03 chundonglinlin

srs.zip

The sys.conf file is currently being reviewed, specifically the d5 version.

main config for srs.

@see full.conf for detail config.

listen 1935; max_connections 5000; srs_log_tank file; srs_log_file ./objs/srs.log; daemon on; http_api { enabled on; listen 1985; } http_server { enabled on; listen 8080; dir ./objs/nginx/html; } stats { network 0; disk sda sdb xvda xvdb; } vhost defaultVhost { hls { enabled off; } http_remux { enabled on; mount [vhost]/[app]/[stream].flv; } gop_cache on; queue_length 10; min_latency on; mr { enabled off; } mw_latency 100; tcp_nodelay on; # the 1st packet timeout in ms for encoder. # default: 20000 (20seconds) # change to 60 seconds publish_1stpkt_timeout 60000; # the normal packet timeout in ms for encoder. # default: 5000 # one day is 86400000 # 30 day 2592000000 publish_normal_timeout 2592000000; http_hooks { enabled on;

  on_play http://127.0.0.1/userwebservlet?action=srshookcallback;
  on_stop http://127.0.0.1/userwebservlet?action=srshookcallback;
}

}

TRANS_BY_GPT4

srs.conf

terry8204 avatar Mar 13 '25 08:03 terry8204

The switch to the D5 version began yesterday, and currently everything is functioning normally with excellent results.

TRANS_BY_GPT4

terry8204 avatar Mar 14 '25 02:03 terry8204

I also had the same problem. version srs6.0-a1 Occasionally occurs after frequent streaming and disconnection operations. Unless SRS is restarted, the stream will remain busy. #4140 #4141 Although there is a PR mentioning this issue, the problem still exists. Using /api/v1/streams?count=9999 and /api/v1/clients?count=9999 does not provide any information about the busy stream.

Please provide the logs and configuration to facilitate troubleshooting this issue.

TRANS_BY_GPT4

docker.conf

# the config for srs to dvr in session mode
# @see https://github.com/ossrs/srs/wiki/v3_CN_DVR
# @see full.conf for detail config.


listen              1935;
max_connections     1000;
#srs_log_tank        file;
#srs_log_file        ./objs/srs.log;


When running with Docker, it is essential to set this to 'off'.
daemon              off;


http_api {
    enabled         on;
    listen          1985;
}


http_server {
    enabled         on;
    listen          8080;
    dir             ./objs/nginx/html;
}


vhost __defaultVhost__ {
    
    hls {
        enabled         off;
        hls_fragment    5;
    }
    
    http_remux {
Enable HTTP-FLV.
        enabled     on;
        mount       [vhost]/[app]/[stream].flv;
    }
    
    tcp_nodelay     on;
    min_latency     on;
}


lin557 avatar Mar 16 '25 13:03 lin557

I also had the same problem. SRS/6.0.166

IPC -- ffmpeg push rtsp:// to rtmp:// stream-> SRS

Can reproduce the problem through change the stream encode of IPC from h264 to h265 during the stream pushing

Image

Image

hyperion-thou avatar Jun 03 '25 06:06 hyperion-thou

I am also experiencing this issue, which occurs when using a version of SRS that I compiled from the source code. The problem occasionally arises when I repeatedly disconnect and then reconnect the stream. My SRS version is 6.0.134.

TRANS_BY_GPT4

quzefeng avatar Jun 05 '25 01:06 quzefeng

Should have been fixed in 6.0.182 and 7.0

winlinvip avatar Oct 26 '25 01:10 winlinvip