TI中文支持网
TI专业的中文技术问题搜集分享网站

请问如何向Android4.2系统中添加Miracast功能?

我使用的是BBB开发板,现在WiFi功能已基本集成完成,需要向开发板上集成Miracast功能,不知道要做哪些修改?

有无相关文档?谢谢

我网络上搜索到的文档很少

Ken Wang:

Qinghua,

   你用的是BBB加wifi芯片做的功能吗?用操作系统自带的协议栈还是CC3200内部的协议栈呢?

我们的CC3200支持wifi direct模式。

谢谢

Qinghua Zhu:

回复 Ken Wang:

是BBB加wifi芯片做的

wifi芯片是broadcom公司的

协议栈我不太清楚,应该是操作系统自带的吧

目前Android界面上还没有Miracast按钮

Qinghua Zhu:

回复 Ken Wang:

您的意思是说有些WiFi模块可能不支持wifi Direct模式是吗?

我用的Broadcom公司的bcm40181,产品是正基科技的 AP6181,应该也是支持wifi direct的

Qinghua Zhu:

回复 Ken Wang:

你好,我使用的bcm40181 的芯片,通过logcat看到如下日志:

——— beginning of /dev/log/system

W/SocketClient(   71): write error (Broken pipe)

——— beginning of /dev/log/main

I/AudioService(  323):  AudioFocus  abandonAudioFocus() from android.media.AudioManager@41fbcba8com.android.music.MediaPlaybackService$3@41fbb7c8

I/ActivityManager(  323): Start proc com.android.musicfx for broadcast com.android.musicfx/.ControlPanelReceiver: pid=844 uid=10041 gids={50041, 3003, 3002, 1028}

V/MusicFXControlPanelReceiver(  844): onReceive

V/MusicFXControlPanelReceiver(  844): Action: android.media.action.CLOSE_AUDIO_EFFECT_CONTROL_SESSION

V/MusicFXControlPanelReceiver(  844): Package name: com.android.music

V/MusicFXControlPanelReceiver(  844): Audio session: 4

V/MusicFXControlPanelEffect(  844): closeSession(android.app.ReceiverRestrictedContext@41fbe8b0, com.android.music, 4)

W/ThrottleService(  323): unable to find stats for iface rmnet0

W/SocketClient(   71): write error (Broken pipe)

D/dalvikvm(  425): GC_CONCURRENT freed 307K, 7% free 4693K/5028K, paused 6ms+22ms, total 177ms

W/SocketClient(   71): write error (Broken pipe)

D/dalvikvm(  425): GC_CONCURRENT freed 413K, 9% free 4691K/5136K, paused 6ms+24ms, total 142ms

W/SocketClient(   71): write error (Broken pipe)

D/dalvikvm(  323): GC_CONCURRENT freed 397K, 7% free 6311K/6744K, paused 8ms+30ms, total 281ms

D/dalvikvm(  425): GC_CONCURRENT freed 415K, 9% free 4682K/5136K, paused 6ms+24ms, total 133ms

D/dalvikvm(  425): GC_CONCURRENT freed 400K, 9% free 4694K/5136K, paused 6ms+22ms, total 123ms

W/audio_hw_primary(   76): out_write() limiting sleep time 165000 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 146666 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 128333 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 110000 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 91666 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 73333 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 55000 to 39909

W/InputMethodManagerService(  323): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@42230090 attribute=null, token = android.os.BinderProxy@421ea388

D/WifiP2pService(  323): InactiveState{ what=139283 when=0 arg2=1 }

D/WifiP2pService(  323): P2pEnabledState{ what=139283 when=-1ms arg2=1 }

D/WifiP2pService(  323): DefaultState{ what=139283 when=-1ms arg2=1 }

D/WifiP2pService(  323): InactiveState{ what=139287 when=0 arg2=2 }

D/WifiP2pService(  323): P2pEnabledState{ what=139287 when=-1ms arg2=2 }

D/WifiP2pService(  323): DefaultState{ what=139287 when=-1ms arg2=2 }

D/WifiP2pService(  323): InactiveState{ what=139265 when=-1ms arg2=3 }

D/WifiP2pService(  323): P2pEnabledState{ what=139265 when=-2ms arg2=3 }

D/WifiP2pService(  323): discovery change broadcast true

D/WifiP2pSettings(  425): Update device info: Device: Android_ce00

D/WifiP2pSettings(  425):  deviceAddress: 6c:fa:a7:70:f7:47

