Bluetooth + streaming for tahrpup 6.x

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
Philh
Posts: 150
Joined: Wed 17 May 2006, 13:26
Location: England

#16 Post by Philh »

Its like the computer thinks its paired but the amp is waiting for some return.
It times out after 2 minutes and says not connected.

But I have found a way of connecting reliably. Just from searching on the net.
Though Im sure there must be a way without turning the amp off and on.
hciconfig hci0 piscan enables iscan to make the computer dongle discoverable.
Then after I run bluetooth-agent I turn the amp off and on.
It goes into pairing, gets authorized and connects

# hcitool scan
Scanning ...
00:1D:DF:86:67:98 CR-H260i
# bluez-simple-agent hci0 00:1D:DF:86:67:98
RequestPinCode (/org/bluez/31303/hci0/dev_00_1D_DF_86_67_98)
Enter PIN Code: 0000
Release
New device (/org/bluez/31303/hci0/dev_00_1D_DF_86_67_98)
# hciconfig hci0 piscan
# bluetooth-agent 0000
Authorizing request for /org/bluez/31303/hci0/dev_00_1D_DF_86_67_98

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

#17 Post by rcrsn51 »

Excellent. This is another piece of the puzzle to using BT in Puppy.

pchan
Posts: 130
Joined: Fri 12 Oct 2012, 12:17
Location: Kuala Lumpur, Malaysia

#18 Post by pchan »

rcrsn51 wrote:I don't understand that. In Tahrpup NO-PAE, I installed the rtl8192ce_tahrpup_nopae-k3.14.20.pet and the rtl8192ce_btcoexist_tahrpup_nopae-k3.14.20.pet.

I ran "modprobe rtl8192ce" and "modprobe btcoexist". I did NOT get that error. You should not need to run the first modprobe command because the module would automatically load on your machine, since it has the device. Maybe a reboot is necessary?

Boot up a Linux where your BT headphones work and run "lsmod". Is btcoexist being loaded?
Bus 006 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
I own two external BT dongles with this identical chip. Both work OOTB. Something is blocking your internal device.
Sorry, I didn't notice that you suggested to run "lsmod" ...

I have been spending my time with LinuxLite instead of puppy these days because i wanted to enjoy my Bluetooth headset.

Anyway, attached is my lsmod of Linux Lite v2.2 (Ubuntu based distro).

It is good to hear that bluetooth dongles do work at least. it gives me hope that i can use puppy and bluetooth headset if I can turn off my in built bluetooth and buy a bluetooth dongle. These dongles are not so expensive these days I think. But, will try whatever possible first to see if the inbuilt bluetooth can be used. In other linux distro it is quite easy to set up the bluetooth headsets, I wonder why it is not so in puppy linux.

I wonder if i am doing something wrong. I noticed that there is a bluetooth Tahr.sfs around somewhere. Should I also load this before installing the bt coexist pet???
Attachments
lsmod.zip
(1.14 KiB) Downloaded 503 times

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

#19 Post by rcrsn51 »

Your LinuxLite is not using btcoexist, so that's not the issue.

Are you also running Tahrpup in Vbox? It's hard to track down hardware problems in that environment.

All you need to test this is a clean install of Tahrpup and the bluez-streaming PET by tempestuous.

pchan
Posts: 130
Joined: Fri 12 Oct 2012, 12:17
Location: Kuala Lumpur, Malaysia

#20 Post by pchan »

rcrsn51 wrote:Your LinuxLite is not using btcoexist, so that's not the issue.

Are you also running Tahrpup in Vbox? It's hard to track down hardware problems in that environment.

All you need to test this is a clean install of Tahrpup and the bluez-streaming PET by tempestuous.
No, i am not running tahrpup in a vbox. I think i will give bluez-streaming from tempestuous a good try tomorrow. it did give a positive result when I ran "rfkill" indicating that bluetooth was detected and not blocked. Only problem is no scanning for MAC of headset. What could I have done wrong? Load bluetooth Tahr.sfs together perhaps?

Thanks

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

#21 Post by rcrsn51 »

