ОсновноеRadiotalkПользовательское
Общие вопросы по интернет радио вещанию
7   •   Посмотреть все темы

Airtime и входной поток.

 

11
Stics @Stics
При подключении входного потока к airtime, liquidsoap продолжает транслировать музыку из календаря, хотя в самом airtime показано, что подключен входной поток, и звук должен идти с него.
При вводе
  1. invoke-rc.d airtime-playout restart
liquidsoap сразу переключается на входящий поток.

Что сделать, что-бы входной поток нормально включался?

p.s. В airtime показано, что подключен входной поток, и звук идёт с него.
p.p.s. Добавить
  1. invoke-rc.d airtime-playout restart
в cron не предлагать.

0
382
Grigorij @gyurgin_1
Это Вам на их форум надо, хотя если дадите конфиг liquidsoap - подскажу что не так.

0
11
Stics @Stics
gyurgin_1 пишет:

хотя если дадите конфиг liquidsoap - подскажу что не так.


  1. ################################################
  2. # THIS FILE IS AUTO GENERATED. DO NOT CHANGE!! #
  3. ################################################
  4. output_sound_device = false
  5. icecast_vorbis_metadata = false
  6. s1_enable = true
  7. s1_output = "icecast"
  8. s1_pass = "%пароль%"
  9. s2_output = "icecast"
  10. s2_user = ""
  11. s2_description = ""
  12. s2_genre = ""
  13. s3_output = "icecast"
  14. s3_user = ""
  15. s3_description = ""
  16. s3_genre = ""
  17. s1_channels = "stereo"
  18. s2_channels = "stereo"
  19. s3_channels = "stereo"
  20. s1_type = "mp3"
  21. s1_description = ""
  22. s1_genre = ""
  23. s2_type = "ogg"
  24. s3_url = "%домен%"
  25. s3_mount = "live_aac"
  26. output_sound_device_type = "None"
  27. s1_user = ""
  28. s2_port = 8000
  29. master_live_stream_port = 7998
  30. master_live_stream_mp = "master"
  31. dj_live_stream_port = 7999
  32. dj_live_stream_mp = "show"
  33. off_air_meta = "Airtime - offline"
  34. s1_bitrate = 192
  35. s2_enable = true
  36. s1_mount = "live"
  37. s3_enable = true
  38. s1_url = "%домен%"
  39. s1_name = "%название станции%"
  40. s2_bitrate = 96
  41. s2_pass = "%пароль%"
  42. s2_name = "%название станции%"
  43. s2_url = "%домен%"
  44. s2_mount = "live_ogg"
  45. s3_type = "aac"
  46. s3_bitrate = 96
  47. s1_host = "src.%домен%"
  48. s3_port = 8000
  49. s3_pass = "%пароль%"
  50. s3_name = "%название станции%"
  51. s2_host = "src.%домен%"
  52. s3_host = "src.%домен%"
  53. s1_port = 8000
  54. log_file = "/var/log/airtime/pypo-liquidsoap/<script>.log"

0
382
Grigorij @gyurgin_1
Это вобще не то.

0
382
Grigorij @gyurgin_1
А ну скачал Airtime, посмотрел - там все прекрасно реализовано, курите их ********** .

0
11
Stics @Stics
gyurgin_1 пишет:

