Bluetooth + streaming for tahrpup 6.x

How to do things, solutions, recipes, tutorials
Message
Author
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:

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

#36 Post by rcrsn51 »

gcmartin wrote:Would that tool and instructions be a 2-way transfer ability or one-way ability?
rcrsn51 wrote:However, it needs testing.
How can I answer questions about something that has not yet had an actual test with a phone?
And, assuming the script works in FATDOG, are the instructions steps the same?
See above.

gcmartin

#37 Post by gcmartin »

rcrsn51 wrote:If you are interested, post a message and I will provide some instructions.
I understand.

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

#38 Post by pchan »

rcrsn51 wrote:How to Transfer Files using Bluetooth

This package is a companion to tempestuous' bluez_4.101-streaming.pet. It contains the tools for performing file transfers between Puppy and a remote BT device like a phone. However, it needs testing.

If you are interested, post a message and I will provide some instructions.
rcrsn51,

Yes, i am interested but hope it will not upset my headset connections which for the moment takes priority.

It is definitely a plus point to be able to transfer files wireless ly in places where I cannot file share through samba because I am not connected to the same wifi router.

BTW, I am also enjoying your peasyWifi. A great tool which i am still trying out.

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

#39 Post by rcrsn51 »

@pchan: I am sending you a PM.

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

#40 Post by pchan »

rcrsn51 wrote:@pchan: I am sending you a PM.
I installed the pet

Click on the Bluetooth icon on the tray.

Started bt file manager.

Click on check > a window open and close rapidly.

Click on make discoverable > a window open up and wait for pairing 0000

On mobile phone, started Bluetooth searching for device > could not find puppy.

Search several times more but no puppy.

On puppy , click on scan for devices > a window open and scanning ... Then closes without finding anything (mobile phone was set discoverable for 1 hour. )

So, no luck in getting it to work yet.

Thanks for the efforts.

EDIT

just realized that I might be doing it wrong.

I installed BT file manager only, the pet you sent me. Should I also install the obexfs.. pet??? It would make sense if the pet you sent me is only for easy management and configuring. The real tool for file transferring is the obexfs...pet.

I'll try again later tonight.


EDIT :

Installed obexfs_tahrpup-0.11.pet
Started peasy bt file manager

Result : Mobile cannot find puppy / puppy cannot find mobile
(Also tried the bring device up - but no go)

Post Reply