Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lag on spicetify only on the home page. #3266

Closed
2 tasks done
kk-spartans opened this issue Jan 9, 2025 · 8 comments
Closed
2 tasks done

Lag on spicetify only on the home page. #3266

kk-spartans opened this issue Jan 9, 2025 · 8 comments
Labels
πŸ› bug Something isn't working

Comments

@kk-spartans
Copy link

kk-spartans commented Jan 9, 2025

πŸ” Have you checked Spicetify.app page for your issue?

  • I have checked the FAQ

πŸ” Is there already an issue for your problem?

  • I have checked older issues, open and closed

β„Ή Environment / Computer Info

Spotify for Windows (64 bit): 1.2.53.440.g7b2f582a
Spicetify v2.38.7

Windows 11 22H2
Intel I5 6600T
24 GB DDR4 2333MZH RAM
Integrated Graphics (Intel HD 530)

πŸ“ Description

I have extreme lag while scrolling, but only on the homepage. Other animations like hovering over a song play completely smoothly, I've tried uninstalling the theme i have and just using the default one, no help. I also know it's not because my computer's slow, the animation that plays while hovering over a song works fine. I found an older, unanswered issue on this: #207.

πŸ“Έ Screenshots

2025-01-09_20-06-21.mp4
@kk-spartans kk-spartans added the πŸ› bug Something isn't working label Jan 9, 2025
@rxri
Copy link
Member

rxri commented Jan 9, 2025

Theme issue most likely. Not related to spicetify itself. Also you're using iGPU while spotify is laggy on these also

@rxri rxri closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2025
@amd64fox
Copy link

amd64fox commented Jan 9, 2025

similar to this one

this is most likely a native client issue, try disabling enableHomeCarousels in exp features

@kk-spartans
Copy link
Author

Spotify was completely fine before I installed spicetify, the animations for hovering over songs and podcasts aren't laggy at all along with every page except home. I've also tried every theme on the store along with not using a theme.

@machinemessiah
Copy link
Contributor

Try this.

( function delusoire() {
	// @why - push a dummy entry to jailbreak webpack's require method so we can use it below
	const webpackRequire = globalThis.webpackChunkclient_web.push(
		[
			[Symbol()], // @what - a unique identifier for our "chunk"; it doesn't need to do anything but be a Symbol
			{}, // @what - the content of this new chunk/module...but we aren't actually adding a real one, we just need the correct type
			require => require // @what - this is what we're really after, we are pushing this whole array just so the return value is a call to webpack's require method
		]
	);

	const moduleEntries = Object.entries( webpackRequire.m );
	const modules = moduleEntries.map( ( [id] ) => webpackRequire( id ) );
	const [module, key, value] = modules
		.flatMap( module => {
			const keys = Object.keys( module );
			if ( keys.length !== 1 ) {
				return [];
			}
			const key = keys[0];
			const value = module[key];
			if ( typeof value !== "function" ) {
				return [];
			}
			const functionString = value.toString();
			if ( !functionString.includes( "scrollNodeRef" ) || !functionString.includes( "executeOnceOnStart" ) ) {
				return [];
			}
			return [[module, key, value]];
		} )[0];

	Object.defineProperty( module, key, {
		enumerable: true,
		get: () => function ( arg1, arg2 ) {
			if ( arg1.toString().includes( "--top-bar-opacity" ) ) {
				arg2.disabled = true;
			}
			return value( arg1, arg2 );
		},
	} );
} )();

Also, at the top of spicetifyWrapper.js you'll need to add the following:

const nativeObjectDefineProperty = Object.defineProperty;

Object.defineProperty = function ( obj, prop, descriptor ) {
	if ( prop !== "prototype" && descriptor ) {
		descriptor.configurable = descriptor.configurable ?? true;
	}
	return nativeObjectDefineProperty( obj, prop, descriptor );
};

None of this code is mine (well, other than the comments), this piece of magic was performed by my second favouite wizard @Delusoire

@kk-spartans
Copy link
Author

I'm sorry if I look stupid, but where am I supposed to put the first peice of javascript code?

Try this.

( function delusoire() {
	// @why - push a dummy entry to jailbreak webpack's require method so we can use it below
	const webpackRequire = globalThis.webpackChunkclient_web.push(
		[
			[Symbol()], // @what - a unique identifier for our "chunk"; it doesn't need to do anything but be a Symbol
			{}, // @what - the content of this new chunk/module...but we aren't actually adding a real one, we just need the correct type
			require => require // @what - this is what we're really after, we are pushing this whole array just so the return value is a call to webpack's require method
		]
	);

	const moduleEntries = Object.entries( webpackRequire.m );
	const modules = moduleEntries.map( ( [id] ) => webpackRequire( id ) );
	const [module, key, value] = modules
		.flatMap( module => {
			const keys = Object.keys( module );
			if ( keys.length !== 1 ) {
				return [];
			}
			const key = keys[0];
			const value = module[key];
			if ( typeof value !== "function" ) {
				return [];
			}
			const functionString = value.toString();
			if ( !functionString.includes( "scrollNodeRef" ) || !functionString.includes( "executeOnceOnStart" ) ) {
				return [];
			}
			return [[module, key, value]];
		} )[0];

	Object.defineProperty( module, key, {
		enumerable: true,
		get: () => function ( arg1, arg2 ) {
			if ( arg1.toString().includes( "--top-bar-opacity" ) ) {
				arg2.disabled = true;
			}
			return value( arg1, arg2 );
		},
	} );
} )();

Also, at the top of spicetifyWrapper.js you'll need to add the following:

const nativeObjectDefineProperty = Object.defineProperty;

Object.defineProperty = function ( obj, prop, descriptor ) {
	if ( prop !== "prototype" && descriptor ) {
		descriptor.configurable = descriptor.configurable ?? true;
	}
	return nativeObjectDefineProperty( obj, prop, descriptor );
};

None of this code is mine (well, other than the comments), this piece of magic was performed by my second favouite wizard @Delusoire

@kk-spartans
Copy link
Author

similar to this one

this is most likely a native client issue, try disabling enableHomeCarousels in exp features

This fixed it, mostly. It still lags at the top of the homepage, maybe my computer's just slow.

@realazizk
Copy link

@kk-spartans maybe you can try my fix (it's a spotify issue, not related to spicetify) https://youtu.be/YNVdA2XbaJ0

@kk-spartans
Copy link
Author

@kk-spartans maybe you can try my fix (it's a spotify issue, not related to spicetify) https://youtu.be/YNVdA2XbaJ0

Turning off enableHomeCarousels reduced a bit, but this made it as smooth as it was without spicetify. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
πŸ› bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants