LinuxMCE Forums

General => Developers => Topic started by: Matthew on November 17, 2007, 04:21:49 pm

Title: Bluetooth Speakers?
Post by: Matthew on November 17, 2007, 04:21:49 pm
Bluetooth speakers (http://www.google.com/products?q=%22bluetooth+speakers%22&btnG=Search+Products&scoring=prd), with integrated DAC/amp/speakers, are starting to appear on the market. LMCE already has some BT integration, using a profile that lets some Symbian phones operate an Orbiter for remote control. If I want to use some BT speakers instead of, say, a Squeezebox for audio distribution, where would I start in the LMCE source code? Anyone have any experience coding to deliver audio to devices like BT speakers?
Title: Re: Bluetooth Speakers?
Post by: hari on November 18, 2007, 04:49:13 pm
you can drive your speakers with alsa and bluez. The slimserver provides an audio stream via :9000/stream.mp3.

best regards,
Hari
Title: Re: Bluetooth Speakers?
Post by: Matthew on November 18, 2007, 10:15:06 pm
you can drive your speakers with alsa and bluez. The slimserver provides an audio stream via :9000/stream.mp3.

best regards,
Hari
When I try to connect to my LMCE server, say with (curl 'http://192.168.0.10:9000/stream.mp3') , I see there's no server listening to that port. Maybe I didn't configure a slimserver in my LMCE when I installed it? How can I turn it on? Do I just start up the BT speakers near the LMCE after inserting the BT dongle into the LMCE?
Title: Re: Bluetooth Speakers?
Post by: PeteK on November 18, 2007, 10:27:01 pm
Slimserver is installed and configured when it detects a squeezebox currently, I think.  YOu may have to add it manually if you're not using a squeezebox.  There is a template for it, so you should just have to add it under the core.

-PeteK
Title: Re: Bluetooth Speakers?
Post by: Matthew on November 18, 2007, 10:37:42 pm
Slimserver is installed and configured when it detects a squeezebox currently, I think.  YOu may have to add it manually if you're not using a squeezebox.  There is a template for it, so you should just have to add it under the core.

-PeteK
Does the LMCE host with the BT dongle have to be a core server, or can it be some other mode? I'd like to see what is the cheapest (therefore weakest) machine I can use to drive the BT speakers, like maybe an iPaq or similar (low wattage, silent, slow, cheap, but good enough).
Title: Re: Bluetooth Speakers?
Post by: PeteK on November 19, 2007, 05:43:24 am
The slimserver should be installed on the core, but I think you can use any MD/PC to run the squeezebox emulator software.
Title: Re: Bluetooth Speakers?
Post by: Matthew on November 19, 2007, 11:19:38 am
The slimserver should be installed on the core, but I think you can use any MD/PC to run the squeezebox emulator software.
Do you know if a single core can individually address multiple separate BT speaker pairs, each in a separate room, or how I config separate PCs each with a BT dongle to address its own BT speaker  pair (all accessing a single unified LMCE media library)?
Title: Re: Bluetooth Speakers?
Post by: hari on November 20, 2007, 01:58:06 pm
The slimserver should be installed on the core, but I think you can use any MD/PC to run the squeezebox emulator software.
Do you know if a single core can individually address multiple separate BT speaker pairs, each in a separate room, or how I config separate PCs each with a BT dongle to address its own BT speaker  pair (all accessing a single unified LMCE media library)?
this depends if the bluetooth chip on your core can handle multiple connections at a time. I would prefer a dongle on each md, so u get a unique ip in the slimserver device selection box.
But you have to try this out, i don't think anybody is using this combination yet..

much luck,
hari
Title: Re: Bluetooth Speakers?
Post by: Matthew on November 20, 2007, 04:01:12 pm
The slimserver should be installed on the core, but I think you can use any MD/PC to run the squeezebox emulator software.
Do you know if a single core can individually address multiple separate BT speaker pairs, each in a separate room, or how I config separate PCs each with a BT dongle to address its own BT speaker  pair (all accessing a single unified LMCE media library)?
this depends if the bluetooth chip on your core can handle multiple connections at a time. I would prefer a dongle on each md, so u get a unique ip in the slimserver device selection box.
But you have to try this out, i don't think anybody is using this combination yet..
What about a USB hub filled with BT dongles, one for each speaker set, on a single core? Do you think bluez and the other BT SW can handle that? If not, do you know what is the specific name of the "multiple device connections" feature that the BT dongle must support, or some models that do support it?

I like the simplicity (and cheapness) of a single PC serving multiple terminals throughout the home.
Title: Re: Bluetooth Speakers?
Post by: hari on November 20, 2007, 04:15:19 pm
The slimserver should be installed on the core, but I think you can use any MD/PC to run the squeezebox emulator software.
Do you know if a single core can individually address multiple separate BT speaker pairs, each in a separate room, or how I config separate PCs each with a BT dongle to address its own BT speaker  pair (all accessing a single unified LMCE media library)?
this depends if the bluetooth chip on your core can handle multiple connections at a time. I would prefer a dongle on each md, so u get a unique ip in the slimserver device selection box.
But you have to try this out, i don't think anybody is using this combination yet..
What about a USB hub filled with BT dongles, one for each speaker set, on a single core? Do you think bluez and the other BT SW can handle that? If not, do you know what is the specific name of the "multiple device connections" feature that the BT dongle must support, or some models that do support it?

I like the simplicity (and cheapness) of a single PC serving multiple terminals throughout the home.
bluez should run fine with multiple hci devices (tested two at a time some time ago). I think the newer dongles should all support multiple connections. Ask your preferred dealer for model information..

regards,
Hari
Title: Re: Bluetooth Speakers?
Post by: Matthew on November 20, 2007, 06:17:19 pm
bluez should run fine with multiple hci devices (tested two at a time some time ago). I think the newer dongles should all support multiple connections. Ask your preferred dealer for model information..
I think the real problem will be in the LMCE GUI, when both dongles detect the same BT speaker at the same time, and request pairing with them, needing the GUI to pick a dongle to which to assign the speakers to. Especially if the dongles can pair to multiple devices, that GUI could become complex. But really it shouldn't matter, because multiple dongles or a multidevice single dongle should just present the core BT interfaces as a pool, perhaps reassigned more precisely in an admin setting, with the BT speakers assigned to a room rather than the network HW supporting it. I doubt the current LMCE works that way, but I'll try it and find out.
Title: Re: Bluetooth Speakers?
Post by: Matthew on January 13, 2008, 02:51:51 am
Slimserver is installed and configured when it detects a squeezebox currently, I think.  YOu may have to add it manually if you're not using a squeezebox.  There is a template for it, so you should just have to add it under the core.

I just got an "Insignia" brand Bluetooth "MP3 Speaker" ($79 at BestBuy) that I'm trying to use under 0710b2. If I have the (DBT-120) Bluetooth dongle in my Hybrid, and I plug in & turn on the Insignia, nothing happens. If I leave it on, then plug the BT dongle in/out, the Hybrid's Orbiter reports:
Code: [Select]
I detected a new plug & play device:
Manufacturer: Unknown Category: Unknown Bluetooth ID: NS-
BTS21 (00:15:71:70:D4:91)
Should I use it?
But the list of devices to use it as is just "Symbian Series 60 mobile", "Windows Mobile Smartphone", "Windows Mobile Smartphone 2005" (other than "no, don't use it once/always"). How do I add this device to that list? When I go to the Adminsite Home -> Wizard -> Devices -> A/V Equipment , I'm not sure how to add the Insignia speakers as a device. Or how to add Slimserver as a device, then get Slimserver to stream to the speakers. Any help?
Title: Re: Bluetooth Speakers?
Post by: hari on January 13, 2008, 03:30:42 am
select "don't use" and install some alsa/bluez/sco stuff (as already stated by my first response). This will give you a sound device. From there on you can pretend they were cabled speakers with an amp and a soundcard.

best regards,
Hari
Title: Re: Bluetooth Speakers?
Post by: Matthew on January 13, 2008, 04:28:48 am
select "don't use" and install some alsa/bluez/sco stuff (as already stated by my first response). This will give you a sound device. From there on you can pretend they were cabled speakers with an amp and a soundcard.

Well, I'm intrigued by the ability to use the speakers as if they were a SqueezeBox. The wiki (http://wiki.linuxmce.org/index.php/Use_network_audio_players_for_a_whole-house_music_solution) says that when a SqueezeBox connects to DHCPd, LMCE's DHCPd monitors detects and identifies the SqueezeBox by its MAC address, then starts the SlimServer. The Insignia BT speakers don't make a DHCP request, and I see that there's no SlimServer running at http://dcerouter:9000/stream.mp3 (even while I'm playing audio stored on the harddrive through the Hybrid's alsa PCI soundcard). But I'd like to trigger that SlimServer startup at that address, and make maybe madplay on an LMCE node pipe data from the SlimServer (curl | madplay, I suppose) to the Insignia speaker set (some madplay/bluez invocation that I don't know). I'd need to know what the DHCP monitor triggers to start the SlimServer, so my curl/madplay/bluez/whatever wrapper can trigger it. I can probably get bluez to detect the speakers and register them (ultimately in the DB), but I might need some help getting them registered in a room, which should probably be done by the floorplan.

Bluez cluez, pleaze?
Title: Re: Bluetooth Speakers?
Post by: hari on January 13, 2008, 11:03:14 am
I'd need to know what the DHCP monitor triggers to start the SlimServer
Some scripts parses the output from the DHCP server and sends a dce message with the MAC to the DHCP plugin. That looks into the table DHCPDevice and adds the appropriate devices.

For bluez you probably want to use snd-bluez-sco or snd-bt-sco.

regards,
Hari
Title: Re: Bluetooth Speakers?
Post by: Matthew on January 13, 2008, 02:33:11 pm
I'd need to know what the DHCP monitor triggers to start the SlimServer
Some scripts parses the output from the DHCP server and sends a dce message with the MAC to the DHCP plugin. That looks into the table DHCPDevice and adds the appropriate devices.

For bluez you probably want to use snd-bluez-sco or snd-bt-sco.

Thanks, that's enough to almost get started (need to find which is the exact script that starts when a new BT device is detected, and get it to sub for the DHCP request of a new Squeezebox).

I'll probably get back to this after I get through with the "Status updates in Floorplan" revisions, since they're now related and both depend on an updatable Floorplan.
Title: Re: Bluetooth Speakers?
Post by: 1audio on January 13, 2008, 07:19:03 pm
Does Slimserver support the Bluetooth speaker (bluetooth audio profile)? I think Slimserver may be a sidetrack to adding the speakers. You may need to look at some of the other audio options in Linux.

Slimserver is good but its really designed to support Squeezeboxes and their clones on a network. But you really need an independent audio stream to be sent to the BT driver under DCERouter control (hence the value of Slimserver if you can configure it that way).

There is another Linux network audio solution (at least) called Pulse Audio that hooks into Alsa and sends the audio stream out the network.

LMCE currently doesn't know how to handle more than one audio device per MD but the BT may look like a local audio device to the system and Alsa would the audio stream to the BT driver.
Title: Re: Bluetooth Speakers?
Post by: Matthew on January 14, 2008, 05:16:38 am
Does Slimserver support the Bluetooth speaker (bluetooth audio profile)? I think Slimserver may be a sidetrack to adding the speakers. You may need to look at some of the other audio options in Linux.

Slimserver is good but its really designed to support Squeezeboxes and their clones on a network. But you really need an independent audio stream to be sent to the BT driver under DCERouter control (hence the value of Slimserver if you can configure it that way).

There is another Linux network audio solution (at least) called Pulse Audio that hooks into Alsa and sends the audio stream out the network.

LMCE currently doesn't know how to handle more than one audio device per MD but the BT may look like a local audio device to the system and Alsa would the audio stream to the BT driver.

Thanks for the advice. I was advised earlier in this topic that SlimServer would do what I want. I don't think SlimServer directly supports the BT speakers, but I think sharing the archtecture already built into LMCE, SlimServer, with either its SqueezeBox HW clients or a new client that behaves essentially the same by wrapping the BT speakers in a SW client that triggers SlimServer and pulls audio from it like the SqueezeBox does, then sends audio to the BT speakers, is the most consistent with how LMCE does it.

However, the SlimServer might not be the best streaming server. Probably the best is Icecast, for fidelity, performance, scalability, programmability, and with a larger and more open developer community. But Asterisk also already has a streaming RTP server. So adding Icecast would mean a third streaming server. Pulse Audio and others would mean a third one, too, with limited application compared to the others. Probably using the Asterisk RTP server would be best overall, but it's so integrated into Asterisk (it's not even a separate "stack" or module, but RTP is processed all through the Asterisk audio signal path) that such is probably the least feasible.

