Skip to content

fix: stabilize exclusive USB sample rate and volume - #355

Merged
ajisth69 merged 1 commit into
Clash-Projects:mainfrom
rahul0x00:usb-exclusive-audio-fix
Oct 19, 2026
Merged

ajisth69 merged 1 commit into
Clash-Projects:mainfrom
rahul0x00:usb-exclusive-audio-fix

Conversation

@rahul0x00

Copy link
Copy Markdown
Contributor

Fix USB sample-rate fallback selection and continuous-rate parsing. Prevent duplicate software gain on resampled USB playback and correct signed PCM16 scaling. Add regression tests for rate ranges and gain handling.

@ajisth69

Copy link
Copy Markdown
Member

@rahul0x00 have u verified it properly bro ?

@rahul0x00

Copy link
Copy Markdown
Contributor Author

yep, works perfectly on my device

@ajisth69
ajisth69 merged commit ad0f765 into Clash-Projects:main Oct 19, 2026
@Hk-178

Hk-178 commented Oct 19, 2026 •

Copy link
Copy Markdown

@ajisth69 i have kz zsn pro x with an upgraded dac cable . So i have it the permissions. I don't properly know what settings make the problem but for the when it asking for the permission to access it's dac, some cracking sound is breaking my ears
It's like a cd stuck and tryna rotate. It's annoying. I will attach what now turned on and it's kinda working. Idk if I did it right but I wanna say it to you
The update yesterday brought the issue. A version before it was okay without any issue .
IMG_20261019_150948

Also , now there is a random increase and decrease of loudness on songs while loudness normalisation is turned on for tracks . especially bit perfect audio, connected to dac . I specifically didn't had any issues without the DAC 🤷🏻‍♂️

I will quote the usb log while given permission and without permission
"LastWave USB diagnostic
active=true wanted=true rate=48000 clockMatched=true hardwareVolume=false forceSoftwareVolume=true
started rate=48000Hz alt=1 wireBits=16 reported=48000 clockMatched=true fallback=false hardwareVolume=false maxPacket=388 interval=1 feedback=false
device=KZ Acoustics M2 vid=0x31b2 pid=0x311 uac=100 playbackIface=2 speed=full
alt=1 bits=16 container=16 rates=44100/48000/88200/96000
alt=2 bits=24 container=24 rates=44100/88200/48000/96000
findAltSetting(bits=16, rate=48000) -> alt=1 wireBits=16
setSampleRate(48000) UAC1 endpoint: OK
readSampleRate UAC1 endpoint: 48000 Hz
descriptors(347 B):
1201000200000040b23111030300010402010902490104010080310904000000
010100000a2401000147000201020c2402010102000101000000092406020101
0102000924030401010002000c24020501010002030000000a24060705010102
0200092403080203000700090401000001020000090401010101020000072401
040101000b2402010102100180bb000905840562000100000725010100000009
0401020101020000072401040101000b2402010103180180bb00090584059300
0100000725010100000009040200000102000009040201010102000007240105
010100142402010202100444ac0080bb00885801007701090504058401010000
0725010100000009040202010102000007240105010100142402010203180444
ac0088580180bb00007701090504054602010000072501010000000904030002
030000000921110100012246000705830310000107050303100001"

Without :
"LastWave USB diagnostic
active=false wanted=false rate=0 clockMatched=false hardwareVolume=false forceSoftwareVolume=true

Also when the bit perfect audio is turned on , the audio streaming is being stuck sometimes even when the internet connection is very stable
It happens with and without IEM DAC

@rahul0x00

rahul0x00 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

@Hk-178, disable the software volume, it's buggy as of now i think and if it still doesn't work, try this patch and see if it works or not
https://github.com/Clash-Projects/LastWave-Native/actions/runs/39215659660/artifacts/12170236898

@Hk-178

Hk-178 commented Oct 19, 2026 •

Copy link
Copy Markdown

@rahul0x00 thanks for your help , i will check😌

@rahul0x00 also it would be very good of an option if there was detailed description of what all the settings does
As a common person with somewhat knowledge I am unable to fully understand what these options stand for

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants