-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBthA2dpCodec.cmd
32 lines (29 loc) · 1.22 KB
/
BthA2dpCodec.cmd
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
@echo off
setlocal
rem Validate that we are running with an elevated token (admin)
fsutil dirty query %SYSTEMDRIVE% > NUL
if %ERRORLEVEL% EQU 0 goto elevated
echo %0 must be run at an elevated command prompt
goto :eof
:elevated
rem curl -o BluetoothStack.wprp https://raw.githubusercontent.com/microsoft/busiotools/master/bluetooth/tracing/BluetoothStack.wprp
rem Microsoft.Windows.Bluetooth.BthA2dp, 8776ad1e-5022-4451-a566-f47e708b9075
set TRACEPATH=%TEMP%
set TRACENAME=BthA2DPTrace
set TRACEETLNAME=%TRACEPATH%\%TRACENAME%.etl
set TRACETXTNAME=%TRACEPATH%\%TRACENAME%.txt
netsh trace start report=disabled perfMerge=no provider={8776ad1e-5022-4451-a566-f47e708b9075} overwrite=yes traceFile="%TRACEETLNAME%"
echo Start your audio stream
pause
netsh trace stop
netsh trace convert input="%TRACEETLNAME%" output="%TRACETXTNAME%" dump=TXT overwrite=yes
find "A2dpStreaming" %TRACETXTNAME% > NUL
if %ERRORLEVEL% EQU 0 goto rendered
rem Win10 apparently doesn't have the manifest to render, so just dump all events from BthA2dp
type %TRACETXTNAME% | findstr Microsoft.Windows.Bluetooth.BthA2dp
goto dumpdone
:rendered
type %TRACETXTNAME% | findstr \"A2dpStreaming\"
:dumpdone
del %TRACEETLNAME%
del %TRACETXTNAME%