Probably the fastest way to get something going that isn't a dead end is to wrap madplay in something triggered by the existing BT detection script, that triggers whatever is monitoring DHCP for SqueezeBox MACs, hitting SlimServer for audio. The existing integration of SlimServer/SqueezeBox probably means the minimum work to integrate the new SW/BT client into the Floorplan. Maybe all of their streaming servers should be factored into a single multiprotocol server (or bundle), which use the DB and DCE rather than their native, incompatible data and IPC. Maybe all the audio should be run under a GStreamer pipeline. I'll be in a better position to figure that out once I've got something up and running. In no small part because I'll be able to listen to music while thinking about it.
Title: Re: Bluetooth Speakers?
Post by: 1audio on January 14, 2008, 05:32:38 am
Probably the fast track would be to add Softsqueeze http://softsqueeze.sourceforge.net/ (http://softsqueeze.sourceforge.net/) and point its audio output to the BT device. The challenge would be to get it to not collide with Alsa in the same box and to talk to a Slimserver at the same IP address.
Title: Re: Bluetooth Speakers?
Post by: bulek on January 14, 2008, 09:50:54 am
Probably the fast track would be to add Softsqueeze http://softsqueeze.sourceforge.net/ (http://softsqueeze.sourceforge.net/) and point its audio output to the BT device. The challenge would be to get it to not collide with Alsa in the same box and to talk to a Slimserver at the same IP address.
Hi,