D/WifiP2pSettings(  425):  primary type: 10-0050F204-5

D/WifiP2pSettings(  425):  secondary type: null

D/WifiP2pSettings(  425):  wps: 0

D/WifiP2pSettings(  425):  grpcapab: 0

D/WifiP2pSettings(  425):  devcapab: 0

D/WifiP2pSettings(  425):  status: 3

D/WifiP2pSettings(  425):  wfdInfo: null

D/WifiP2pService(  323): InactiveState{ what=139326 when=-1ms arg2=4 }

D/WifiP2pService(  323): P2pEnabledState{ what=139326 when=-1ms arg2=4 }

D/WifiP2pService(  323): DefaultState{ what=139326 when=-2ms arg2=4 }

D/WifiP2pSettings(  425):  mConnectedDevices 0

D/WifiP2pSettings(  425):  group null

D/WifiP2pSettings(  425): Discovery state changed: 2

I/wpa_supplicant(  390): wlan0: P2P-FIND-STOPPED

D/WifiStateMachine(  323): DefaultState{ what=147493 when=-1ms }

D/WifiStateMachine(  323): message.what=147493

E/WifiStateMachine(  323): Error! unhandled message{ what=147493 when=-1ms }

D/dalvikvm(  323): GC_CONCURRENT freed 436K, 7% free 6326K/6796K, paused 7ms+12ms, total 129ms

D/dalvikvm(  405): GC_CONCURRENT freed 180K, 4% free 5238K/5444K, paused 15ms+23ms, total 141ms

D/WifiP2pService(  323): InactiveState{ what=139268 when=0 }

W/audio_hw_primary(   76): out_write() limiting sleep time 165000 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 146666 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 128333 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 110000 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 91666 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 73333 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 55000 to 39909

D/dalvikvm(  425): GC_CONCURRENT freed 358K, 9% free 4720K/5136K, paused 6ms+11ms, total 85ms

W/audio_hw_primary(   76): out_write() limiting sleep time 165000 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 146666 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 128333 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 110000 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 91666 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 73333 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 55000 to 39909

W/InputMethodManagerService(  323): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4224b970 attribute=null, token = android.os.BinderProxy@421ea388

D/WifiP2pService(  323): InactiveState{ what=139283 when=-1ms arg2=1 }

D/WifiP2pService(  323): P2pEnabledState{ what=139283 when=-8ms arg2=1 }

D/WifiP2pService(  323): DefaultState{ what=139283 when=-9ms arg2=1 }

D/WifiP2pService(  323): InactiveState{ what=139287 when=-1ms arg2=2 }

D/WifiP2pService(  323): P2pEnabledState{ what=139287 when=-4ms arg2=2 }

D/WifiP2pService(  323): DefaultState{ what=139287 when=-5ms arg2=2 }

D/WifiP2pSettings(  425): Update device info: Device: Android_ce00

D/WifiP2pSettings(  425):  deviceAddress: 6c:fa:a7:70:f7:47

D/WifiP2pSettings(  425):  primary type: 10-0050F204-5

D/WifiP2pSettings(  425):  secondary type: null

D/WifiP2pSettings(  425):  wps: 0

D/WifiP2pSettings(  425):  grpcapab: 0

D/WifiP2pSettings(  425):  devcapab: 0

D/WifiP2pSettings(  425):  status: 3

D/WifiP2pSettings(  425):  wfdInfo: null

D/WifiP2pSettings(  425): Discovery state changed: 2

D/WifiP2pService(  323): InactiveState{ what=139265 when=-2ms arg2=3 }

D/WifiP2pService(  323): P2pEnabledState{ what=139265 when=-10ms arg2=3 }

D/WifiP2pService(  323): InactiveState{ what=139326 when=-101ms arg2=4 }

D/WifiP2pService(  323): P2pEnabledState{ what=139326 when=-102ms arg2=4 }

D/WifiP2pService(  323): DefaultState{ what=139326 when=-103ms arg2=4 }

D/WifiP2pSettings(  425):  mConnectedDevices 0

D/WifiP2pSettings(  425):  group null

W/ThrottleService(  323): unable to find stats for iface rmnet0

W/SocketClient(   71): write error (Broken pipe)

I/wpa_supplicant(  390): wlan0: P2P-FIND-STOPPED

D/WifiStateMachine(  323): DefaultState{ what=147493 when=0 }

D/WifiStateMachine(  323): message.what=147493

