okio-ai / nendo-platform

Nendo is an open source platform for AI-driven audio management, intelligence, and generation.
Other
108 stars 11 forks source link

Mashuper UI gets out of sync with play state #17

Closed jhurlbut closed 4 months ago

jhurlbut commented 4 months ago

The mute state of tracks can get out of sync with the state of the UI sometimes. Also when switching scenes the playback engine doesn't respect the current mute state of the UI

faradox commented 4 months ago

The current mute state of the UI is considered part of the scene and saved together with it, so that is expected behavior. As for the mute state getting out of sync, I was able to reproduce that bug and will be looking into it. Stay tuned

faradox commented 4 months ago

I just committed an alleged fix to the mashuper mute getting out of sync problem. I say "alleged" because I wasn't able to create the desynced state anymore after applying the fix but the nature of the problem makes it hard to tell whether it can not occur anymore or I was just not thorough enough on the testing. Please retrieve the latest version of Nendo using make update (and then make build if you are not running development mode) and see if you can still desync the mashuper. I you will, kindly let me know if you think the problem has been fixed for good :)

Happy jamming!

jhurlbut commented 4 months ago

With the latest code Mashuper won't work for me. I get this error:

06:30:00 [Job Quantize_0D1j1aFi_0]: exception raised while executing (handler.nendo_actions_handler.dockerized_func) nendo-server | Traceback (most recent call last): nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/rq/worker.py", line 1431, in perform_job nendo-server | rv = job.perform() nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/rq/job.py", line 1280, in perform nendo-server | self._result = self._execute() nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/rq/job.py", line 1317, in _execute nendo-server | result = self.func(*self.args, **self.kwargs) nendo-server | File "/home/nendo/nendo-server/nendo_server/./handler/nendo_actions_handler.py", line 179, in dockerized_func nendo-server | raise Exception(err_log) nendo-server | Exception: [' quantize(', ' File "run.py", line 17, in quantize', ' q_track = track.process("nendo_plugin_quantize_core", bpm=target_bpm)', "AttributeError: 'NoneType' object has no attribute 'process'", '']

jhurlbut commented 4 months ago

If I try to change the bpm I get this error:

nendo-postgres | 2024-03-01 06:35:13.404 UTC [34] ERROR: invalid input syntax for type uuid: "null" at character 353 nendo-postgres | 2024-03-01 06:35:13.404 UTC [34] STATEMENT: SELECT tracks.id AS tracks_id, tracks.user_id AS tracks_user_id, tracks.track_type AS tracks_track_type, tracks.visibility AS tracks_visibility, tracks.updated_at AS tracks_updated_at, tracks.created_at AS tracks_created_at, tracks.images AS tracks_images, tracks.resource AS tracks_resource, tracks.meta AS tracks_meta nendo-postgres | FROM tracks nendo-postgres | WHERE tracks.id = 'null'::UUID AND tracks.user_id = '085df796-cb6b-4251-9d17-758c720114e5'::uuid::UUID nendo-server | [2024-03-01T06:35:13.405Z] uvicorn.access INFO 172.28.1.2:35696 - "GET /api/mashuper/quantize/null?songbpm=121 HTTP/1.0" 500 nendo-gateway | 172.28.0.1 - - [01/Mar/2024:06:35:13 +0000] "GET /api/mashuper/quantize/null?songbpm=121 HTTP/1.1" 500 21 "http://localhost/collection/a13d38af-8a66-447e-a345-c06b569bf302" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" nendo-server | [2024-03-01T06:35:13.406Z] uvicorn.error ERROR Exception in ASGI application nendo-server | Traceback (most recent call last): nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1960, in _exec_single_context nendo-server | self.dialect.do_execute( nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 924, in do_execute nendo-server | cursor.execute(statement, parameters) nendo-server | psycopg2.errors.InvalidTextRepresentation: invalid input syntax for type uuid: "null" nendo-server | LINE 3: WHERE tracks.id = 'null'::UUID AND tracks.user_id = '085df79... nendo-server | ^ nendo-server | nendo-server | nendo-server | The above exception was the direct cause of the following exception: nendo-server | nendo-server | Traceback (most recent call last): nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 412, in run_asgi nendo-server | result = await app( # type: ignore[func-returns-value] nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in call nendo-server | return await self.app(scope, receive, send) nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/fastapi/applications.py", line 1054, in call nendo-server | await super().call(scope, receive, send) nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/starlette/applications.py", line 123, in call nendo-server | await self.middleware_stack(scope, receive, send) nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 186, in call nendo-server | raise exc nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 164, in call nendo-server | await self.app(scope, receive, _send) nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/starlette/middleware/cors.py", line 83, in call nendo-server | await self.app(scope, receive, send) nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/starlette/middleware/exceptions.py", line 62, in call nendo-server | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app nendo-server | raise exc nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app nendo-server | await app(scope, receive, sender) nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/starlette/routing.py", line 758, in call nendo-server | await self.middleware_stack(scope, receive, send) nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/starlette/routing.py", line 778, in app nendo-server | await route.handle(scope, receive, send) nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/starlette/routing.py", line 299, in handle nendo-server | await self.app(scope, receive, send) nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/starlette/routing.py", line 79, in app nendo-server | await wrap_app_handling_exceptions(app, request)(scope, receive, send) nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app nendo-server | raise exc nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app nendo-server | await app(scope, receive, sender) nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/starlette/routing.py", line 74, in app nendo-server | response = await func(request) nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/fastapi/routing.py", line 278, in app nendo-server | raw_response = await run_endpoint_function( nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/fastapi/routing.py", line 191, in run_endpoint_function nendo-server | return await dependant.call(**values) nendo-server | File "/home/nendo/nendo-server/nendo_server/apps/mashuper/routes.py", line 291, in get_quantized nendo-server | target_track = request.app.state.nendo_instance.library.get_track( nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/nendo/library/sqlalchemy_library.py", line 1298, in get_track nendo-server | track_db = query.one_or_none() nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 2753, in one_or_none nendo-server | return self._iter().one_or_none() # type: ignore nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 2826, in _iter nendo-server | result: Union[ScalarResult[_T], Result[_T]] = self.session.execute( nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 2306, in execute nendo-server | return self._execute_internal( nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 2191, in _execute_internal nendo-server | result: Result[Any] = compile_state_cls.orm_execute_statement( nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/sqlalchemy/orm/context.py", line 293, in orm_execute_statement nendo-server | result = conn.execute( nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1408, in execute nendo-server | return meth( nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 513, in _execute_on_connection nendo-server | return connection._execute_clauseelement( nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1630, in _execute_clauseelement nendo-server | ret = self._execute_context( nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1839, in _execute_context nendo-server | return self._exec_single_context( nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1979, in _exec_single_context nendo-server | self._handle_dbapi_exception( nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2335, in _handle_dbapi_exception nendo-server | raise sqlalchemy_exception.with_traceback(exc_info[2]) from e nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1960, in _exec_single_context nendo-server | self.dialect.do_execute( nendo-server | File "/home/nendo/.local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 924, in do_execute nendo-server | cursor.execute(statement, parameters) nendo-server | sqlalchemy.exc.DataError: (psycopg2.errors.InvalidTextRepresentation) invalid input syntax for type uuid: "null" nendo-server | LINE 3: WHERE tracks.id = 'null'::UUID AND tracks.user_id = '085df79... nendo-server | ^ nendo-server | nendo-server | [SQL: SELECT tracks.id AS tracks_id, tracks.user_id AS tracks_user_id, tracks.track_type AS tracks_track_type, tracks.visibility AS tracks_visibility, tracks.updated_at AS tracks_updated_at, tracks.created_at AS tracks_created_at, tracks.images AS tracks_images, tracks.resource AS tracks_resource, tracks.meta AS tracks_meta nendo-server | FROM tracks nendo-server | WHERE tracks.id = %(id_1)s::UUID AND tracks.user_id = %(user_id_1)s::UUID] nendo-server | [parameters: {'id_1': 'null', 'user_id_1': UUID('085df796-cb6b-4251-9d17-758c720114e5')}] nendo-server | (Background on this error at: https://sqlalche.me/e/20/9h9h) nendo-server | [2024-03-01T06:35:13.593Z] rq.queue DEBUG Getting jobs for queue 085df796-cb6b-4251-9d17-758c720114e5: 0 found. nendo-server | [2024-03-01T06:35:13.594Z] rq.queue DEBUG Getting jobs for queue 085df796-cb6b-4251-9d17-758c720114e5-gpu: 0 found. nendo-server | [2024-03-01T06:35:13.596Z] uvicorn.access INFO 172.28.1.2:35704 - "GET /api/actions/Quantize_sX2xbnOW_0 HTTP/1.0" 200 nendo-gateway | 172.28.0.1 - - [01/Mar/2024:06:35:13 +0000] "GET /api/actions/Quantize_sX2xbnOW_0 HTTP/1.1" 200 1269 "http://localhost/collection/a13d38af-8a66-447e-a345-c06b569bf302" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" nendo-server | [2024-03-01T06:35:14.613Z] rq.queue DEBUG Getting jobs for queue 085df796-cb6b-4251-9d17-758c720114e5: 0 found. nendo-server | [2024-03-01T06:35:14.615Z] rq.queue DEBUG Getting jobs for queue 085df796-cb6b-4251-9d17-758c720114e5-gpu: 0 found. nendo-server | [2024-03-01T06:35:14.620Z] uvicorn.access INFO 172.28.1.2:35708 - "GET /api/actions/Quantize_sX2xbnOW_0 HTTP/1.0" 200 nendo-gateway | 172.28.0.1 - - [01/Mar/2024:06:35:14 +0000] "GET /api/actions/Quantize_sX2xbnOW_0 HTTP/1.1" 200 1269 "http://localhost/collection/a13d38af-8a66-447e-a345-c06b569bf302" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"

faradox commented 4 months ago

I cannot reproduce the second error on my end, it' working fine for me. It seems however that you tried to change the bpm on a scene where one track was faulty (not loaded). Remove that channel and try again. The first issue was resolved in https://github.com/okio-ai/nendo-platform/issues/41

jhurlbut commented 4 months ago

Was able to test out mashuper again after https://github.com/okio-ai/nendo-platform/issues/41 The behavior is still somewhat erratic. Maybe I should create new tickets with specific reproducable notes

faradox commented 4 months ago

I assume that https://github.com/okio-ai/nendo-platform/issues/48 was the first new ticket in this direction and I just fixed that one. Please file another issue if you encounter more examples of the erratic behavior. Closing this thread for now