I just tried to add softsqueeze to fake LMCE to think it's HW player. I sent detection message and it got "detected", but it seems that it's not controllable through LMCE. Something is different, so it doesn't work. But it would be nice to have player on your laptop winPC, that could be synhonized with HW squeezeboxes and controlable from LMCE....

Anyone with more experience doing this (I will start new thread on this) ?

Regards,

Bulek.
Title: Re: Bluetooth Speakers?
Post by: Matthew on January 14, 2008, 05:12:52 pm
Probably the fast track would be to add Softsqueeze http://softsqueeze.sourceforge.net/ (http://softsqueeze.sourceforge.net/) and point its audio output to the BT device. The challenge would be to get it to not collide with Alsa in the same box and to talk to a Slimserver at the same IP address.
Hi,

I just tried to add softsqueeze to fake LMCE to think it's HW player. I sent detection message and it got "detected", but it seems that it's not controllable through LMCE. Something is different, so it doesn't work. But it would be nice to have player on your laptop winPC, that could be synhonized with HW squeezeboxes and controlable from LMCE....

Anyone with more experience doing this (I will start new thread on this) ?

I'm following that new "Adding softsqueeeze as LMCE's player (http://forum.linuxmce.org/index.php?topic=3805.0)" topic thread.
Title: Re: Bluetooth Speakers?
Post by: tkmedia on January 14, 2008, 05:25:20 pm
I had my Hauppauge Media MVP playing as squeeze box client at one point.
Could control it from the unit and through the slimserver web port 9100??
This would also be nice to control from LinuxMce. ;)
http://www.mvpmc.org/ (http://www.mvpmc.org/)
Title: Re: Bluetooth Speakers?
Post by: Matthew on January 14, 2008, 05:40:52 pm
I had my Hauppauge Media MVP playing as squeeze box client at one point.
Could control it from the unit and through the slimserver web port 9100??
This would also be nice to control from LinuxMce. ;)
http://www.mvpmc.org/ (http://www.mvpmc.org/)