Это вобще не то.

  1. %include "/etc/airtime/liquidsoap.cfg"
  2. set("log.file.path", log_file)
  3. set("server.telnet", true)
  4. set("server.telnet.port", 1234)
  5. set("init.daemon.pidfile.path", "/var/run/airtime-liquidsoap.pid")
  6. %include "library/pervasives.liq"
  7. #Dynamic source list
  8. #dyn_sources = ref []
  9. webstream_enabled = ref false
  10. time = ref string_of(gettimeofday())
  11. #live stream setup
  12. set("harbor.bind_addr", "0.0.0.0")
  13. current_dyn_id = ref '-1'
  14. pypo_data = ref '0'
  15. stream_metadata_type = ref 0
  16. default_dj_fade = ref 0.
  17. station_name = ref ''
  18. show_name = ref ''
  19. dynamic_metadata_callback = ref fun (s) -> begin () end
  20. s1_connected = ref ''
  21. s2_connected = ref ''
  22. s3_connected = ref ''
  23. s1_namespace = ref ''
  24. s2_namespace = ref ''
  25. s3_namespace = ref ''
  26. just_switched = ref false
  27. %include "ls_lib.liq"
  28. sources = ref []
  29. source_id = ref 0
  30. def create_source()
  31. l = request.equeue(id="s#{!source_id}", length=0.5)
  32. l = audio_to_stereo(id="queue_src", l)
  33. l = cue_cut(l)
  34. l = amplify(1., override="replay_gain", l)
  35. # the crossfade function controls fade in/out
  36. l = crossfade_airtime(l)
  37. l = on_metadata(notify_queue, l)
  38. sources := list.append([l], !sources)
  39. server.register(namespace="queues",
  40. "s#{!source_id}_skip",
  41. fun (s) -> begin log("queues.s#{!source_id}_skip")
  42. clear_queue(l)
  43. "Done"
  44. end)
  45. source_id := !source_id + 1
  46. end
  47. create_source()
  48. create_source()
  49. create_source()
  50. create_source()
  51. create_source()
  52. create_source()
  53. create_source()
  54. create_source()
  55. queue = add(!sources, normalize=false)
  56. pair = insert_metadata(queue)
  57. dynamic_metadata_callback := fst(pair)
  58. queue = snd(pair)
  59. output.dummy(fallible=true, queue)
  60. http = input.http_restart(id="http")
  61. http = cross_http(http_input_id="http",http)
  62. output.dummy(fallible=true, http)
  63. stream_queue = http_fallback(http_input_id="http", http=http, default=queue)
  64. stream_queue = map_metadata(update=false, append_title, stream_queue)
  65. ignore(output.dummy(stream_queue, fallible=true))
  66. server.register(namespace="vars",
  67. "pypo_data",
  68. fun (s) -> begin log("vars.pypo_data") pypo_data := s "Done" end)
  69. server.register(namespace="vars",
  70. "stream_metadata_type",
  71. fun (s) -> begin log("vars.stream_metadata_type") stream_metadata_type := int_of_string(s) s end)
  72. server.register(namespace="vars",
  73. "show_name",
  74. fun (s) -> begin log("vars.show_name") show_name := s s end)
  75. server.register(namespace="vars",
  76. "station_name",
  77. fun (s) -> begin log("vars.station_name") station_name := s s end)
  78. server.register(namespace="vars",
  79. "bootup_time",
  80. fun (s) -> begin log("vars.bootup_time") time := s s end)
  81. server.register(namespace="streams",
  82. "connection_status",
  83. fun (s) -> begin log("streams.connection_status") "1:#{!s1_connected},2:#{!s2_connected},3:#{!s3_connected}" end)
  84. server.register(namespace="vars",
  85. "default_dj_fade",
  86. fun (s) -> begin log("vars.default_dj_fade") default_dj_fade := float_of_string(s) s end)
  87. server.register(namespace="dynamic_source",
  88. description="Enable webstream output",
  89. usage='start',
  90. "output_start",
  91. fun (s) -> begin log("dynamic_source.output_start")
  92. notify([("schedule_table_id", !current_dyn_id)])
  93. webstream_enabled := true "enabled" end)
  94. server.register(namespace="dynamic_source",
  95. description="Enable webstream output",
  96. usage='stop',
  97. "output_stop",
  98. fun (s) -> begin log("dynamic_source.output_stop") webstream_enabled := false "disabled" end)
  99. server.register(namespace="dynamic_source",
  100. description="Set the streams cc_schedule row id",
  101. usage="id <id>",
  102. "id",
  103. fun (s) -> begin log("dynamic_source.id") set_dynamic_source_id(s) end)
  104. server.register(namespace="dynamic_source",
  105. description="Get the streams cc_schedule row id",
  106. usage="get_id",
  107. "get_id",
  108. fun (s) -> begin log("dynamic_source.get_id") get_dynamic_source_id() end)
  109. #server.register(namespace="dynamic_source",
  110. # description="Start a new dynamic source.",
  111. # usage="start <uri>",
  112. # "read_start",
  113. # fun (uri) -> begin log("dynamic_source.read_start") begin_stream_read(uri) end)
  114. #server.register(namespace="dynamic_source",
  115. # description="Stop a dynamic source.",
  116. # usage="stop <id>",
  117. # "read_stop",
  118. # fun (s) -> begin log("dynamic_source.read_stop") stop_stream_read(s) end)
  119. #server.register(namespace="dynamic_source",
  120. # description="Stop a dynamic source.",
  121. # usage="stop <id>",
  122. # "read_stop_all",
  123. # fun (s) -> begin log("dynamic_source.read_stop") destroy_dynamic_source_all() end)
  124. default = amplify(id="silence_src", 0.00001, noise())
  125. ref_off_air_meta = ref off_air_meta
  126. if !ref_off_air_meta == "" then
  127. ref_off_air_meta := "Airtime - offline"
  128. end
  129. default = rewrite_metadata([("title", !ref_off_air_meta)], default)
  130. ignore(output.dummy(default, fallible=true))
  131. master_dj_enabled = ref false
  132. live_dj_enabled = ref false
  133. scheduled_play_enabled = ref false
  134. def make_master_dj_available()
  135. master_dj_enabled := true
  136. end
  137. def make_master_dj_unavailable()
  138. master_dj_enabled := false
  139. end
  140. def make_live_dj_available()
  141. live_dj_enabled := true
  142. end
  143. def make_live_dj_unavailable()
  144. live_dj_enabled := false
  145. end
  146. def make_scheduled_play_available()
  147. scheduled_play_enabled := true
  148. just_switched := true
  149. end
  150. def make_scheduled_play_unavailable()
  151. scheduled_play_enabled := false
  152. end
  153. def update_source_status(sourcename, status) =
  154. command = "/usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --source-name=#{sourcename} --source-status=#{status} &"
  155. system(command)
  156. log(command)
  157. end
  158. def live_dj_connect(header) =
  159. update_source_status("live_dj", true)
  160. end
  161. def live_dj_disconnect() =
  162. update_source_status("live_dj", false)
  163. end
  164. def master_dj_connect(header) =
  165. update_source_status("master_dj", true)
  166. end
  167. def master_dj_disconnect() =
  168. update_source_status("master_dj", false)
  169. end
  170. #auth function for live stream
  171. def check_master_dj_client(user,password) =
  172. log("master connected")
  173. #get the output of the php script
  174. ret = get_process_lines("python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_auth.py --master #{user} #{password}")
  175. #ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ...
  176. ret = list.hd(ret)
  177. #return true to let the client transmit data, or false to tell harbor to decline
  178. ret == "True"
  179. end
  180. def check_dj_client(user,password) =
  181. log("live dj connected")
  182. #get the output of the php script
  183. ret = get_process_lines("python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_auth.py --dj #{user} #{password}")
  184. #ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ...
  185. hd = list.hd(ret)
  186. log("Live DJ authenticated: #{hd}")
  187. hd == "True"
  188. end
  189. s = switch(id="schedule_noise_switch",
  190. track_sensitive=false,
  191. transitions=[transition_default, transition],
  192. [({!scheduled_play_enabled}, stream_queue), ({true}, default)]
  193. )
  194. s = if dj_live_stream_port != 0 and dj_live_stream_mp != "" then
  195. dj_live =
  196. audio_to_stereo(
  197. input.harbor(id="live_dj_harbor",
  198. dj_live_stream_mp,
  199. port=dj_live_stream_port,
  200. auth=check_dj_client,
  201. max=40.,
  202. on_connect=live_dj_connect,
  203. on_disconnect=live_dj_disconnect))
  204. ignore(output.dummy(dj_live, fallible=true))
  205. switch(id="show_schedule_noise_switch",
  206. track_sensitive=false,
  207. transitions=[transition, transition],
  208. [({!live_dj_enabled}, dj_live), ({true}, s)]
  209. )
  210. else
  211. s
  212. end
  213. s = if master_live_stream_port != 0 and master_live_stream_mp != "" then
  214. master_dj =
  215. audio_to_stereo(
  216. input.harbor(id="master_harbor",
  217. master_live_stream_mp,
  218. port=master_live_stream_port,
  219. auth=check_master_dj_client,
  220. max=40.,
  221. on_connect=master_dj_connect,
  222. on_disconnect=master_dj_disconnect))
  223. ignore(output.dummy(master_dj, fallible=true))
  224. switch(id="master_show_schedule_noise_switch",
  225. track_sensitive=false,
  226. transitions=[transition, transition],
  227. [({!master_dj_enabled}, master_dj), ({true}, s)]
  228. )
  229. else
  230. s
  231. end
  232. # Attach a skip command to the source s:
  233. #add_skip_command(s)
  234. server.register(namespace="streams",
  235. description="Stop Master DJ source.",
  236. usage="master_dj_stop",
  237. "master_dj_stop",
  238. fun (s) -> begin log("streams.master_dj_stop") make_master_dj_unavailable() "Done." end)
  239. server.register(namespace="streams",
  240. description="Start Master DJ source.",
  241. usage="master_dj_start",
  242. "master_dj_start",
  243. fun (s) -> begin log("streams.master_dj_start") make_master_dj_available() "Done." end)
  244. server.register(namespace="streams",
  245. description="Stop Live DJ source.",
  246. usage="live_dj_stop",
  247. "live_dj_stop",
  248. fun (s) -> begin log("streams.live_dj_stop") make_live_dj_unavailable() "Done." end)
  249. server.register(namespace="streams",
  250. description="Start Live DJ source.",
  251. usage="live_dj_start",
  252. "live_dj_start",
  253. fun (s) -> begin log("streams.live_dj_start") make_live_dj_available() "Done." end)
  254. server.register(namespace="streams",
  255. description="Stop Scheduled Play source.",
  256. usage="scheduled_play_stop",
  257. "scheduled_play_stop",
  258. fun (s) -> begin log("streams.scheduled_play_stop") make_scheduled_play_unavailable() "Done." end)
  259. server.register(namespace="streams",
  260. description="Start Scheduled Play source.",
  261. usage="scheduled_play_start",
  262. "scheduled_play_start",
  263. fun (s) -> begin log("streams.scheduled_play_start") make_scheduled_play_available() "Done." end)
  264. if output_sound_device then
  265. success = ref false
  266. log(output_sound_device_type)
  267. %ifdef output.alsa
  268. if output_sound_device_type == "ALSA" then
  269. ignore(output.alsa(s))
  270. success := true
  271. end
  272. %endif
  273. %ifdef output.ao
  274. if output_sound_device_type == "AO" then
  275. ignore(output.ao(s))
  276. success := true
  277. end
  278. %endif
  279. %ifdef output.oss
  280. if output_sound_device_type == "OSS" then
  281. ignore(output.oss(s))
  282. success := true
  283. end
  284. %endif
  285. %ifdef output.portaudio
  286. if output_sound_device_type == "Portaudio" then
  287. ignore(output.portaudio(s))
  288. success := true
  289. end
  290. %endif
  291. %ifdef output.pulseaudio
  292. if output_sound_device_type == "Pulseaudio" then
  293. ignore(output.pulseaudio(s))
  294. success := true
  295. end
  296. %endif
  297. if (!success == false) then
  298. ignore(output.prefered(s))
  299. end
  300. end
  301. if s1_enable == true then
  302. if s1_output == 'shoutcast' then
  303. s1_namespace := "shoutcast_stream_1"
  304. else
  305. s1_namespace := s1_mount
  306. end
  307. server.register(namespace=!s1_namespace, "connected", fun (s) -> begin log("#{!s1_namespace}.connected") !s1_connected end)
  308. output_to(s1_output, s1_type, s1_bitrate, s1_host, s1_port, s1_pass,
  309. s1_mount, s1_url, s1_description, s1_genre, s1_user, s, "1",
  310. s1_connected, s1_name, s1_channels)
  311. end
  312. if s2_enable == true then
  313. if s2_output == 'shoutcast' then
  314. s2_namespace := "shoutcast_stream_2"
  315. else
  316. s2_namespace := s2_mount
  317. end
  318. server.register(namespace=!s2_namespace, "connected", fun (s) -> begin log("#{!s2_namespace}.connected") !s2_connected end)
  319. output_to(s2_output, s2_type, s2_bitrate, s2_host, s2_port, s2_pass,
  320. s2_mount, s2_url, s2_description, s2_genre, s2_user, s, "2",
  321. s2_connected, s2_name, s2_channels)
  322. end
  323. if s3_enable == true then
  324. if s3_output == 'shoutcast' then
  325. s3_namespace := "shoutcast_stream_3"
  326. else
  327. s3_namespace := s3_mount
  328. end
  329. server.register(namespace=!s3_namespace, "connected", fun (s) -> begin log("#{!s3_namespace}.connected") !s3_connected end)
  330. output_to(s3_output, s3_type, s3_bitrate, s3_host, s3_port, s3_pass,
  331. s3_mount, s3_url, s3_name, s3_genre, s3_user, s, "3",
  332. s3_connected, s3_description, s3_channels)
  333. end
  334. command = "/usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --liquidsoap-started &"
  335. log(command)
  336. system(command)

