-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbluetooth.ps1
39 lines (30 loc) · 1.52 KB
/
bluetooth.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Fix Bluetooth Audio Skipping
# Run as Administrator
Write-Host "Fixing Bluetooth Audio Issues..." -ForegroundColor Cyan
# Restart Bluetooth Service
Write-Host "Restarting Bluetooth Services..." -ForegroundColor Yellow
Get-Service -Name bthserv | Restart-Service -Force
Start-Sleep -Seconds 3
# Disable Bluetooth Power Management (Prevents Windows from reducing Bluetooth performance)
Write-Host "Disabling Bluetooth Power Management..." -ForegroundColor Yellow
$bluetoothDevices = Get-PnpDevice | Where-Object { $_.FriendlyName -match "Bluetooth" }
foreach ($device in $bluetoothDevices) {
$deviceID = $device.InstanceId
$regPath = "HKLM:\SYSTEM\CurrentControlSet\Enum\$deviceID\Device Parameters"
if (Test-Path $regPath) {
Set-ItemProperty -Path $regPath -Name "EnhancedPowerManagementEnabled" -Value 0
}
}
# Ensure High-Performance Power Plan is Active
Write-Host "Setting High-Performance Power Plan..." -ForegroundColor Yellow
powercfg /S SCHEME_MIN
# Increase Audio Buffer Size for Bluetooth
Write-Host "Increasing Audio Buffer Size..." -ForegroundColor Yellow
$regPath = "HKLM:\SOFTWARE\Microsoft\Bluetooth\Audio\AVRCP\CT"
if (-not (Test-Path $regPath)) { New-Item -Path $regPath -Force | Out-Null }
Set-ItemProperty -Path $regPath -Name "MetadataTimeout" -Value 5000
# Restart Audio Service
Write-Host "Restarting Audio Service..." -ForegroundColor Yellow
Restart-Service -Name "Audiosrv" -Force
Start-Sleep -Seconds 2
Write-Host "Bluetooth Audio Fix Applied! Try playing audio again." -ForegroundColor Green