Bluetooth + streaming for tahrpup 6.x

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
Smithy
Posts: 1151
Joined: Mon 12 Dec 2011, 11:17

#81 Post by Smithy »

I was coming to the same conclusion, I gather that the new method is to use Alsa space for a plugin, geez it is hard to find this undocumented stuff.
So if there was a Pulse Audio based Puppy... there again I don't think Apt-X is supported in Bluez yet, only been going since the 1990's. No rush lol!
If I get two way streaming from Alsa I will let ya know.

User avatar
Smithy
Posts: 1151
Joined: Mon 12 Dec 2011, 11:17

#82 Post by Smithy »

http://www.gentoo-wiki.info/Bluetooth_h ... stallation. Hmmm.
Well I gave pulse a good try, but it is very complicated with the bluetooth audio module, gallons of dependencies and I couldn't get that flipping daemon to start up. Leaving that for a while for sure..

Make me wonder if Apulse might be able to accomodate some kind of "Slip in" module for HSP mode. Might be a neater solution for Puppy and voips over bluetooth. Some kind of bridge between the Tempestuous Bluez and Skype.

Well I don't want to divert the thread because I gather this is principally for streaming stereo>> to>> headphones.

I did pick up one of those little bluetooth dongles with CSR chip in it.
This package picks it up just fine and paired ok. Easy Peasy.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#83 Post by rcrsn51 »

Smithy wrote:Well I gave pulse a good try, but it is very complicated with the bluetooth audio module
No kidding. I have been playing around with ways to stream audio from your phone out your computer speakers over BT. You are supposed to be able to do this via pulse audio but it's like pulling teeth in Puppy.

[Edit] I have this working using code from a project by jamesbond.

User avatar
Smithy
Posts: 1151
Joined: Mon 12 Dec 2011, 11:17

#84 Post by Smithy »

Oh, that's a bit of puppy progress then!

Just a heads up on the beautify aspect. This ping (and scaleable svg) looks clearer and bigger (on a tint 2/ openbox desktop 48x48) than the one in there. I got it from the precise bluez pet, no Off button in there though.
Attachments
bluetooth.png
(2.93 KiB) Downloaded 1032 times

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#85 Post by rcrsn51 »

Thanks. I have assigned your PNG icon to the .desktop file and left the two XPM tray icons as they are.

User avatar
Smithy
Posts: 1151
Joined: Mon 12 Dec 2011, 11:17

#86 Post by Smithy »

rcrsn51 wrote:
I own some BT headphones with a built-in mic and I tried to get the mic detected by ALSA, with no luck.
Did you try that in Fatdog rcrsn51?
JamesBond wrote: b) supports audio-streaming (bluetooth speakers). After you pair them you need to enable them using Fatdog Default Soundcard settings available in Sound section of Fatdog Control Panel.
Note that I have not tried two-way audio using a bluetooth headset.

I noticed a few differences in the Fatdog vs Tahrpup etc/bluetooth/audio.conf.
I presume this is where some of the action takes place.

Code: Select all

# Configuration file for the audio service

# This section contains options which are not specific to any
# particular interface
[General]
Enable=Socket

# Switch to master role for incoming connections (defaults to true)
#Master=true

# If we want to disable support for specific services
# Defaults to supporting all implemented services
#Disable=Gateway,Source,Socket

# SCO routing. Either PCM or HCI (in which case audio is routed to/from ALSA)
# Defaults to HCI
#SCORouting=PCM

# Automatically connect both A2DP and HFP/HSP profiles for incoming
# connections. Some headsets that support both profiles will only connect the
# other one automatically so the default setting of true is usually a good
# idea.
#AutoConnect=true

# Headset interface specific options (i.e. options which affect how the audio
# service interacts with remote headset devices)
[Headset]

# Set to true to support HFP, false means only HSP is supported
# Defaults to true
HFP=true

# Maximum number of connected HSP/HFP devices per adapter. Defaults to 1
MaxConnected=1

# Set to true to enable use of fast connectable mode (faster page scanning)
# for HFP when incoming call starts. Default settings are restored after
# call is answered or rejected. Page scan interval is much shorter and page
# scan type changed to interlaced. Such allows faster connection initiated
# by a headset.
FastConnectable=false

# Just an example of potential config options for the other interfaces
#[A2DP]
#SBCSources=1
#MPEG12Sources=0


FatDog unfortunately will not boot with older Atom cpus.
I did try on another 64 bit capable cpu to create a "virtual" default bluetooth sound card in the control panel, but no alsamixer or volume control showed up.
At least it offers that option though.
FatDog Bluetooth did beep some far away external bluetooth equipment though, so something's going on!

