Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Decide: HFP/HSP headset microphone — needs eSCO in ng_hci, alt-setting fix in ng_ubt, sco hook wiring, and a from-scratch HFP daemon (XL)

オープン
#237 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
c
領域
networking

調査の方向性

Start with the linked epic nextbsd/nextbsd#473 and the E16 audio research in e16/5-audio.md section 2 to understand the scope decision. The issue names ng_hci_ulpi.c, ng_hci_evnt.c, ng_ubt.c, ng_btsocket_sco.c, the bluetooth rc script, and sdpd/profile.c as relevant entry points. Done means recording the scope decision and, regardless of that decision, wiring the SCO hook and reporting its status; any spike or full implementation also needs the listed sub-issues.

索引モデルが issue の本文から書いたものです。

説明

area:bluetooth question

E16 draft id A6 · epic nextbsd/nextbsd#473

Why

A2DP (A4) gives playback only. Using a headset's microphone needs HFP or HSP: an RFCOMM AT-command channel plus a SCO/eSCO voice link. Nothing in FreeBSD base or ports implements either profile (0 code-search hits for handsfree/HFP; sdpd has no Headset/Handsfree records — usr.sbin/bluetooth/sdpd/profile.c:51-76), and the kernel half is incomplete. Quantified against releng/15.1 sys/netgraph/bluetooth:

piece state where
SCO over USB isochronous works (4 isoc xfers, reassembly) drivers/ubt/ng_ubt.c:281-282, 336-378, 1290-1366; sysctl net.bluetooth.usb_isoc_enable
isoc alt-setting selection picks the largest wMaxPacketSize alt (:738-780) instead of the alt that matches SCO bandwidth (BT-USB spec: alt 1 = one CVSD link ...) — frame-size mismatch on many dongles ng_ubt.c
HCI SCO setup legacy Add_SCO_Connection only, HV1/HV2/HV3 CVSD (ng_hci_ulpi.c:322-450); no Setup_Synchronous_Connection -> no eSCO, no mSBC wideband, no transparent air mode hci/
HCI sync events Synchronous_Connection_Complete (0x2C) / _Changed (0x2D) absent from the event switch (ng_hci_evnt.c:107-200); headset-initiated eSCO is an unhandled event hci/
SCO socket exists: PF_BLUETOOTH/SOCK_SEQPACKET/BLUETOOTH_PROTO_SCO, SO_SCO_MTU, listen/accept/connect socket/ng_btsocket_sco.c
stack wiring stock rc.d/bluetooth:119-127 never connects hci: sco to btsock_sco:; routes only appear on NGM_HCI_NODE_UP over a connected hook (ng_btsocket_sco.c:821-856) bring-up script / bluetoothd
RFCOMM exists socket/ng_btsocket_rfcomm.c
HFP AG state machine, SCO<->OSS bridge, SDP records do not exist anywhere —

Prior art: NetBSD sys/dev/bluetooth/btsco.c (Itronix, BSD-2-Clause) — a kernel audio device on a SCO PCB; design reference only, different stack API.

What shipping it would take

  1. Kernel (this repo, as patches/): Setup_Synchronous_Connection + the two sync events in ng_hci; alt-setting selection by requested SCO packet size in ng_ubt; expose eSCO parameters through SO_SCO_* sockopts. Hardware-verified only — the netgraph BT stack has no tests.
  2. bluetoothd (K/D tracks): ngctl connect ${dev}hci: btsock_sco: sco ${dev}sco at stack bring-up so SCO sockets are routable at all (cheap; do it regardless, it unblocks experiments).
  3. New userland: an HFP AG (AT+BRSF, +CIND, +CMER, AT+VGS/VGM, AT+BCC/+BCS codec select, ring/answer/hangup) over RFCOMM, SDP HANDSFREE_AUDIO_GATEWAY (0x111F) record (extend sdpd or bluetoothd-owned SDP), and an SCO<->cuse bridge (8 kHz mono CVSD, 48-byte frames / 3.75 ms) surfacing as /dev/dsp.hfp for virtual_oss.

Result even then: telephone-grade narrowband until eSCO/mSBC lands. Estimate XL.

The question

Is narrowband headset mic in scope for E16 at all, or does E16 ship A2DP-only and file HFP as its own epic (or park until LE Audio forces a BLE-side stack anyway)? Options:

  • Park (recommended): A2DP-only for E16; keep step 2 (sco hook) so the socket path is testable; file the rest as a follow-up epic.
  • Kernel-first spike: land step 1 + 2 and prove hccontrol+SCO socket can carry CVSD both ways with one dongle before committing to the daemon.
  • Full: all three, XL.

Acceptance criteria

  • Decision recorded on the epic (A2DP-only vs. spike vs. full) and this issue re-labelled/re-sized accordingly
  • Regardless of decision: bluetoothd's stack bring-up connects the sco hook (ngctl list shows ubt0sco), and bluetooth status reports whether the adapter's SCO path is wired
  • If spike/full: sub-issues filed for (1) ng_hci eSCO, (2) ng_ubt alt-setting, (3) HFP daemon + bridge

Links

  • Epic nextbsd/nextbsd#473 · A4
  • sys/netgraph/bluetooth/{drivers/ubt/ng_ubt.c,hci/ng_hci_ulpi.c,hci/ng_hci_evnt.c,socket/ng_btsocket_sco.c}, libexec/rc/rc.d/bluetooth, usr.sbin/bluetooth/sdpd/profile.c (releng/15.1); NetBSD sys/dev/bluetooth/btsco.c
  • Research: e16/5-audio.md section 2

Dependencies (E16)

  • Depends on: nextbsd/nextbsd-kernel#231 (K1), nextbsd/nextbsd-userland#218 (A4)
  • Blocks: nothing

Draft ids (K = kernel & hardware, B = engine/BLE, D = bluetoothd/CLI, H = HID, A = audio) are listed with their issue numbers in nextbsd/nextbsd#473.

主要言語
C
スター
12
フォーク
3
平均マージ
2時間 4分
マージ済み PR(30日)
79

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nextbsd/nextbsd-kernel のほかの issue

nextbsd/nextbsd-kernel の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。