E/WifiStateMachine(  323): Error! unhandled message{ what=147493 when=-1ms }

D/WifiService(  323): setWifiEnabled: false pid=425, uid=1000

D/WifiP2pService(  323): InactiveState{ what=131204 when=-1ms }

D/WifiHW  (  323): close sockets 1

D/WifiP2pService(  323): P2pEnabledState{ what=131204 when=-4ms }

D/WifiP2pService(  323): P2pDisablingState

D/CommandListener(   71): Clearing all IP addresses on wlan0

D/WifiP2pService(  323): P2pDisablingState{ what=147458 when=-25ms }

D/WifiP2pService(  323): p2p socket connection lost

D/WifiP2pService(  323): P2pDisabledState

I/wpa_supplicant(  390): p2p0: CTRL-EVENT-TERMINATING

I/wpa_supplicant(  390): CTRL_IFACE monitor[0]: 2 – No such file or directory

D/WifiStateMachine(  323): DefaultState{ what=147462 when=-10ms obj=android.net.wifi.StateChangeResult@421f5360 }

D/WifiStateMachine(  323): message.what=147462

D/BluetoothAdapter(  425): 1107029952: getState() :  mService = null. Returning STATE_OFF

I/wpa_supplicant(  390): wlan0: CTRL-EVENT-TERMINATING

D/BluetoothAdapter(  425): 1107029952: getState() :  mService = null. Returning STATE_OFF

D/dalvikvm(  539): GC_CONCURRENT freed 705K, 21% free 7285K/9144K, paused 5ms+7ms, total 78ms

D/WifiService(  323): setWifiEnabled: true pid=425, uid=1000

D/SoftapController(   71): Softap fwReload – Ok

D/CommandListener(   71): Setting iface cfg

D/CommandListener(   71): Trying to bring down wlan0

I/wpa_supplicant(  876): Successfully initialized wpa_supplicant

I/wpa_supplicant(  876): rfkill: Cannot open RFKILL control device

I/Choreographer(  425): Skipped 39 frames!  The application may be doing too much work on its main thread.

D/BluetoothAdapter(  425): 1107029952: getState() :  mService = null. Returning STATE_OFF

D/WifiP2pService(  323): P2pDisabledState{ what=143366 when=-1ms arg1=1 }

D/WifiP2pService(  323): DefaultState{ what=143366 when=-2ms arg1=1 }

D/WifiStateMachine(  323): DefaultState{ what=131089 when=-3ms arg1=1 }

D/WifiStateMachine(  323): message.what=131089

I/wpa_supplicant(  876): rfkill: Cannot open RFKILL control device

D/WifiP2pService(  323): P2pDisabledState{ what=131203 when=-1ms }

D/CommandListener(   71): Setting iface cfg

D/BluetoothAdapter(  425): 1107029952: getState() :  mService = null. Returning STATE_OFF

D/CommandListener(   71): Trying to bring up p2p0

D/WifiP2pService(  323): P2pEnablingState

D/WifiP2pService(  323): P2pEnablingState{ what=147457 when=-1ms }

D/WifiP2pService(  323): P2p socket connection successful

D/WifiP2pService(  323): P2pEnabledState

D/WifiP2pService(  323): sending p2p connection changed broadcast

D/WifiP2pService(  323): DeviceAddress: 6c:fa:a7:70:f7:47

D/WifiP2pService(  323): sending p2p persistent groups changed broadcast

D/WifiP2pService(  323): InactiveState

D/WifiP2pService(  323): InactiveState{ what=147462 when=-29ms obj=android.net.wifi.StateChangeResult@4223f438 }

D/WifiP2pService(  323): P2pEnabledState{ what=147462 when=-35ms obj=android.net.wifi.StateChangeResult@4223f438 }

D/WifiP2pService(  323): DefaultState{ what=147462 when=-44ms obj=android.net.wifi.StateChangeResult@4223f438 }

D/WifiP2pService(  323): InactiveState{ what=139283 when=-43ms arg2=5 }

D/WifiP2pService(  323): P2pEnabledState{ what=139283 when=-60ms arg2=5 }

D/WifiP2pService(  323): DefaultState{ what=139283 when=-66ms arg2=5 }

D/WifiP2pService(  323): InactiveState{ what=139287 when=-81ms arg2=6 }

D/WifiP2pService(  323): P2pEnabledState{ what=139287 when=-86ms arg2=6 }