User avatar
charlie6
Posts: 1230
Joined: Mon 30 Jun 2008, 04:03
Location: Saint-Gérard / Walloon part of Belgium

#87 Post by charlie6 »

Hi,
some devices such as recent smartphone are featured with "Bluetooth-4.0 Smart" i.e. having low energy needs. This is no longer compatible with earlier bluetooth version.

To detect such device from a PC, one has to do

Code: Select all

# hcitool lescan
instead ( "le" standing for low energy )

This comment

Code: Select all

# hcitool lescan
Set scan parameters failed: Input/output error
means that the BT adapter (= dongle or built-in) does not support the BT smart or low energy standard.

in such case, doing

Code: Select all

# hcitool scan
#
does not report anything (= not any comment nor error message)

here a relevant link
http://unix.stackexchange.com/questions ... s-non-root

one also need the option --lescan option with hcitool (coming with bluez_4.101-0ubuntu13.1_i386.deb)

HTH
Charlie

Dopy25
Posts: 1
Joined: Tue 12 Apr 2016, 23:36

Re: PeasyBT Bluetooth Manager

#88 Post by Dopy25 »

rcrsn51 wrote:Note: This package needs testing and feedback, not anonymous downloads. Please send me a PM.
May I give it a try? I am running Arcade Puppy which is slacko 593. I got Bluetooth working with the streaming pet from the first page but I would like to give your Peasy BT GUI a shot.

I tried PMing you but I'm not sure if you got it or not since I am a new member.

gcmartin

#89 Post by gcmartin »

RasberryPi latest release indicates a new-better Bluetooth utility.
Raspians wrote:We've just released a new version of our Raspbian image with some (hopefully) useful features. When the Pi 3 launched back in February, we'd not had time to do much in terms of getting access to the new on-board Bluetooth hardware. There was a working software stack, but the UI was non-existent. I'd hoped to be able to use one of the existing Linux Bluetooth UIs, but on trying them all, none were really what I was looking for in terms of usability and integration with the look and feel of the desktop. I really didn't want to write one from scratch, but that ended up being what I did, which meant a fun few weeks trying to make head or tail of the mysteries of BlueZ and D-Bus. After a few false starts, I finally got something I felt was usable, and so there is now a Bluetooth plugin for the LXPanel taskbar."
Simple as it looks, I wonder if it would be adaptable or useful to Puppy Linux users.

ktat
Posts: 20
Joined: Mon 07 Oct 2013, 09:27

#90 Post by ktat »

Hi, Thanks for this thread. I am hoping that by working through this I may be able to get my bluetooth speaker working again.

I say again because it worked briefly and then, I messed around with something and I can't get it going again.

I have installed http://www.smokey01.com/tempestuous/blu ... eaming.pet.

My icon appeared and it was black, I clicked it and it did turn blue. And that was good.


Code: Select all

root# rfkill list
0: phy0: wlan
	Soft blocked: no
	Hard blocked: no
1: hci0: bluetooth
	Soft blocked: no
	Hard blocked: no
I turned on my bluetooth speaker and entered the following:

Code: Select all

root# hcitool scan
Device is not available: No such device
this was not good, I read further along your thread...

and tried:

Code: Select all

root# bluez-test-device list
Traceback (most recent call last):
  File "/usr/bin/bluez-test-device", line 17, in <module>
    manager = dbus.Interface(bus.get_object("org.bluez", "/"), "org.bluez.Manager")
  File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 241, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 248, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 180, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 278, in start_service_by_name
    'su', (bus_name, flags)))
  File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.bluez was not provided by any .service files
then:

Code: Select all

root# lsusb
Bus 001 Device 004: ID 05e3:0505 Genesys Logic, Inc. 
Bus 001 Device 002: ID 0781:5170 SanDisk Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 002: ID 0b05:b700 ASUSTek Computer, Inc. Broadcom Bluetooth 2.1
I'm afraid I don't know the driver for my wifi card. I can tell you this though:

Code: Select all