pchan wrote:What could I have done wrong? Load bluetooth Tahr.sfs together perhaps?
rcrsn51 wrote:All you need to test this is a clean install of Tahrpup and the bluez-streaming PET by tempestuous.

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

#22 Post by tempestuous »

pchan wrote:# lsusb
Bus 006 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

# hcitool scan
Device is not available: No such device
Yes, I don't think the problem is related to a conflict with the wifi device.
A Google search for that USB device ID reveals many failures under Linux, and a variety of patches to the bluetooth kernel modules to fix the problems ... although tahrpup's 3.14.20 kernel should be OK ??

pchan, I wonder if you can't bring your USB interface to life just with this command -

Code: Select all

hciconfig hci0 up
If that appears to fail, try these more comprehensive options -

Code: Select all

hciconfig hci0 down
hciconfig hci0 reset
hciconfig hci0 up
If any of that appears successful, go ahead and try -

Code: Select all

hcitool scan

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

#23 Post by rcrsn51 »

tempestuous wrote:pchan, I wonder if you can't bring your USB interface to life just with this command -

Code: Select all

hciconfig hci0 up
I can confirm the following with my external adapter. If I run "hiconfig hci0 down", the adapter disappears from "hcitool dev" and nothing else works. Once I bring it back up, things start working again. Hopefully, that's all that pchan needs.

I suspect that if your BT adapter does not appear in "rfkill list", you are out of luck. You have an incompatible adapter.

I found that bluez-simple-agent is a bit fragile. It will survive several reboots, then quit connecting. So I wrote a little re-pair script that may help.

Code: Select all

#!/bin/sh
echo 0000 | bluez-simple-agent hci0 XX:XX:XX remove
aplay -D btheadset /usr/share/audio/2barks.wav

pchan
Posts: 130
Joined: Fri 12 Oct 2012, 12:17
Location: Kuala Lumpur, Malaysia

#24 Post by pchan »

tempestuous wrote:
pchan wrote:
pchan, I wonder if you can't bring your USB interface to life just with this command -

Code: Select all

hciconfig hci0 up
If that appears to fail, try these more comprehensive options -

Code: Select all

hciconfig hci0 down
hciconfig hci0 reset
hciconfig hci0 up
If any of that appears successful, go ahead and try -

Code: Select all

hcitool scan
tempestuous and rcrsn51,


NOTE : Testing done in LxTahr 14.12 no Pae (will try in Tahr 6.01 no pae testing tomorrow)

Okay. Some progress here.

I ran " hcicinfig hci0 up
Then
"Hcitool scan"

Scanning started ....

Located headset MAC (14:07:24:33:08:2A) !!!

Next
"bluez-simple-agent hci0 14:07:24:33:08:2A"

.................
.....................
.................
connection refused. (oh Oh!)

Tried
tempestuous wrote: hciconfig hci0 piscan
bluetooth-agent 0000

then power-off / power-on your bluetooth receiver. Hopefully it will now show that it is paired.
But not successful ...

Positive development : scanning is OK.
Issue : connection refused.
Attachments
scan.zip
(562 Bytes) Downloaded 472 times

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

#25 Post by tempestuous »

OK, some good progress.
pchan wrote:"bluez-simple-agent hci0 14:07:24:33:08:2A"
.................
connection refused.
It sounds like your bluetooth headset needs to authorise the pairing. Is there an instruction manual that came with that device? Maybe there's some particular button you need to press at that point?
I would make a guess there's an LED on the headset which might flash or remain on to indicate pairing status.

pchan
Posts: 130
Joined: Fri 12 Oct 2012, 12:17
Location: Kuala Lumpur, Malaysia

#26 Post by pchan »

tempestuous and rcrsn51,

I am too excited to write this report.

Very happy indeed!

I tried again "bluez_4.101-streaming.pet" using fresh Tahrpup 6.01 testing no pae.

Straightaway > "hciconfig hci0 up" before "hcitool scan"