D/WifiP2pService(  323): DefaultState{ what=139287 when=-97ms arg2=6 }

D/WifiP2pService(  323): InactiveState{ what=139265 when=-96ms arg2=7 }

D/WifiP2pService(  323): P2pEnabledState{ what=139265 when=-105ms arg2=7 }

D/WifiP2pSettings(  425): Update device info: Device: Android_ce00

D/WifiP2pSettings(  425):  deviceAddress: 6c:fa:a7:70:f7:47

D/WifiP2pSettings(  425):  primary type: 10-0050F204-5

D/WifiP2pSettings(  425):  secondary type: null

D/WifiP2pSettings(  425):  wps: 0

D/WifiP2pSettings(  425):  grpcapab: 0

D/WifiP2pSettings(  425):  devcapab: 0

D/WifiP2pSettings(  425):  status: 3

D/WifiP2pSettings(  425):  wfdInfo: null

D/WifiP2pService(  323): InactiveState{ what=139326 when=0 arg2=8 }

D/WifiP2pService(  323): P2pEnabledState{ what=139326 when=-1ms arg2=8 }

D/WifiP2pService(  323): DefaultState{ what=139326 when=-2ms arg2=8 }

D/WifiP2pSettings(  425):  mConnectedDevices 0

D/WifiP2pSettings(  425):  group null

D/dalvikvm(  323): GC_CONCURRENT freed 460K, 8% free 6331K/6824K, paused 8ms+52ms, total 514ms

I/wpa_supplicant(  876): wlan0: P2P-FIND-STOPPED

D/WifiP2pService(  323): InactiveState{ what=139268 when=0 }

D/WifiStateMachine(  323): DefaultState{ what=147493 when=-1ms }

D/WifiStateMachine(  323): message.what=147493

E/WifiStateMachine(  323): Error! unhandled message{ what=147493 when=-1ms }

W/audio_hw_primary(   76): out_write() limiting sleep time 165000 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 146666 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 128333 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 110000 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 91666 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 73333 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 55000 to 39909

D/dalvikvm(  425): GC_CONCURRENT freed 393K, 9% free 4722K/5156K, paused 7ms+43ms, total 282ms

I/Choreographer(  425): Skipped 36 frames!  The application may be doing too much work on its main thread.

W/audio_hw_primary(   76): out_write() limiting sleep time 165000 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 146666 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 128333 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 110000 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 91666 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 73333 to 39909

W/audio_hw_primary(   76): out_write() limiting sleep time 55000 to 39909

W/InputMethodManagerService(  323): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@421cc6c8 attribute=null, token = android.os.BinderProxy@421ea388

D/WifiP2pService(  323): InactiveState{ what=139283 when=-1ms arg2=1 }

D/WifiP2pService(  323): P2pEnabledState{ what=139283 when=-1ms arg2=1 }

D/WifiP2pService(  323): DefaultState{ what=139283 when=-2ms arg2=1 }

D/WifiP2pService(  323): InactiveState{ what=139287 when=0 arg2=2 }

D/WifiP2pService(  323): P2pEnabledState{ what=139287 when=-1ms arg2=2 }

D/WifiP2pService(  323): DefaultState{ what=139287 when=-1ms arg2=2 }

D/WifiP2pSettings(  425): Update device info: Device: Android_ce00

D/WifiP2pSettings(  425):  deviceAddress: 6c:fa:a7:70:f7:47

D/WifiP2pSettings(  425):  primary type: 10-0050F204-5

D/WifiP2pSettings(  425):  secondary type: null

D/WifiP2pSettings(  425):  wps: 0

D/WifiP2pSettings(  425):  grpcapab: 0

D/WifiP2pSettings(  425):  devcapab: 0

D/WifiP2pSettings(  425):  status: 3

D/WifiP2pSettings(  425):  wfdInfo: null

D/WifiP2pSettings(  425): Discovery state changed: 2

D/WifiP2pService(  323): InactiveState{ what=139265 when=0 arg2=3 }

D/WifiP2pService(  323): P2pEnabledState{ what=139265 when=-3ms arg2=3 }

D/WifiP2pService(  323): InactiveState{ what=139326 when=-94ms arg2=4 }

D/WifiP2pService(  323): P2pEnabledState{ what=139326 when=-95ms arg2=4 }

D/WifiP2pService(  323): DefaultState{ what=139326 when=-95ms arg2=4 }

D/WifiP2pSettings(  425):  mConnectedDevices 0