root# lspci
00:00.0 Host bridge: Intel Corporation Mobile 945GSE Express Memory Controller Hub (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GSE Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)
00:1b.0 Audio device: Intel Corporation NM10/ICH7 Family High Definition Audio Controller (rev 02)
00:1c.0 PCI bridge: Intel Corporation NM10/ICH7 Family PCI Express Port 1 (rev 02)
00:1c.1 PCI bridge: Intel Corporation NM10/ICH7 Family PCI Express Port 2 (rev 02)
00:1c.3 PCI bridge: Intel Corporation NM10/ICH7 Family PCI Express Port 4 (rev 02)
00:1d.0 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #1 (rev 02)
00:1d.1 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #2 (rev 02)
00:1d.2 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #3 (rev 02)
00:1d.3 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #4 (rev 02)
00:1d.7 USB controller: Intel Corporation NM10/ICH7 Family USB2 EHCI Controller (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7-M Family) SATA Controller [IDE mode] (rev 02)
01:00.0 Network controller: Ralink corp. RT2790 Wireless 802.11n 1T/2R PCIe
03:00.0 Ethernet controller: Qualcomm Atheros AR8121/AR8113/AR8114 Gigabit or Fast Ethernet (rev b0)

Version-
Kernel : Linux 3.14.56 (i686)
Version : #1 SMP PREEMPT Mon Dec 21 14:52:08 GMT 2015

Computer-
Operating System : tahrpup - 6.0.5

I have also posted in the cutting edge thread with a similar issue. I am trying to tackle this problem from two ends at once. So I have 2 sticks with the same tahr pup installed - but different bluetooth software.

ktat
Posts: 20
Joined: Mon 07 Oct 2013, 09:27

#91 Post by ktat »

tempestuous wrote:
Open /etc/asound.conf in Geany, and replace "XX:XX:XX:XX:XX:XX" with the bluetooth MAC address of your bluetooth receiver (or headset), which you determined earlier.
I have got to this step, however, my asound.conf looks like this

Code: Select all

defaults.pcm.card 1
defaults.pcm.device 0
I'm not sure where I should put my bluetooth MAC address.

Thanks.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#92 Post by tempestuous »

My bluez dotpet definitely provides a custom asound.conf file with the appropriate bluetooth-related entries, and this will definitely be installed to /etc
so it sounds like you may have overwritten this file, possibly by running the ALSA Sound Card wizard.

The simple fix would be to re-install the bluez dotpet.

ktat
Posts: 20
Joined: Mon 07 Oct 2013, 09:27

#93 Post by ktat »

Thank you for your help.

I couldn't find any file bluez.pet in the Puppy Package Manager. So I'm not sure if I've reinstalled the correct package.

What I did reinstall was bluez 4.101.

After installation and starting bluetoothd, the bluetooth icon appeared in the task bar. I was able to find my speaker, however, when I tried to connect to the audio sink a window popped up saying "Device added successfully but failed to connect".
I tried again, this time there was another error. In the bluetooth manager window it said "Connection failed: stream setup failed".

I went and took another look at /etc/asound.conf. The contents of this file has not changed since reinstalling bluez 4.101.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#94 Post by tempestuous »

ktat wrote:I couldn't find any file bluez.pet in the Puppy Package Manager.
My software packages are not part of the PPM, and I don't wish them to be so.
ktat wrote:What I did reinstall was bluez 4.101.
Yes, that's the correct dotpet to install, assuming you obtained it from the first post in this thread.
And if so, it definitely installs this asound.conf file -

Code: Select all

#/etc/asound.conf

pcm.btheadset {
   type plug
   slave {
       pcm {
           type bluetooth
           device XX:XX:XX:XX:XX:XX
           profile "auto"
       }
   }
   hint {
       show on
       description "BT Headset"
   }
}
ctl.btheadset {
  type bluetooth
}

ktat
Posts: 20
Joined: Mon 07 Oct 2013, 09:27

#95 Post by ktat »

Thank you, again.

Following your instructions, I am now that much closer to having a fully portable OS that meets my needs.

I had, originally downloaded the file from the PPM, and so when you redirected me back to the start of this thread - all became much clearer.

I expect that I will need to have a different asound.conf for evey bluetooth device that I wish to connect. Or, can I just use the first device listed as a template - changing the MAC address and "description" for additional devices, then appending tem to the asound.conf file?

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#96 Post by tempestuous »

Mmm. Multiple bluetooth headsets?
ktat wrote:can I just use the first device listed as a template - changing the MAC address and "description" for additional devices, then appending tem to the asound.conf file?
Yes, that might work, but with one caveat - you almost certainly cannot duplicate the words "pcm.btheadset" and "ctl.btheadset"
because then you would have more than one definition of the same device, which would confuse the system.

I think that when you add a second device's set of definitions to the asound.conf file, these should be listed as "pcm.btheadset2" and "ctl.btheadset2".

Also be aware that whenever you change the asound.conf file, you must reboot before the changes will come into effect.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#97 Post by tempestuous »

Well I just tried such a configuration now, even though I don't own a bluetooth headset or speaker.