Это то?

0
11
Stics @Stics
Сегодня после нескольких отправок команды
invoke-rc.d airtime-playout restart
liquidsoap стал нормально переключаться на входящий поток.
Посмотрел лог, в обоих случаях (когда переключается на поток и когда продолжает играть по плейлисту), лог совпадает.

  1.  
  2. 2016/12/05 10:27:58 [server:3] New client: localhost.
  3. 2016/12/05 10:27:58 [server:3] Client localhost disconnected.
  4. 2016/12/05 10:28:08 [server:3] New client: localhost.
  5. 2016/12/05 10:28:08 [server:3] Client localhost disconnected.
  6. 2016/12/05 10:28:17 [lang:3] live dj connected
  7. 2016/12/05 10:28:18 [lang:3] Live DJ authenticated: True
  8. 2016/12/05 10:28:18 [decoder:3] Method "MAD" accepted "audio/mpeg".
  9. 2016/12/05 10:28:18 [lang:3] /usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --source-name=live_dj --source-status=true &
  10. 2016/12/05 10:28:18 [threads:3] Created thread "harbor source feeding" (3 total).
  11. 2016/12/05 10:28:18 [live_dj_harbor:3] Decoding...
  12. 2016/12/05 10:28:18 [stdout:3]
  13. 2016/12/05 10:28:18 [stdout:3] #########################################
  14. 2016/12/05 10:28:18 [stdout:3] # *** pypo *** #
  15. 2016/12/05 10:28:18 [stdout:3] # pypo notification gateway #
  16. 2016/12/05 10:28:18 [stdout:3] #########################################
  17. 2016/12/05 10:28:18 [server:3] New client: localhost.
  18. 2016/12/05 10:28:18 [server:3] Client localhost disconnected.
  19. 2016/12/05 10:28:19 [show_schedule_noise_switch:3] Switch to audio_to_stereo_5647 with transition.
  20. 2016/12/05 10:28:19 [lang:3] transition called...
  21. 2016/12/05 10:28:23 [lang:3] live dj connected
  22. 2016/12/05 10:28:23 [lang:3] Live DJ authenticated: True
  23. 2016/12/05 10:28:23 [live_dj_harbor:3] New metadata chunk ? -- .
  24. 2016/12/05 10:28:28 [server:3] New client: localhost.
  25. 2016/12/05 10:28:28 [server:3] Client localhost disconnected.
  26. 2016/12/05 10:28:38 [server:3] New client: localhost.
  27. 2016/12/05 10:28:38 [server:3] Client localhost disconnected.
  28. 2016/12/05 10:28:48 [server:3] New client: localhost.
  29. 2016/12/05 10:28:48 [server:3] Client localhost disconnected.
  30. 2016/12/05 10:28:59 [server:3] New client: localhost.
  31. 2016/12/05 10:28:59 [server:3] Client localhost disconnected.
  32. 2016/12/05 10:29:09 [server:3] New client: localhost.
  33. 2016/12/05 10:29:09 [server:3] Client localhost disconnected.

0





Согласие на обработку данных на нашем сайте

Продолжая просматривать страницу, вы соглашаетесь с использованием файлов «Cookie» и с Политикой конфиденциальности «Privacy».
Наверху или внизу страницы вы можете изменить валюту и язык по умолчанию. Английская версия сайта ещё находится в доработке и доступна не полностью.