WebRTC
WebRTC copied to clipboard
Audio playback failed Tapo C200
Hello, when trying to play an mp3 using go2rtc on the tapo c200 camera, an error is received:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 198, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1808, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1845, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
await service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 686, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 961, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 726, in _handle_entity_call
await result
File "/config/custom_components/webrtc/media_player.py", line 74, in async_play_media
assert r.ok
AssertionError
Configuration.yaml: media_player:
- platform: webrtc name: Tapo Camera stream: tapo audio: pcma/8000
PCMA doesn't work either
Thanks
pcma/8000
transcoding template not exist. Should be pcma
pcma doesn't work either...
Have you check two way audio in the go2rtc Web UI?
Yes, not working.
Awaiting response...
You need to get it to work in the go2rtc WebUI. And then in this component. Enable go2rtc logs. Check errors.
Hello, Even using the go2rtc interface through the links screen, there is no two-way audio.
Log:
19:23:17.085 ERR github.com/AlexxIT/go2rtc/cmd/mjpeg/mjpeg.go:159 > error="codecs not match: H264,PCMA"
19:23:19.972 ERR [api.mjpeg] add consumer error="codecs not match: H264,PCMA
MJPEG module support only MJPEG codec. This error is correct
No link on the links page plays audio on the camera. That's the only thing there is a log
set log level stream to debug. try send tts via card player. see log i win this trouble. internal url set is wrong. change to valid and all work.
set log level stream to debug. try send tts via card player. see log i win this trouble. internal url set is wrong. change to valid and all work.
I enabled a debug mode log. Unable to play from ha to camera
Log:
Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/webrtc/media_player.py:74
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 17:40:10 (1 occurrences)
Last logged: 17:40:10
[3654340272]
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 199, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1820, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1857, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 216, in handle_service
await service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 798, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 977, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 838, in _handle_entity_call
await result
File "/config/custom_components/webrtc/media_player.py", line 74, in async_play_media
assert r.ok
AssertionError
Trying to play audio from go2rtc WebUI
Log docker go2rtc:
16:11:02.071 INF go2rtc version 1.3.2 linux/arm
16:11:02.071 INF [api] listen addr=:1984
16:11:02.072 INF [rtsp] listen addr=:8554
16:11:02.073 INF [srtp] listen addr=:8443
16:11:02.073 INF [webrtc] listen addr=:8555/tcp
16:11:41.301 ERR github.com/AlexxIT/go2rtc/cmd/webrtc/init.go:176 > error="SetRemoteDescription called with no ice-ufrag"
16:12:30.222 ERR github.com/AlexxIT/go2rtc/cmd/webrtc/init.go:176 > error="SetRemoteDescription called with no ice-ufrag"
Hello!
I also have a Tapo C200 camera and I’ve set it up as follows:
streams:
salon:
- rtsp://user:[email protected]:554/stream1
- tapo://user:[email protected]
The bi-directional audio works perfectly with go2rtc and the WebRTC card:
type: 'custom:webrtc-camera'
streams:
- url: salon
mode: webrtc
media: video,audio,microphone
I can also play sounds on my camera using curl:
curl --request POST \
--url 'https://frigate.example.com/live/webrtc/api/streams?dst=salon&src=ffmpeg:https://lasonotheque.org/UPLOAD/mp3/2954.mp3%23audio=pcma%23input=file'
However, I’m having trouble getting the virtual media player to work:
media_player:
- platform: webrtc
name: Caméra Salon
stream: salon
audio: pcma
I’m encountering the same error as @Roei639:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 230, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
response_data = await coro
File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
return await target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
return await service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
response_data = await _handle_entity_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
result = await task
File "/config/custom_components/webrtc/media_player.py", line 74, in async_play_media
assert r.ok
AssertionError
Can anyone help me resolve this issue? Thanks in advance!
@simon511000 all looks fine in your examples. I don't know why you getting this error. You can increase go2rtc log level to trace and check if you can see some requests from integration.
Thanks to the go2rtc debug logs, I was able to realize that the local IP I had configured on Home Assistant was incorrect. After correcting the IP, it works!
Thank you very much for your help!