For the second device I used a different "description" value; something meaningful like "Bose BT Soundbar".
Now in DeaDBeeF when I go to Edit > Preferences > Output plugin:
I can see 2 different bluetooth devices listed, as illustrated -
Attachments
BT-multiple.jpg
(67.56 KiB) Downloaded 664 times

ktat
Posts: 20
Joined: Mon 07 Oct 2013, 09:27

#98 Post by ktat »

Thanks tempestuous, that is good to know.

Now I have another problem, in my pursuit of portability.

Unfortunately, my other laptop is a hp Pavilion g6. From my research, it would seem that it's wifi/bluetooth chip is notoriously difficult to get the bluetooth working (although my Fedora OS has no problem).

Here is what I have learned so far...

Code: Select all

root# rfkill list
0: phy0: wlan
	Soft blocked: no
	Hard blocked: no

root# hciconfig dev
Can't get device info: No such device

lsusb
02:00.0 Network controller: Qualcomm Atheros AR9485 Wireless Network Adapter (rev 01)

lsusb -v
Bus 006 Device 002: ID 0cf3:311d Atheros Communications, Inc. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass          224 Wireless
  bDeviceSubClass         1 Radio Frequency
  bDeviceProtocol         1 Bluetooth
  bMaxPacketSize0        64
  idVendor           0x0cf3 Atheros Communications, Inc.
  idProduct          0x311d 
  bcdDevice            0.01
  iManufacturer           1 Atheros Communications
  iProduct                2 Bluetooth USB Host Controller
  iSerial                 3 Alaska Day 2006
  bNumConfigurations      1 

dmesg | grep -i blue
Bluetooth: Core ver 2.18
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO socket layer initialized
Bluetooth: Patch file not found ar3k/AthrBT_0x01020200.dfu
Bluetooth: Loading patch file failed
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM ver 1.11
Bluetooth: BNEP (Ethernet Emulation) ver 1.3
Bluetooth: BNEP filters: protocol multicast
Bluetooth: BNEP socket layer initialized

lsmod | grep -i ath9
ath9k                  58216  0 
ath9k_common             892  1 ath9k
ath9k_hw              326100  2 ath9k_common,ath9k
ath                    12076  3 ath9k_common,ath9k,ath9k_hw
mac80211              181284  1 ath9k
cfg80211              133384  3 ath,ath9k,mac80211

lsmod | grep -i blue
bluetooth             153589  12 bnep,ath3k,btusb,rfcomm
6lowpan_iphc            4320  1 bluetooth
rfkill                  5402  6 cfg80211,hp_wmi,bluetooth
No matter how much I "cycle" my wifi button, I'm not getting hci0 to show up in the rfill list

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#99 Post by tempestuous »

From an earlier post by rcrsn51, I understand that when you have a combined wifi/bluetooth interface, its driver needs to explicitly enable the bluetooth functionality.
In the case of your ath9k driver, that is achieved with the "btcoex_enable" parameter. (You can run "modinfo ath9k" to see what other parameters are available)

To enable the bluetooth function temporarily, unload/reload your ath9k driver with these 2 commands -

Code: Select all

rmmod ath9k
modprobe ath9k btcoex_enable=1
Now run those bluetooth diagnostic commands again. If successful, you can move on to bluetooth configuration and pairing.

To make the driver's bluetooth function permanent, create a new text document in Geany, with this text -

Code: Select all

options ath9k btcoex_enable=1
and save the text file as /etc/modprobe.d/bluetooth.conf

ktat
Posts: 20
Joined: Mon 07 Oct 2013, 09:27

#100 Post by ktat »

Thank you tempestuous.

I gave the above a try, however, it doesn't seem to have worked. This is what I entered and the output I received:

Code: Select all

root# rmmod ath9k
root# modprobe ath9k btcoex_enable=1 blink=1	
root# rfkill list
1: phy1: wlan
	Soft blocked: no
	Hard blocked: no
root# hciconfig dev
Can't get device info: No such device
* before entering rfkill list, I clicked on the bluetooth icon to turn the daemon on.

So, following on from the earlier post by rcrsn51, I have attached the lsmod output for the Fedora OS and the Puppy OS. It would seem that the Fedora OS isn't using the btcoex option either, but still works. I also added the blink option to see if it did anything, the light on the keyboard now blinks - but this doesn't show up in the lsmod either??

I'm not sure where to go with this now.

By the way my system is 32bit so the file that rcrsn51 suggests to upload wouldn't be useful for me.
Attachments
puppy_lsmod.txt.tar
(10 KiB) Downloaded 216 times
fedora_lsmod.txt.tar
(10 KiB) Downloaded 218 times

Post Reply