From nobody Sat Mar 05 22:03:34 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CE4F719EE62B; Sat, 5 Mar 2022 22:03:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K9zJ65VWvz4fcy; Sat, 5 Mar 2022 22:03:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646517814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hz6OYZROKc4BMWOm3WOQaN9GU/tOCfXFgc8SdXXwOc4=; b=caxs3/vRBDgqckjjh58dTiXGbwWujboEmLjHWZL+mLE1ThvnljVsd7+vJiPV7fZ7IB44A9 hN+DJ38+LRbb/iSTXw5oDoYb575OokpIfUv9tRRUbuiCy4EKIlUuIVryToU/ba+ecsGsy5 1KeSXQ5PtkPGcWDczWTqeXXfjbwG/g5FzV8aYlp7RRnpmJwXKJp97qMtzGT2m2RuM4WVT3 2yfB9mSFyohri5tKLDc6tu11cJUkM5wtVBfygMWxvTpKNaXEYtK+UgC9mnslghVOXm0ZwN WFRMCVHZ1K/LrNK4OJ9mecUuiF5sg+pSrd7SqNwc5gg9U2tiOacA0yZOUJ3zjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D5E64D7; Sat, 5 Mar 2022 22:03:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 225M3Yel093851; Sat, 5 Mar 2022 22:03:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 225M3YKq093850; Sat, 5 Mar 2022 22:03:34 GMT (envelope-from git) Date: Sat, 5 Mar 2022 22:03:34 GMT Message-Id: <202203052203.225M3YKq093850@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Rene Ladan Subject: git: fd50b0334df1 - main - www/chromium: fix audio playback with ALSA List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rene X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd50b0334df1c720befc62ae613bfa8862efb336 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646517814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hz6OYZROKc4BMWOm3WOQaN9GU/tOCfXFgc8SdXXwOc4=; b=eQCctk8j/ZAnRq+zTefM0dinsR0Kywnk9WiFEj93sct1dzP5707gNP2uhsVmK7uWdmGzIv J53O/+Xke6TBbxCaBSqnFCU2bX0nIfIqxceSfcXeh0J0zaBn+C3J1XUEZfRGiuWFJXT10K JCotFtf4FWbK/tp19Ahfaybpy6RcLFmf9FwXSBb74r7sJmMrIBNFHgfnT431gOGDXJKSWO An1x+qN4RAObrgJxE6kg0MBWGkBYAYh0K+9qXD2ICKC7UZwwAEWO9FrzTrswkTHU5XOUzN PXCSMmzZwZ4VgzHdWFu5A9g8cr8KoeJISJzXqxS+eAti+ohgXS8O40pBgIPRIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646517814; a=rsa-sha256; cv=none; b=sDRuh/YYYEvV8IEsCZZbgRQjlc/NlZ0M8wv3PgbxWhAr7glyJkbY5oCFdd+TW+K3jsE/mt mOMwHUlq6JlzQEGJdWdtJbijxNQGLpNJIeSYUkA8guhJKdL88Mfwyc23DT/rEXMD8MobRM V0YOt3zefyO6VRQYy3jsOE2Rw8vHI6xJKwUA49kzYeumTASV8J8k85bbmqndvuyHyIxRs6 A/1i1CGNFTUy7XuLYnP7kBLhKo4eHlQ1WmsphkBb8oJvUz5CH+7X+5SBjWM+nF+Az4u/BG 366DVUJhj3XxbvR33KtJYf1G5tI8xmMyCYcuvgYLTN7xopVhJDxYGWOHnAdjtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rene: URL: https://cgit.FreeBSD.org/ports/commit/?id=fd50b0334df1c720befc62ae613bfa8862efb336 commit fd50b0334df1c720befc62ae613bfa8862efb336 Author: Robert Nagy AuthorDate: 2022-03-05 22:01:23 +0000 Commit: Rene Ladan CommitDate: 2022-03-05 22:03:19 +0000 www/chromium: fix audio playback with ALSA PR: 262365 Reported by: o.hushchenkov@gmail.com Tested by: o.hushchenkov@gmail.com --- www/chromium/Makefile | 1 + .../patch-media_audio_alsa_audio__manager__alsa.cc | 54 ++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/www/chromium/Makefile b/www/chromium/Makefile index b7ee68b405cf..e9c5492b11d5 100644 --- a/www/chromium/Makefile +++ b/www/chromium/Makefile @@ -2,6 +2,7 @@ PORTNAME= chromium PORTVERSION= 99.0.4844.51 +PORTREVISION= 1 CATEGORIES= www MASTER_SITES= https://commondatastorage.googleapis.com/chromium-browser-official/ \ https://nerd.hu/distfiles/:fonts diff --git a/www/chromium/files/patch-media_audio_alsa_audio__manager__alsa.cc b/www/chromium/files/patch-media_audio_alsa_audio__manager__alsa.cc new file mode 100644 index 000000000000..deb7ec59d8a0 --- /dev/null +++ b/www/chromium/files/patch-media_audio_alsa_audio__manager__alsa.cc @@ -0,0 +1,54 @@ +--- media/audio/alsa/audio_manager_alsa.cc.orig 2022-03-05 18:42:44 UTC ++++ media/audio/alsa/audio_manager_alsa.cc +@@ -89,7 +89,9 @@ void AudioManagerAlsa::GetAlsaAudioDevices(StreamType + int card = -1; + + // Loop through the sound cards to get ALSA device hints. ++#if !BUILDFLAG(IS_BSD) + while (!wrapper_->CardNext(&card) && card >= 0) { ++#endif + void** hints = NULL; + int error = wrapper_->DeviceNameHint(card, kPcmInterfaceName, &hints); + if (!error) { +@@ -101,7 +103,9 @@ void AudioManagerAlsa::GetAlsaAudioDevices(StreamType + DLOG(WARNING) << "GetAlsaAudioDevices: unable to get device hints: " + << wrapper_->StrError(error); + } ++#if !BUILDFLAG(IS_BSD) + } ++#endif + } + + void AudioManagerAlsa::GetAlsaDevicesInfo(AudioManagerAlsa::StreamType type, +@@ -184,7 +188,11 @@ bool AudioManagerAlsa::IsAlsaDeviceAvailable( + // goes through software conversion if needed (e.g. incompatible + // sample rate). + // TODO(joi): Should we prefer "hw" instead? ++#if BUILDFLAG(IS_BSD) ++ static const char kDeviceTypeDesired[] = "plug"; ++#else + static const char kDeviceTypeDesired[] = "plughw"; ++#endif + return strncmp(kDeviceTypeDesired, device_name, + base::size(kDeviceTypeDesired) - 1) == 0; + } +@@ -206,7 +214,9 @@ bool AudioManagerAlsa::HasAnyAlsaAudioDevice( + // Loop through the sound cards. + // Don't use snd_device_name_hint(-1,..) since there is an access violation + // inside this ALSA API with libasound.so.2.0.0. ++#if !BUILDFLAG(IS_BSD) + while (!wrapper_->CardNext(&card) && (card >= 0) && !has_device) { ++#endif + int error = wrapper_->DeviceNameHint(card, kPcmInterfaceName, &hints); + if (!error) { + for (void** hint_iter = hints; *hint_iter != NULL; hint_iter++) { +@@ -230,7 +240,9 @@ bool AudioManagerAlsa::HasAnyAlsaAudioDevice( + DLOG(WARNING) << "HasAnyAudioDevice: unable to get device hints: " + << wrapper_->StrError(error); + } ++#if !BUILDFLAG(IS_BSD) + } ++#endif + + return has_device; + }