From nobody Tue Jan 18 04:56:58 2022 X-Original-To: questions@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 CC73E195BD95 for ; Tue, 18 Jan 2022 04:57:10 +0000 (UTC) (envelope-from tomek@cedro.info) Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JdGj20Wrtz3Crx for ; Tue, 18 Jan 2022 04:57:10 +0000 (UTC) (envelope-from tomek@cedro.info) Received: by mail-oi1-x236.google.com with SMTP id q186so26789215oih.8 for ; Mon, 17 Jan 2022 20:57:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cedro.info; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EcBp69K8AzIdG3mCoAUYRFMas55w73qP3m/YGjwmqi4=; b=BKKu91kpUDkitn4hYcuvp0Hr2xNFxdhOAbG6Mi6Ge0HSaTzZUPgNZsbGSWoqlv7V6s 3A0kKq07pZHrOEPuXf5nOBrneSOAWLwQKiGqShbCIM6nyhbaq4E+6ZubcVus9IfKj/6W QrR5OyWNqJfUSgoH8mU9V51euyAscNCHv7j911Myh7LNQbiA35wQR5W15i3T1vMhZk1x v8qEv9y2r7Dy9cuWZtndq1uvpsRS/xm9DpwrUFoHTr9EARb0403qb36IybOvNSssIPJ4 kM0Zyd+Pb9LVrb39sPtFn4y4MdK00viIM2V+rxGMS6XOOQ/0vW/21kE4dfrhkY66JDbO VFGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EcBp69K8AzIdG3mCoAUYRFMas55w73qP3m/YGjwmqi4=; b=7W1eMgcm/q2OwAzcvRi4e6gdXoPAZZ3ysXW3GOjCWUKtcwi9+sXpvM8IKKbc26CVQ3 FvejrVuiFOq32CxPl0ZZ+lIriRBJEcfCPNzotUwtzyGXp2lHfaPLQUplyphuiGPdYNz6 sYPu2lVkXMXow2Ehx7FkhJpdV/sUV7zlvxhTbnpNa1Z4rshNETS4nPDa+QepJlNJ8wC6 1kYOMJ4zZQKp1+7D1Na/IR8dlzHar5fpFthM7TKEuj8gEcmGHSrUGIl3vIyQ/n9Dz1ay o2xI92oEdiC5ZD64U3i5N2Q0bvFVo4pf14ZHGK2Z3DnI0s2mawXzqQ0ujb5GlF7xS0f8 1GUQ== X-Gm-Message-State: AOAM533m0TZV+P0JupbuntkHZ4xN92JyFtdmuuIncw/eptNAidPp3CzY ULKXo7xb5bEouwKbhbqFS+j5oZ20POW94oARh/FupQ== X-Google-Smtp-Source: ABdhPJxSCsD6GEZavao3iq/5NjTwNBB8Zt0/Z2y2Xz2BNYQE/WBpectfjTvtgF18egKeP7ZbVvGgz5x6FcgYoBdOUII= X-Received: by 2002:a54:478b:: with SMTP id o11mr18204102oic.11.1642481829341; Mon, 17 Jan 2022 20:57:09 -0800 (PST) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Tomasz CEDRO Date: Tue, 18 Jan 2022 05:56:58 +0100 Message-ID: Subject: Re: Bluetooth support on Intel AX200 To: Kevin Oberman Cc: "freebsd-questions@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4JdGj20Wrtz3Crx X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cedro.info header.s=google header.b=BKKu91kp; dmarc=none; spf=none (mx1.freebsd.org: domain of tomek@cedro.info has no SPF policy when checking 2607:f8b0:4864:20::236) smtp.mailfrom=tomek@cedro.info X-Spamd-Result: default: False [2.56 / 15.00]; R_SPF_NA(0.00)[no SPF record]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[cedro.info:s=google]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.86)[0.857]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[questions@freebsd.org]; DMARC_NA(0.00)[cedro.info]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[cedro.info:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::236:from]; NEURAL_SPAM_LONG(1.00)[1.000]; MLMMJ_DEST(0.00)[questions]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On Tue, Jan 18, 2022 at 5:17 AM Kevin Oberman wrote: > Thanks again for the help. I now have a BT500. (They are hard to find as Amzo and BH Photo are out of stock I see that FreeBSD detects it as a Realtek ASUS BT500. I get the following messages: > Jan 17 13:32:06 ptavv kernel: ugen0.5: at usbus0 > Jan 17 13:32:06 ptavv kernel: ubt0 on uhub0 > Jan 17 13:32:06 ptavv kernel: ubt0: on usbus0 > Jan 17 13:32:06 ptavv kernel: WARNING: attempt to domain_add(bluetooth) after domainfinalize() > Jan 17 13:32:06 ptavv kernel: WARNING: attempt to domain_add(netgraph) after domainfinalize() > > No idea what those last two lines mean, but it's not good. No indication of fw load, though I don't know that it is required. In any case, no ubt or bluetooth device is created in /dev. both ng_ubt and bluetooth drivers are built into the kernel. > > Am I missing anything obvious? Any ideas about those two warnings? I suspect that they indicate my issue. That was fast :-) No worries about these two warnings. No firmware is necessary for this dongle. Copy /etc/defaults/bluetooth.device.conf as /etc/bluetooth/ubt0.conf and edit to your needs. This is a per-device configuration file used by bluetooth service. /etc/bluetooth/ubt0.conf: local_name="hexagon" discoverable="NO" connectable="YES" authentication_enable="1" encryption_mode="1" role_switch="YES" # hci_debug_level="3" # l2cap_debug_level="3" Now you should be able to `service bluetooth onerestart ubt0` with no warnings. You should be now able to see the ubt0hci node with: hccontrol read_node_list You should be now able to scan neighbors with: hccontrol inquiry You can enable bt services in /etc/rc.conf: hcsecd_enable="YES" bluetooth_enable="YES" Bluetooth service will setup and bring the node up. Hcsecd is used for secure connections to the client. You may also want to: sdpd_enable="YES" ubthidhci_enable="YES" ubthidhci_busnum="1" ubthidhci_addr="6" Sdpd allows others to browse your host services. Ubthidhci is used to connect to BT HID devices. /etc/bluetooth/hosts: mybtdevicemac mydevice1name /etc/bluetooth/hcsecd.conf: device { bdaddr mybtdevicemac; name "mydevice1name"; pin "0000"; key 0xddeeaaddbbeeeeff; } hccontrol -n ubt0hci Write_Authentication_Enable 1 hccontrol -n ubt0hci write_Encryption_Mode 1 hccontrol -n ubt0hci Create_Connection mydevice1name At this point you should have a connection (you may need to turn pairing on on the headset). hccontrol -n ubt0hci Read_Connection_List You should see your device connected with assigned handle. Now use Virtual OSS to connect to headset and create /dev/dsp like device: virtual_oss -B -C 2 -c 2 -Q 0 -r 48000 -b 16 -s 512 -T dev/sndstat -R /dev/null -O /dev/bluetooth/mydevice1name -d vdsp.bt.mydevice1name -t vdsp.bt.mydevice1name.ctl -E 1 Now you should see the /dev/vdsp.bt.mydevice1name and headset should notify about successful connection :-) You may name that device whatever you like. I named it with prefix "vdsp.bt." to clearly distonguish between /dev/dsp0.0 .. /dev/dsp11.0. Also you should see the device in /dev/sndstat. Send some random stuff to hear the noise over the headset: cat /dev/random > /dev/vdsp.bt.mydevice1name If that works music should work too. It takes a while to get familiar with all of the configuration, its a bit tricky and not yet automated, no worries, have fun! :-) -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info