itsecholot / real-stereo-extended Goto Github PK
View Code? Open in Web Editor NEWBachelor thesis at ZHAW
Bachelor thesis at ZHAW
When I start the backend on my second Pi the following happens:
Config config.json does not exist, creating default configuration
Starting as NodeType.UNCONFIGURED
[Cluster Slave] Listening on port 5605
[Web API] Listening on http://localhost:8080
But after I check with ls
:
README.md install.sh poetry.toml src
assets poetry.lock pyproject.toml start.sh
The file seems to be missing...
Deleting a node deletes it from the config.json file, but it is somehow still present in the memory. Adding a new node with the same name is not possible and the id of the new node is 3 instead of 2. So the deleted node probably still has a reference somewhere.
If the selected speakers aren't in a group when starting calibration, we should force-add them to one. Else the calibration won't work properly.
Sometimes, two rects are intersecting (most of the time the smaller one is fully enclosed within the bigger one). This should not happen as these are handled like two people.
The backend fails to start without the frontend/build/static
directory in place. I'm not sure if this should be classified as a bug but it gets in the way when developing and thus using create-react-app
scripts for serving.
No directory exists at '/workspaces/real-stereo-extended/frontend/build/static'
File "/workspaces/real-stereo-extended/backend/src/api/manager.py", line 36, in __init__
self.app.add_routes([
File "/workspaces/real-stereo-extended/backend/src/__main__.py", line 10, in <module>
api = ApiManager('master', tracking)
Remove the calibration points when a new node/speaker gets assigned to a room or when a node/speaker gets removed from a room. This ensures that the room is always calibrated for the correct nodes and speakers.
Additionally, display an error when balancing gets enabled and a room is not yet calibrated. So, users are no longer wondering why nothing happens when they forgot to calibrate a room.
When calibrating the room or using the test mode it takes "ages" till the calibration sound is actually being played by the sonos speakers.
After taking a closer look at it, I'm pretty certain it's actually the calibration sound mp3 get request that is somehow stuck for some time. Something is probably blocking it, like we discussed.
This gets even worse probably if the the speaker has also been calibrated...
Currently it's fixed at 25, we should add a slider and let the user decide at which volume he wants to calibrate (allows for bigger and smaller rooms).
As mentioned in #53, we should allow the user to change the volume at which the audio balancing should take place. Either through the webapp, or by listening to volume change events emitted by the Sonos group coordinator (this way native volume controls could be possible, but how can we differentiate from our own volume change events from balancing?).
The first position works correctly but when coming to the second position, the following problem occurs.
The noise on the first speaker is only played for a few milliseconds, after that, it is completely silent. Because of this, the recorded volume for speaker 1 is 0%. When it tries to play it on the second speaker after some seconds, it gets played on both speakers at the same time.
The speakers are configured as a stereo pair.
The interpolation preview during calibration has a red background, making it really hard to see the cross of your own position.
In the code, I see that it should somehow be random, but it was now red in 4 consecutive calibrations and for both speakers.
The following exception occurs when adding the master node and assigning it to a room. Interestingly the config file gets correctly updated. But because of the exception no Acknowledgement
gets sent to the client so the exception isn't visible to the user at all and it appears to be loading indefinitely.
Is this maybe because the master tries to update the slave but this fails because the master itself is the slave in this instance?
Task exception was never retrieved
future: <Task finished name='Task-60' coro=<AsyncServer._handle_event_internal() done, defined at /workspaces/real-stereo-extended/backend/.venv/lib/python3.9/site-packages/socketio/asyncio_server.py:492> exception=ConnectionRefusedError(111, 'Connection refused')>
Traceback (most recent call last):
File "/workspaces/real-stereo-extended/backend/.venv/lib/python3.9/site-packages/socketio/asyncio_server.py", line 494, in _handle_event_internal
r = await server._trigger_event(data[0], namespace, sid, *data[1:])
File "/workspaces/real-stereo-extended/backend/.venv/lib/python3.9/site-packages/socketio/asyncio_server.py", line 530, in _trigger_event
return await self.namespace_handlers[namespace].trigger_event(
File "/workspaces/real-stereo-extended/backend/.venv/lib/python3.9/site-packages/socketio/asyncio_namespace.py", line 37, in trigger_event
ret = await handler(*args)
File "/workspaces/real-stereo-extended/backend/src/api/controllers/nodes.py", line 100, in on_update
self.config.node_repository.call_listeners()
File "/workspaces/real-stereo-extended/backend/src/repositories/repository.py", line 20, in call_listeners
listener()
File "/workspaces/real-stereo-extended/backend/src/protocol/master/node_registry.py", line 54, in update_acquisition_status
self.master.send_acquisition(node.ip_address)
File "/workspaces/real-stereo-extended/backend/src/protocol/master/master.py", line 85, in send_acquisition
self.get_slave_socket(address).sendall(message.SerializeToString())
File "/workspaces/real-stereo-extended/backend/src/protocol/master/master.py", line 48, in get_slave_socket
slave_socket.connect((address, PORT))
ConnectionRefusedError: [Errno 111] Connection refused
When balancing gets enabled, the camera node sometimes doesn't start the tracking.
A log message from the camera node that may be related to this:
May 7 12:18:09 rse-E00F36162A27DB49 env[549]: [Cluster Slave] Acquired by 192.168.1.213
May 7 12:18:09 rse-E00F36162A27DB49 env[549]: [Cluster Slave] 192.168.1.213 is offline
May 7 12:18:09 rse-E00F36162A27DB49 env[549]: [Cluster Slave] Released by 192.168.1.213
It looks like it detected the master as offline in the same second as the node was acquired. Since it was released again, it did not accept the following service update messages.
If multiple windows of real-stereo-extended are open, the enable balancing toggle doesn't get synced properly.
When switching between nodes (e.g. from /nodes/1
to /nodes/2
using the navigation menu), the camera stream and information (like hostname, IP, status) gets updated, but the form still contains the data from the previous node.
So, clicking on save would overwrite the second node with the data from the first node.
Reloading or directly navigating to a nested route like /rooms/edit
results in a 404: Not Found
error.
When I try to start the calibration for a new room and click on "Next position" for the first time, the following errors get thrown and the real-stereo process crashes. (I was successfully detected in both cameras, so that can't be the reason)
task: <Task finished coro=<RequestHandler._handle_request() done, defined at /home/pi/.local/lib/python3.7/site-packages/aiohttp/web_protocol.py:413> exception=RuntimeError('Missing return statement on request handler')>
Traceback (most recent call last):
File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "/home/pi/real-stereo-extended/backend/src/__main__.py", line 39, in main
networking.initial_check(),
File "/home/pi/real-stereo-extended/backend/src/balancing/manager.py", line 40, in start_control
await self.sonos.control_loop()
File "/home/pi/real-stereo-extended/backend/src/balancing/sonos.py", line 58, in control_loop
command.run(self.sonos_adapter)
File "/home/pi/real-stereo-extended/backend/src/balancing/sonos_command.py", line 56, in run
sonos_adapter.play_calibration_sound(speaker)
File "/home/pi/real-stereo-extended/backend/src/sonos/adapter_soco.py", line 79, in play_calibration_sound
soco_instance.play_uri(uri=self.calibration_sound_uri, title='RS Calibration Sound')
File "/home/pi/.local/lib/python3.7/site-packages/soco/core.py", line 122, in inner_function
return function(self, *args, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/soco/core.py", line 706, in play_uri
return self.play()
File "/home/pi/.local/lib/python3.7/site-packages/soco/core.py", line 122, in inner_function
return function(self, *args, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/soco/core.py", line 620, in play
self.avTransport.Play([("InstanceID", 0), ("Speed", 1)])
File "/home/pi/.local/lib/python3.7/site-packages/soco/services.py", line 207, in _dispatcher
return self.send_command(action, *args, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/soco/services.py", line 503, in send_command
self.handle_upnp_error(response.text)
File "/home/pi/.local/lib/python3.7/site-packages/soco/services.py", line 562, in handle_upnp_error
error_xml=xml_error,
soco.exceptions.SoCoUPnPException: UPnP Error 701 received: Transition not available from 192.168.1.73
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 580, in finish_response
prepare_meth = resp.prepare
AttributeError: 'NoneType' object has no attribute 'prepare'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 485, in start
resp, reset = await task
File "/home/pi/.local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 440, in _handle_request
reset = await self.finish_response(request, resp, start_time)
File "/home/pi/.local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 583, in finish_response
raise RuntimeError("Missing return " "statement on request handler")
RuntimeError: Missing return statement on request handler
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/pi/real-stereo-extended/backend/src/__main__.py", line 63, in <module>
asyncio.run(main())
File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "/home/pi/real-stereo-extended/backend/src/__main__.py", line 39, in main
networking.initial_check(),
File "/home/pi/real-stereo-extended/backend/src/balancing/manager.py", line 40, in start_control
await self.sonos.control_loop()
File "/home/pi/real-stereo-extended/backend/src/balancing/sonos.py", line 58, in control_loop
command.run(self.sonos_adapter)
File "/home/pi/real-stereo-extended/backend/src/balancing/sonos_command.py", line 56, in run
sonos_adapter.play_calibration_sound(speaker)
File "/home/pi/real-stereo-extended/backend/src/sonos/adapter_soco.py", line 79, in play_calibration_sound
soco_instance.play_uri(uri=self.calibration_sound_uri, title='RS Calibration Sound')
File "/home/pi/.local/lib/python3.7/site-packages/soco/core.py", line 122, in inner_function
return function(self, *args, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/soco/core.py", line 706, in play_uri
return self.play()
File "/home/pi/.local/lib/python3.7/site-packages/soco/core.py", line 122, in inner_function
return function(self, *args, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/soco/core.py", line 620, in play
self.avTransport.Play([("InstanceID", 0), ("Speed", 1)])
File "/home/pi/.local/lib/python3.7/site-packages/soco/services.py", line 207, in _dispatcher
return self.send_command(action, *args, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/soco/services.py", line 503, in send_command
self.handle_upnp_error(response.text)
File "/home/pi/.local/lib/python3.7/site-packages/soco/services.py", line 562, in handle_upnp_error
error_xml=xml_error,
soco.exceptions.SoCoUPnPException: UPnP Error 701 received: Transition not available from 192.168.1.73
Did you experience something similar to this or have an idea why this could happen?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.