sh-4.3# rfkill list
0: phy0: wlan
Soft blocked: no
Hard blocked: no
1: hci0: bluetooth
Soft blocked: no
Hard blocked: no
sh-4.3# hciconfig hci0 up
sh-4.3# hcitool scan
Scanning ...
14:07:24:33:08:2A H
88:53:2E:33:75:D3 YUYI-VAIO
30:A8:DB:02:95:69 Xperia E1
sh-4.3# bluez-simple-agent hci0 14:07:24:33:08:2A
Release
New device (/org/bluez/30268/hci0/dev_14_07_24_33_08_2A)



PAIRING SUCCESS!

Edited /etc/asound.conf : "XX:XX:XX:XX:XX:XX" -- > "14:07:24:33:08:2A"

Open Dead beef > edit . preference > bluetooth headset >

music.mp3 played successfully through bluetooth headset!!!!

The impossible (to me) became possible once again thanks to

tempestuous and rcrsn51,

Now, I am so scared to lose this setup.

I like distros like Linux lite but there is something so nice about puppies.

Installations in case of mess up is just a matter of extracting ISO and setting up grub. If i mess up my Linux lite, ..... (hopefully i won't) , I have to go through all the reinstall, updates, etc etc. (ie unless I keep on remastersys it up to date)

So, it looks like I can stay with Puppy after all.

Of course, thanks also to barryK, 666philb, peebee, rg66 whose puppies i follow closely.

pchan
Posts: 130
Joined: Fri 12 Oct 2012, 12:17
Location: Kuala Lumpur, Malaysia

#27 Post by pchan »

rcrsn51 wrote:

Code: Select all

#!/bin/sh
echo 0000 | bluez-simple-agent hci0 XX:XX:XX remove
aplay -D btheadset /usr/share/audio/2barks.wav
rcrsn51,

How do i use this re pair script in case i need it?

Change "hci0 XX.XX.XX" to "hci0 my.bt headeset mac" ?
then run the whole script in terminal?

right click in rox manager > new script > add the folowing lines >

#!/bin/sh
echo 0000 | bluez-simple-agent hci0 14:07:24:33:08:2A remove
aplay -D btheadset /usr/share/audio/2barks.wav

named it "pair_again"

Why the word, "remove" if it is to pair again? Does it mean - after this need to run

"bluez-simple-agent hci0 14:07:24:33:08:2A" again ???

sorry to ask but I am a complete dummy on computer technology matters.

Thanks
Last edited by pchan on Mon 02 Feb 2015, 12:56, edited 2 times in total.

pchan
Posts: 130
Joined: Fri 12 Oct 2012, 12:17
Location: Kuala Lumpur, Malaysia

#28 Post by pchan »

Oh no,

Another issue cropped up.

Deadbeef was OK. Even after restart, pairing was maintained.

smplayer 14.9.0 > under preference > audio output > options to choose bluetooth headset never showed up.

In VLC 2.1.4 > tried alsa audio output > bt headset > nothing.
(Difficult to understand why DeadBeef can but VLC cannot ... )

In my multi soundcard system , i can only get sound using wired headset and speaker if I select card 2. SB (HDA ATI SB) device 0: ALC269VB Analog [ALC269VB Analog]

will have to download and try gnome mplayer or something maybe.

>
EDIT : (SOLVED FOR VLC) > preference > all > Audio > output modules > ALSA > Audio output channels > change from stereo to mono > Successful transfer of sound to bluetooth headset!

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

#29 Post by tempestuous »

pchan wrote:smplayer 14.9.0 > under preference > audio output > options to choose bluetooth headset never showed up.
It might be that the authors of the smplayer gui failed to accommodate all possible options.
But you should be able to "hard-code" the smplayer configuration file - open /root/.config/smplayer/smplayer.ini in Geany, and find the line that starts with -

Code: Select all

driver\audio_output=...
change it to -

Code: Select all

driver\audio_output="alsa:device=bluetooth"
Make sure you include the quotation marks. Save.

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

#30 Post by rcrsn51 »

@pchan: This is great news! I was starting to worry.

I did some testing in LxTahrpup and also had flaky results. I don't know why it would be different.

I also had some trouble with VLC. In the post here there is an asound.conf with some "default" sections. It may work better for you.

I actually had some bad experiences with my external BT dongle. At one point, it got confused and needed the hciconfig up|down|reset procedure. But then bluez-simple-agent would crash! It needed a full COLD reboot to get working again. But once I had a successful pairing, it was stable.

Regarding the re-pair script.

1. Go to your /root/my-applications/bin folder.
2. Start a script called btrepair.
3. Add the code, but replace XX:XX:XX with the address that you used to set up the pairing.
4. To run it, open a terminal and type: btrepair

"Remove" is needed to remove the old pairing from the database before adding the new pairing.

pchan
Posts: 130
Joined: Fri 12 Oct 2012, 12:17
Location: Kuala Lumpur, Malaysia

#31 Post by pchan »

tempestuous wrote: But you should be able to "hard-code" the smplayer configuration file - open /root/.config/smplayer/smplayer.ini in Geany, and find the line that starts with -

Code: Select all

driver\audio_output=...
change it to -

Code: Select all

driver\audio_output="alsa:device=bluetooth"
Make sure you include the quotation marks. Save.
Thanks tempestuous

This Worked perfectly! Smplayer can now play through my bt headset! so nice!
Your tutorial in the first post was helpful and easy to follow. Maybe, someone may need the magic "up" "down" "reset" switches.
rcrsn51 wrote: In the post here there is an asound.conf with some "default" sections. It may work better for you. ...


btrepair.
Thanks rcrn51, I added the default card 2 in my asound.conf.

I have also created the btrepair script in /root/my-applications/bin/

With both your help ..... now, I am able to enjoy my Bluetooth Headset in puppy Tahrpup,

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

#32 Post by rcrsn51 »

@pchan: Here is one more question. If you run your WiFi and BT streaming audio at the same time, is there any interference? Does that btcoexist package have any value?

pchan
Posts: 130
Joined: Fri 12 Oct 2012, 12:17
Location: Kuala Lumpur, Malaysia

#33 Post by pchan »

rcrsn51 wrote:@pchan: Here is one more question. If you run your WiFi and BT streaming audio at the same time, is there any interference? Does that btcoexist package have any value?


I didn't sense any interference. In fact, while watching a short movie using my Bluetooth Headset, I was downloading a 70 mb file. I also did some browsing with palemoon browser.

So, I guess there is no interference.

About the "btcoexist" I followed your latest instructions and didn't use anything other than "bluez_4.101-streaming.pet."

Sorry, i know you went through all the troubles to get me the "btcoexist" but the "up" thing from tempestuous did the trick. The "bluez_4.101-streaming.pet" which tempestuous mentioned was from you, actually detected my inbuilt Bluetooth correctly and was able to let bluetooth coxist with my wifi.

You have been a great help once again. Thanks.

How I wish, the bluetooth capability will become standard feature for all the new puppy linux so new users don't have to struggle so much. It was fun though to get our hands dirty as long as there is a good puppy developer guiding you. If I mess around by myself, i would have easily messed everything up.

ONE LAST THING TO ADD :

I tried again to install "bluez_4.101-streaming.pet" in LxTahr 14.12 no pae (based on tahrpup 6.0CE I think) and confirm that ... somehow my Bluetooth headset was refused connections. Why ... I don't know. As far as Tahrpup 6.01 no pae (testing) is concern, "bluez_4.101-streaming.pet" continued to work without problem with my Bluetooth headset.

Will be interesting to know if "bluez_4.101-streaming.pet" can work with
Precise ?
Slacko ?
Racy ?
Lupu ?

(Hope others who are using these other flavors of Puppy Linux will report their experiences with "bluez_4.101-streaming.pet" if they own a Bluetooth headset. It will be helpful.)

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

#34 Post by rcrsn51 »

For information about the PeasyBT Bluetooth Manager, go here.
Last edited by rcrsn51 on Mon 17 Aug 2015, 23:39, edited 7 times in total.

gcmartin

#35 Post by gcmartin »

Would that tool and instructions be a 2-way transfer ability or one-way ability?
And, assuming the script works in FATDOG, are the instructions steps the same?

Interested :idea:

Post Reply