The flip side is whether a client to some other existing LMCE server component can get audio streams. Like whether there's a way to use a MythTV client to get audio streams from MythTV, and send them to the BT speakers. Or some other existing streaming server (if there is one).
Title: Re: Bluetooth Speakers?
Post by: bulek on January 14, 2008, 09:23:19 pm
Hi,

there is another idea that might help you, although didn't do much on it in a last year. But I had xine audio only player working on core beside "normal" xine player for Orbiter and it's output was totally independent and controllable from other room. Repeating this wouldn't be too hard, we could just make new branch and start working on it - the whole idea is to start Xine according to some device data without any video resources, so it doesn't interfere with Orbiter's Xine that has video window.... I inserted some if then elses at that time (few hours work)...

The bigger problem was how to get controls for that Xine on Orbiter (currently only squeezebox and "normal Xine" is supported in that way, that media scenarios are automatically created)... To get me going, Aaron created those scenarios manually in database for me and voila, it worked.... There is also some work needed to get separate volume control - I think that currently some weird plugin takes care of sound volume (app_server ??? - not sure)...

I talked to one of Pluto developers and he said he will be able to help if we get stuck with it. I have waited for some time, because he said that he's doing major recoding on Xine player to add ability to sync more players, but have no clue if this is already done or not....

If you ask me, this would be best solution, cause it could come handy in many situations - basically you can get whole house audio on one Core with cheap sound cards... if they output to Bluetooth speakers, that's also fine :-) .... And of course, Xine player is maintained (at least at the moment), so we're not forking dead end...