D/WifiP2pSettings(  425):  group null

I/wpa_supplicant(  876): wlan0: P2P-DEVICE-FOUND 9a:d6:f7:62:e6:10 p2p_dev_addr=9a:d6:f7:62:e6:10 pri_dev_type=10-0050F204-5 name='Nexus4' config_methods=0x188 dev_capab=0x25 group_capab=0x0

D/WifiStateMachine(  323): DefaultState{ what=147477 when=0 obj=Device: Nexus4

D/WifiStateMachine(  323):  deviceAddress: 9a:d6:f7:62:e6:10

D/WifiStateMachine(  323):  primary type: 10-0050F204-5

D/WifiStateMachine(  323):  secondary type: null

D/WifiStateMachine(  323):  wps: 392

D/WifiStateMachine(  323):  grpcapab: 0

D/WifiStateMachine(  323):  devcapab: 37

D/WifiStateMachine(  323):  status: 3

D/WifiStateMachine(  323):  wfdInfo: null }

D/WifiStateMachine(  323): message.what=147477

E/WifiStateMachine(  323): Error! unhandled message{ what=147477 when=-2ms obj=Device: Nexus4

E/WifiStateMachine(  323):  deviceAddress: 9a:d6:f7:62:e6:10

E/WifiStateMachine(  323):  primary type: 10-0050F204-5

E/WifiStateMachine(  323):  secondary type: null

E/WifiStateMachine(  323):  wps: 392

E/WifiStateMachine(  323):  grpcapab: 0

E/WifiStateMachine(  323):  devcapab: 37

E/WifiStateMachine(  323):  status: 3

E/WifiStateMachine(  323):  wfdInfo: null }

I/wpa_supplicant(  876): wlan0: P2P-DEVICE-LOST p2p_dev_addr=9a:d6:f7:62:e6:10

D/WifiStateMachine(  323): DefaultState{ what=147478 when=-1ms obj=Device:

D/WifiStateMachine(  323):  deviceAddress: 9a:d6:f7:62:e6:10

D/WifiStateMachine(  323):  primary type: null

D/WifiStateMachine(  323):  secondary type: null

D/WifiStateMachine(  323):  wps: 0

D/WifiStateMachine(  323):  grpcapab: 0

D/WifiStateMachine(  323):  devcapab: 0

D/WifiStateMachine(  323):  status: 4

D/WifiStateMachine(  323):  wfdInfo: null }

D/WifiStateMachine(  323): message.what=147478

E/WifiStateMachine(  323): Error! unhandled message{ what=147478 when=-2ms obj=Device:

E/WifiStateMachine(  323):  deviceAddress: 9a:d6:f7:62:e6:10

E/WifiStateMachine(  323):  primary type: null

E/WifiStateMachine(  323):  secondary type: null

E/WifiStateMachine(  323):  wps: 0

E/WifiStateMachine(  323):  grpcapab: 0

E/WifiStateMachine(  323):  devcapab: 0

E/WifiStateMachine(  323):  status: 4

E/WifiStateMachine(  323):  wfdInfo: null }

W/SocketClient(   71): write error (Broken pipe)

I/wpa_supplicant(  876): wlan0: P2P-FIND-STOPPED

D/WifiStateMachine(  323): DefaultState{ what=147493 when=-1ms }

D/WifiStateMachine(  323): message.what=147493

E/WifiStateMachine(  323): Error! unhandled message{ what=147493 when=-2ms }

I/dalvikvm(  323): Jit: resizing JitTable from 4096 to 8192

D/dalvikvm(  323): GC_CONCURRENT freed 440K, 8% free 6342K/6824K, paused 13ms+13ms, total 125ms

其中 Nexus4是我的手机,从日志来看BBB开发板已经发现我的手机了,可以BBB开发板的Android的wifi direct 界面却看不到我的手机,而且从Nexus4端发送邀请,BBB的Android界面也无反应,不知道是哪里的问题?

Terry Y:

回复 Qinghua Zhu:

你好,BBB目前搭配的是TI WL18xx系列的WIFI产品,具体可以参考:

http://processors.wiki.ti.com/index.php/WL18xx_First_Time_Getting_Started_Guide_(Beaglebone)

而您用的是BRCM的WIFI芯片,所以请更换至TI产品,谢谢。

赞(0)
未经允许不得转载:TI中文支持网 » 请问如何向Android4.2系统中添加Miracast功能?
分享到: 更多 (0)