Skip to content

Commit 993f78b

Browse files
committed
fix the issue of rpi4/5 wifi connection
1 parent 1569f45 commit 993f78b

File tree

100 files changed

+2081
-96899
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+2081
-96899
lines changed

baseboard-rpi3/media-sound/adhd/adhd-0.0.6-r2699.ebuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ DEPEND="
5252
"
5353

5454
src_prepare() {
55-
eapply $FILESDIR/*.patch
55+
# eapply $FILESDIR/*.patch
5656
cd cras || die
5757
eautoreconf
5858
default
Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,42 @@
1-
Index: adhd/cras/src/server/audio_thread.c
2-
===================================================================
3-
--- adhd.orig/cras/src/server/audio_thread.c
4-
+++ adhd/cras/src/server/audio_thread.c
5-
@@ -905,6 +905,9 @@ static void* audio_io_thread(void* arg)
1+
--- a/cras/src/server/audio_thread.c
2+
+++ b/cras/src/server/audio_thread.c
3+
@@ -905,6 +905,9 @@
64
check_busyloop(wait_ts);
75
}
86

9-
+ if (wait_ts && wait_ts->tv_sec == 0 && wait_ts->tv_nsec == 0)
10-
+ wait_ts->tv_sec = 1;
11-
+
7+
+ if (wait_ts && wait_ts->tv_sec == 0 && wait_ts->tv_nsec == 0) {
8+
+ wait_ts->tv_sec = 1;
9+
+ }
1210
// Sync atlog with shared memory.
1311
__sync_synchronize();
1412
atlog->sync_write_pos = atlog->write_pos;
15-
Index: adhd/cras/src/tools/cras_monitor/cras_monitor.c
16-
===================================================================
17-
--- adhd.orig/cras/src/tools/cras_monitor/cras_monitor.c
18-
+++ adhd/cras/src/tools/cras_monitor/cras_monitor.c
19-
@@ -154,11 +154,19 @@ static void input_node_gain_changed(void
13+
--- a/cras/src/tools/cras_monitor/cras_monitor.c
14+
+++ b/cras/src/tools/cras_monitor/cras_monitor.c
15+
@@ -154,11 +154,19 @@
2016
free((void*)node_name);
2117
}
2218

2319
+uint32_t last_active_streams = 0;
2420
static void num_active_streams_changed(void* context,
2521
enum CRAS_STREAM_DIRECTION dir,
2622
uint32_t num_active_streams) {
27-
+ struct cras_client *client = (struct cras_client *)context;
23+
+ struct cras_client *client = (struct cras_client *)context;
2824
printf("num active %s streams: %u\n", string_for_direction(dir),
2925
num_active_streams);
30-
+ if (last_active_streams == 0 && num_active_streams == 1) {
31-
+ cras_client_set_suspend(client, 1);
32-
+ usleep(5000);
33-
+ cras_client_set_suspend(client, 0);
34-
+ }
35-
+ last_active_streams = num_active_streams;
26+
+ if (last_active_streams == 0 && num_active_streams == 1) {
27+
+ cras_client_set_suspend(client, 1);
28+
+ usleep(5000);
29+
+ cras_client_set_suspend(client, 0);
30+
+ }
31+
+ last_active_streams = num_active_streams;
3632
}
3733

3834
static void server_connection_callback(struct cras_client* client,
39-
@@ -289,6 +297,7 @@ int main(int argc, char** argv) {
35+
@@ -289,6 +297,7 @@
4036
if (rc < 0 || c == 'q') {
4137
return 0;
4238
}
43-
+ sleep(1);
39+
+ sleep(1);
4440
}
4541

4642
destroy_exit:
Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
Index: adhd/cras/src/server/cras_alsa_io.c
2-
===================================================================
3-
--- adhd.orig/cras/src/server/cras_alsa_io.c
4-
+++ adhd/cras/src/server/cras_alsa_io.c
5-
@@ -256,6 +256,11 @@ static const struct {
1+
--- a/cras/src/server/cras_alsa_io.c
2+
+++ b/cras/src/server/cras_alsa_io.c
3+
@@ -256,6 +256,11 @@
64
.type = CRAS_NODE_TYPE_ALSA_LOOPBACK,
75
.position = NODE_POSITION_INTERNAL,
86
},
@@ -14,24 +12,30 @@ Index: adhd/cras/src/server/cras_alsa_io.c
1412
};
1513

1614
static int set_hwparams(struct cras_iodev* iodev) {
17-
@@ -2373,7 +2378,7 @@ int alsa_iodev_legacy_complete_init(stru
15+
@@ -928,6 +933,7 @@
16+
17+
node->volume = 100;
18+
node->type = CRAS_NODE_TYPE_UNKNOWN;
19+
+ syslog(LOG_INFO, "test node:%s", node->name);
20+
// Go through the known names
21+
for (i = 0; i < ARRAY_SIZE(node_defaults); i++) {
22+
if (!strncmp(node->name, node_defaults[i].name,
23+
@@ -2373,7 +2379,7 @@
1824
!no_create_default_output_node(aio)) {
1925
if (first_internal_device(aio) && !has_node(aio, INTERNAL_SPEAKER) &&
2026
!has_node(aio, HDMI)) {
2127
- if (strstr(aio->base.info.name, HDMI)) {
22-
+ if (strstr(aio->base.info.name, HDMI) || strstr(aio->base.info.name, "hdmi")) {
28+
+ if (strstr(aio->base.info.name, HDMI) || strstr(aio->base.info.name, "hdmi")) {
2329
new_output(aio, NULL, HDMI);
2430
} else {
2531
new_output(aio, NULL, INTERNAL_SPEAKER);
26-
Index: adhd/cras/src/server/cras_alsa_io_common.c
27-
===================================================================
28-
--- adhd.orig/cras/src/server/cras_alsa_io_common.c
29-
+++ adhd/cras/src/server/cras_alsa_io_common.c
32+
--- a/cras/src/server/cras_alsa_io_common.c
33+
+++ b/cras/src/server/cras_alsa_io_common.c
3034
@@ -14,16 +14,17 @@
3135

3236
struct cras_ionode* first_plugged_node(struct cras_iodev* iodev) {
3337
struct cras_ionode* n;
34-
+ struct cras_ionode *result = NULL;
38+
+ struct cras_ionode *result = NULL;
3539

3640
/* When this is called at iodev creation, none of the nodes
3741
* are selected. Just pick the first plugged one and let Chrome
@@ -43,7 +47,7 @@ Index: adhd/cras/src/server/cras_alsa_io_common.c
4347
}
4448
}
4549
- return iodev->nodes;
46-
+ return result ? result: iodev->nodes;
50+
+ return result ? result : iodev->nodes;
4751
}
4852

4953
/* Returns true if the corresponding node_info of the specified input node has

baseboard-rpi3/media-sound/adhd/files/fix_rpi_hdmi_iec958.patch

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
Index: adhd/cras/src/server/cras_alsa_card.c
2-
===================================================================
3-
--- adhd.orig/cras/src/server/cras_alsa_card.c
4-
+++ adhd/cras/src/server/cras_alsa_card.c
5-
@@ -134,8 +134,18 @@ struct cras_iodev* create_iodev_for_devi
1+
--- a/cras/src/server/cras_alsa_card.c
2+
+++ b/cras/src/server/cras_alsa_card.c
3+
@@ -132,10 +132,22 @@
4+
return NULL;
5+
}
66

7+
+ syslog(LOG_ERR, "create pcm device for card:%s %s:%s:%s [%u]",
8+
+ alsa_card->name, card_name, dev_name, dev_id, device_index);
9+
+
710
/* Append device index to card namem, ex: 'hw:0', for the PCM name of
811
* target iodev. */
912
- snprintf(pcm_name, MAX_ALSA_PCM_NAME_LENGTH, "%s,%u", alsa_card->name,
1013
- device_index);
11-
+ /*snprintf(pcm_name, MAX_ALSA_PCM_NAME_LENGTH, "%s,%u", alsa_card->name,
12-
+ device_index); */
13-
+ if (!strncmp(card_name, "vc4-hdmi-0",10)){
14-
+ snprintf(pcm_name, MAX_ALSA_PCM_NAME_LENGTH, "%s,%u", "iec958:0",
15-
+ device_index);
16-
+ } else if (!strncmp(card_name, "vc4-hdmi-1",10)) {
14+
+
15+
+ if (!strncmp(card_name, "vc4-hdmi-0", 10)) {
16+
+ snprintf(pcm_name, MAX_ALSA_PCM_NAME_LENGTH, "%s,%u", "iec958:0",
17+
+ device_index);
18+
+ } else if (!strncmp(card_name, "vc4-hdmi-1", 10)) {
1719
+ snprintf(pcm_name, MAX_ALSA_PCM_NAME_LENGTH, "%s,%u", "iec958:1",
1820
+ device_index);
1921
+ } else {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include /net-wireless/hostapd/OWNERS
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/wpa_supplicant-cros/current/wpa_supplicant/events.c b/wpa_supplicant-cros/current/wpa_supplicant/events.c
2+
index af2cd73bf..0388f585f 100644
3+
--- a/wpa_supplicant-cros/current/wpa_supplicant/events.c
4+
+++ b/wpa_supplicant-cros/current/wpa_supplicant/events.c
5+
@@ -3739,7 +3739,9 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
6+
eapol_sm_notify_eap_success(wpa_s->eapol, true);
7+
} else if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK) &&
8+
wpa_key_mgmt_wpa_psk(wpa_s->key_mgmt)) {
9+
- if (already_authorized) {
10+
+ #define BRCMFMAC43455 1
11+
+ wpa_msg(wpa_s, MSG_DEBUG, "We skip 4-way handshake for the sake of BRCMFMAC43455.");
12+
+ if (already_authorized || BRCMFMAC43455) {
13+
/*
14+
* We are done; the driver will take care of RSN 4-way
15+
* handshake.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
# Copyright 2020 The ChromiumOS Authors
4+
# Use of this source code is governed by a BSD-style license that can be
5+
# found in the LICENSE file.
6+
7+
# Print wpa_supplicant version from <supplicant_root_dir>/src/common/version.h
8+
# The regexp [gsub("-", "_", $3); gsub("devel", "pre", $3)] is used to change
9+
# the upstreanm version format from "2.10-devel" to "2.10_pre" to match the ebuild
10+
# file name format:
11+
# https://devmanual.gentoo.org/ebuild-writing/file-format/index.html
12+
awk '$2 == "VERSION_STR" {gsub("\"", "", $3); gsub("-", "_", $3); gsub("devel", "pre", $3); print $3}' "$1"/src/common/version.h
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!-- Dumped from DBus introspection -->
2+
<node>
3+
<interface name="fi.w1.wpa_supplicant1">
4+
<method name="CreateInterface">
5+
<arg name="args" type="a{sv}" direction="in"/>
6+
<arg name="path" type="o" direction="out"/>
7+
</method>
8+
<method name="RemoveInterface">
9+
<arg name="path" type="o" direction="in"/>
10+
</method>
11+
<method name="GetInterface">
12+
<arg name="ifname" type="s" direction="in"/>
13+
<arg name="path" type="o" direction="out"/>
14+
</method>
15+
<signal name="InterfaceAdded">
16+
<arg name="path" type="o"/>
17+
<arg name="properties" type="a{sv}"/>
18+
</signal>
19+
<signal name="InterfaceRemoved">
20+
<arg name="path" type="o"/>
21+
</signal>
22+
<signal name="PropertiesChanged">
23+
<arg name="properties" type="a{sv}"/>
24+
</signal>
25+
<property name="DebugLevel" type="s" access="readwrite"/>
26+
<property name="DebugTimestamp" type="b" access="readwrite"/>
27+
<property name="DebugShowKeys" type="b" access="readwrite"/>
28+
<property name="Interfaces" type="ao" access="read"/>
29+
<property name="EapMethods" type="as" access="read"/>
30+
</interface>
31+
</node>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!DOCTYPE busconfig PUBLIC
2+
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
3+
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
4+
<!--
5+
Copyright 2020 The ChromiumOS Authors
6+
Use of this source code is governed by a BSD-style license that can be
7+
found in the LICENSE file.
8+
-->
9+
<busconfig>
10+
<policy user="wpa">
11+
<allow own="fi.w1.wpa_supplicant1"/>
12+
<allow own="fi.epitest.hostap.WPASupplicant"/>
13+
<allow send_destination="fi.w1.wpa_supplicant1"/>
14+
<allow send_interface="fi.w1.wpa_supplicant1"/>
15+
</policy>
16+
<policy user="root">
17+
<allow send_destination="fi.w1.wpa_supplicant1"/>
18+
<allow send_interface="fi.w1.wpa_supplicant1"/>
19+
<allow receive_sender="fi.w1.wpa_supplicant1" receive_type="signal"/>
20+
</policy>
21+
<policy user="shill">
22+
<allow send_destination="fi.w1.wpa_supplicant1"/>
23+
<allow send_interface="fi.w1.wpa_supplicant1"/>
24+
<allow receive_sender="fi.w1.wpa_supplicant1" receive_type="signal"/>
25+
</policy>
26+
<policy user="chronos">
27+
<allow send_destination="fi.w1.wpa_supplicant1"
28+
send_interface="org.freedesktop.DBus.Properties"/>
29+
</policy>
30+
<policy user="debugd">
31+
<allow send_destination="fi.w1.wpa_supplicant1"
32+
send_interface="org.freedesktop.DBus.Properties"/>
33+
</policy>
34+
<policy context="default">
35+
<deny own="fi.w1.wpa_supplicant1"/>
36+
<deny own="fi.epitest.hostap.WPASupplicant"/>
37+
<deny send_destination="fi.w1.wpa_supplicant1"/>
38+
<deny send_interface="fi.w1.wpa_supplicant1"/>
39+
<deny receive_sender="fi.w1.wpa_supplicant1" receive_type="signal"/>
40+
</policy>
41+
</busconfig>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE busconfig PUBLIC
2+
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
3+
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
4+
<!--
5+
Copyright 2020 The ChromiumOS Authors
6+
Use of this source code is governed by a BSD-style license that can be
7+
found in the LICENSE file.
8+
-->
9+
<busconfig>
10+
<policy user="wpa">
11+
<allow own="fi.w1.wpa_supplicant1"/>
12+
<allow own="fi.epitest.hostap.WPASupplicant"/>
13+
<allow send_destination="fi.w1.wpa_supplicant1"/>
14+
<allow send_interface="fi.w1.wpa_supplicant1"/>
15+
</policy>
16+
<policy user="root">
17+
<allow own="fi.w1.wpa_supplicant1"/>
18+
<allow own="fi.epitest.hostap.WPASupplicant"/>
19+
<allow send_destination="fi.w1.wpa_supplicant1"/>
20+
<allow send_interface="fi.w1.wpa_supplicant1"/>
21+
<allow receive_sender="fi.w1.wpa_supplicant1" receive_type="signal"/>
22+
</policy>
23+
<policy user="shill">
24+
<allow send_destination="fi.w1.wpa_supplicant1"/>
25+
<allow send_interface="fi.w1.wpa_supplicant1"/>
26+
<allow receive_sender="fi.w1.wpa_supplicant1" receive_type="signal"/>
27+
</policy>
28+
<policy user="chronos">
29+
<allow send_destination="fi.w1.wpa_supplicant1"
30+
send_interface="org.freedesktop.DBus.Properties"/>
31+
</policy>
32+
<policy user="debugd">
33+
<allow send_destination="fi.w1.wpa_supplicant1"
34+
send_interface="org.freedesktop.DBus.Properties"/>
35+
</policy>
36+
<policy context="default">
37+
<deny own="fi.w1.wpa_supplicant1"/>
38+
<deny own="fi.epitest.hostap.WPASupplicant"/>
39+
<deny send_destination="fi.w1.wpa_supplicant1"/>
40+
<deny send_interface="fi.w1.wpa_supplicant1"/>
41+
<deny receive_sender="fi.w1.wpa_supplicant1" receive_type="signal"/>
42+
</policy>
43+
</busconfig>

0 commit comments

Comments
 (0)