All pretty much described here : http://forum.linuxmce.org/index.php?topic=3161.0 (http://forum.linuxmce.org/index.php?topic=3161.0)

HTH,

regards,

Bulek.

 
Title: Re: Bluetooth Speakers?
Post by: Matthew on January 15, 2008, 07:41:31 am
I think the right way to do this is to make the BT detection script start up a streaming client (like SoftSqueeze or curl | madplay) and send that client's audio over the BT to the speakers. Which probably means the client needs a new (probably virtual) ethernet interface, with a dhclient getting a new IP# (that triggers DHCP, and SlimServer) so the stream goes to a new independent device.

Which means getting the SoftSqueeze running properly along those lines, as discussed in that other thread, is the first order of business.
Title: Re: Bluetooth Speakers?
Post by: Matthew on January 23, 2008, 06:31:23 am
I'd need to know what the DHCP monitor triggers to start the SlimServer
Some scripts parses the output from the DHCP server and sends a dce message with the MAC to the DHCP plugin. That looks into the table DHCPDevice and adds the appropriate devices.

For bluez you probably want to use snd-bluez-sco or snd-bt-sco.

I've been trying to get any bluetooth audio to these speakers with any technique, no matter how manual, and not even integrated into LMCE (later for autodetect speakers, etc). I've been trying every howto for btsco, bluetooth-alsa, a2dpd/headsetd, everything. And nothing works. Is there some clear howto that will work for getting an A2DP profile audio device to play audio sent from a file on LMCE to the DBT-120 dongle?