Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 18 Sep 2018, 17:28
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Network
Bluetooth for Slacko 5.6 - Stream audio from PC.
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [5 Posts]  
Author Message
greengeek


Joined: 20 Jul 2010
Posts: 5162
Location: Republic of Novo Zelande

PostPosted: Sat 14 Jul 2018, 03:26    Post subject:  Bluetooth for Slacko 5.6 - Stream audio from PC.
Subject description: slackstream utility for streaming bluetooth audio
 

I needed to get a bluetooth speaker connected to my Slacko 5.6 derivative in order to improve the quality of sound output from my laptop speakers.

Google searches and murga forum searches convinced me that there are potentially many pitfalls with getting bluetooth running, and that it is very easy to load too little, or too much software, or to load completely the wrong software.

I had a chuckle when I found this post from "Richard Cranium":
- "Bluetooth is a wonderful rat hole where you can spend lots of hours learning about it that could be used for other things, such as drinking wine or beer. The version of bluez in slackware is kinda old. (Don't try to use it to connect to a heart rate monitor, for instance.) See https://www.bluetooth.org/en-us/spec...specifications for the various things that are supported by various versions of bluetooth"

If you want to know lots about bluetooth devices the reference he directs you to is worth a look:
https://www.bluetooth.com/specifications

On the other hand - getting bluetooth running for the purposes of streaming your music directory to a BT speaker or BT headset - can be quite easy. I quickly decided I did not want to learn everything about bluetooth - I just wanted to find a quick and easy way to get sound from my bluetooth speaker.

I have posted below a .pet which I use on my Slacko 5.6 derivative to connect to a variety of devices for the purposes of streaming audio from my PC. It is not my intention at this point to connect to a bluetooth phone, or other bi-directional device.

PLEASE NOTE : All of my testing is done on a CD booted Slacko 5.6 with no savefile. There is a risk that my pet could overwrite existing files in your save file. If you want to try my pet I recommend that you boot with pfix=ram or hide your savefile (or have a good backup of it somewhere) so that you don't get any weird results. Especially - you don't want to end up with multiple BT packages lying around your system. You really only need the basics.

This pet is based on the puppyBT_2.1 package (I don't remember where I got that or who wrote it) combined with parts of rcrsn51's bt4stretch pet and also combined with a small amount of my own code. I have called my pet "slackstream" to ensure there is no confusion with the official packages.

Here is what to do:
1) Load the slackstreamBT pet available here:
http://www.mediafire.com/file/uoy6pnk6r6quqzm/slackstream_BT-0.1.pet
2) Turn on your bluetooth device (make sure you have no other PCs or phones that automatically connect to that device!)
3) Run "slackstream" from the network menu
4) Work your way down the list of functions:
- scan for devices
- pair with the device you want.
- click the "btheadset" button
- choose the directory that contains the test files you wish to play
- click "play"

Before you shut down click the "Remove a pairing" button to let your device become available to other phones and PCs.
Any problems let me know...


Troubleshooting and extending your bluetooth knowledge:

The scan function only detects your device if the device is currently unpaired.

My pet only tries to play your media files with mplayer in "alsa" mode. Other software may or may not be able to access the alsa interface that is set up for bluetooth. Be prepared to try all sorts of things if you want to get more fancy with what/how you want to stream.

Once you have loaded the apropriate bluetooth software for your puppy check out the files currently in /etc/bluetooth - these rules will determine the behaviour of your BT adapter.

In weird cases may need to turn on then load firmware (Arch wiki has lots of info):

Note: Before using the bluetooth device, make sure that it is not blocked by rfkill. Enter the following command into a terminal:
rfkill list

- For a better understanding of what is happening under the hood you can use this alternative method rather than relying totally on the slackstream gui started from the menu:

1) Install slackstreamBT.pet-0.1
2) Make a new directory in /root and call it /music. Copy one or more music files into that directory (just for the purposes of this test)
3) Turn BT external device on (making sure it does not get grabbed and paired by some other phone or PC)
4) Type the following command in a terminal:
hcitool scan
(and then record the BT address for your external device).
5) Type the following command in a terminal:
bluetooth-agent \PPPP \XX:XX:XX:XX:XX:XX
(where PPPP is the pin code for your device and XX:XX:XX:XX:XX:XX is the BT address for your external device as discovered in the scan).
6) Start the slackstreamBT gui from the network menu and click "btheadset" button (this writes a new .asoundrc file into /root (make a copy of this file somewhere in case you want to use it some other day without starting slackstream - this file is the key to getting alsa to drive the BT stream to BT heaphones or speaker))
7) Type the following command:
mplayer -ao alsa /root/music/*.*
(Which will use mplayer to sequentially play through every file in that directory)

8.) When mplayer has finished playing the /root/music directory you will probably want to release the pairing so that the external device is available to other devices. Simply type the following command in terminal:
bt-device -r \XX:XX:XX:XX:XX:XX
.

Last edited by greengeek on Mon 03 Sep 2018, 03:09; edited 12 times in total
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 5139
Location: Ontario

PostPosted: Sat 14 Jul 2018, 11:17    Post subject:  

An alternative to bluetooth that works well is USB sound card adaptor.
It will output high quality stereo. Drivers should be builtin.

http://murga-linux.com/puppy/viewtopic.php?p=998602#998602
____________________________________________________
Back to top
View user's profile Send private message 
HerrBert

Joined: 03 Nov 2016
Posts: 34
Location: NRW, Germany

PostPosted: Sat 14 Jul 2018, 12:05    Post subject:  

works on slacko 5.7.0 with audacious 3.6

not the usual bloat and very easy to use.

alsamixer gets corrupted but no problem as i don't use savefiles.

thank you very much
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5162
Location: Republic of Novo Zelande

PostPosted: Mon 16 Jul 2018, 05:44    Post subject:  

Hi Herr Bert, thanks for the Slacko 5.7 report. Good to know that it works there too.

I hope I will one day understand how to make alsamixer work with the new asoundrc setup. I think Zigbert has done some work with this to make pmusic and pEqualizer work better with Alsa and asound files

SFR also mentioned that his soft mixer affects alsamixer in this manner. It would be nice to make all this compatible somehow but for now I am just happy that I can stream BT when I need to. (I am the same as you in having no savefile so the corrupt alsamixer is not a problem - reboot brings me back to normal state).

For anyone that wants it I have just added some more info to the first post - to describe more about the actual CLI commands that drive the connect/disconnect process. Might be useful to someone, especially if they want to build a better gui or make a better player.
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5162
Location: Republic of Novo Zelande

PostPosted: Mon 03 Sep 2018, 03:01    Post subject:  

Updated the link in the first post to point to a new version of the pet which makes the gui a bit more straightforward.

Pet v 0.1 is here:
http://www.mediafire.com/file/uoy6pnk6r6quqzm/slackstream_BT-0.1.pet

If you already have the original pet installed you can just update the file /usr/sbin/slackstream using the new one inside the pet. All other files unchanged.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [5 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Network
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0537s ][ Queries: 11 (0.0043s) ][ GZIP on ]