LinuxMCE Forums

General => Developers => Topic started by: bulek on November 13, 2007, 04:41:38 pm

Title: Audio only Xine player for lmce
Post by: bulek on November 13, 2007, 04:41:38 pm
Hi,

let me introduce the idea I'm thinking and working on for a long time. In my new house, Core is used also as main Whole house audio source and I think that in this case it's much cheaper to use more sound cards (or one with multiple stereo outputs) so I can play for instance 4 independent stereo channels. Patching existing Xine player is not so hard (I've done this already back in Pluto system, but the patch didn't get into codebase). Now I'm willing to repeat this work, cause I think that this would be usefull also for others...

Here's my plan:
- I'd like to use Video Setting parameter - so if it is set to none, than Xine player will be use only as audio player (it won't have it's own window, etc...)
- I'll extend Audio settings parameter so user can specify on which alsa device:channel output will go

- there is one major problem that was present in Pluto and probably still exists in LMCE. There is no simple way to add such player to setup, to be able to control it from Orbiters - currently dirty and inefficient workaround is possible - you create "dummy" MD and then use ID from that MD as ID of our player.

To make long story short, solution we need to have some general way is ability to of adding general media players to LMCE system. Currently exactly same functionality is already implemented for Squeezebox players. When you add them, then you are asked for where is your device located and then all needed media scenarios are created so you can start using device right away.... But I suspect this is the work of particular plugin for those devices, cause nothing similar could be repeated for any other media player. For instance, it would be nice if I start Xine player that connects to DCERouter for the first time, same sequence of device addition could be started and Xine player could be used right away...

But back to my plan. Under Pluto, one could pull down sources, compiles some minimal amount of them, recode and compile Xine player and binary could be added to working system to be tested. Are we on the same level with LMCE now ?
Can we start contributing code ?

I'd love to hear your opinions... There is also some similar work done with Jack audio server, but not sure if this is the same, similar or different thing...


Thanks in advance,

regards,

Bulek.

Title: Re: Audio only Xine player for lmce
Post by: Zaerc on November 13, 2007, 07:28:53 pm
...
To make long story short, solution we need to have some general way is ability to of adding general media players to LMCE system. Currently exactly same functionality is already implemented for Squeezebox players. When you add them, then you are asked for where is your device located and then all needed media scenarios are created so you can start using device right away.... But I suspect this is the work of particular plugin for those devices, cause nothing similar could be repeated for any other media player. For instance, it would be nice if I start Xine player that connects to DCERouter for the first time, same sequence of device addition could be started and Xine player could be used right away...

But back to my plan. Under Pluto, one could pull down sources, compiles some minimal amount of them, recode and compile Xine player and binary could be added to working system to be tested. Are we on the same level with LMCE now ?
Can we start contributing code ?
...

That would be nice, I was thinking that it would be nice to be able to use an old xbox with XBMC in a similar manner.

As far as compiling your own stuff goes, I have no idea what the status is, you might want to check the new mailinglist on that.  I don't know if the new SVN is even in sync with the latest updates. 

Title: Re: Audio only Xine player for lmce
Post by: jetrich on November 13, 2007, 07:48:53 pm
The idea has good potential for integration with NuVo (yes, I still want that  ;D) or other whole-house systems. I personally would love to see this ability built in. Of course then there is the RS232 control and metadata feeds to be concerned with on the NuVo systems...

Jason
Title: Re: Audio only Xine player for lmce
Post by: PeteK on November 13, 2007, 11:08:17 pm
This is definitely a good idea.  A lot of new homes/refits are running 'traditional' distributed audio systems with a dedicated XxX amplifier.  This would make putting LMCE into those installations easier.

-Pete
Title: Re: Audio only Xine player for lmce
Post by: darrenmason on November 14, 2007, 12:51:33 am
I tried creating something similar a while back as well (under Pluto) and the biggest pain was the code dependency between the xine_player and the orbiter code (in fact all xxx_player's and the orbiter code).
The system is currently  built to only allow xxx_players to exist under an Orbiter device. I think this is a design flaw which needs to be rectified. An audio only media director is less likely to actually want an orbiter and in your example (bulek) you would like the players to actually have their code executed on the core and then be assigned to entertainment areas.

I think that the current on screen orbiter device also acts as an A/V device - this should be seperated out and made into another standalone device - such as a "software A/V controller" or something. Instances of this device would be added to Media Directors and be the parent device for xxx_player devices and perhaps for the on screen orbiter as well. It would be this device that could be assigned an entertainment area (not the MD itself). It would then be possible to run multiple instances of this device, either on the core or on MDs, and have them each service their own entertainment areas.

I think that this change would align with the core design of the pluto system and make some of the house setups far more configurable (think of having an MD which services two rooms, perhaps utilising multiple screens)

Anyway, interested in feedback

Darren
Title: Re: Audio only Xine player for lmce
Post by: 1audio on November 14, 2007, 04:50:09 am
One of the strengths of LMCE is that any orbiter can control and media device, just change the room it thinks its in (the button on the bottom of the screen). I use this feature all the time and it makes for a much less cluttered screen than having multiple controls in a single screen. You can also create virtual rooms (like background music) and devote an Squeezebox to it. or even a squeezeplayer, which may operate on the core. http://wiki.slimdevices.com/index.cgi?PluginPlayers (http://wiki.slimdevices.com/index.cgi?PluginPlayers) I pushed for the upgrade to the current Slimserver in the system to support the virtual player.
Title: Re: Audio only Xine player for lmce
Post by: chewi on November 14, 2007, 10:49:20 am
I also like that idea. And I even have an extension to it.

I think it would be nice, to have a shoutcast/icecast-server as an audio-device as well. My scenario is that i'm sitting at work and can log into my core, using the web-orbiter and select whatever i want to hear and have that streamed to my workplace. So I can use the playlists, I built at home, at work and don't even have to move the actual mp3/ogg-files to work, which might be forbidden by company-law for security reasons.

Second it would be nice to add several audio-devices to a single md for different applications. My scenario there is to have a bluetooth headset for telephony with the md and regular speakers for movies and music. with the regular speakers, the integrated softphone is somewhat useless for me.

For this, of course the audio-system would have to be reworked a little.

The SVN is afaik up-to-date with the updates that came during the 0704-lifetime. It's propably nice to learn about the basic structure, but when the 0710 comes from paul and his helpers, a somewhat different codebase will propably be introduced. After that, I don't see, why this should not be added to the base, if it works well. My suggestion would be to add the option not to the audio-wizard, as this should be kept as simple as possible and for standard-setups to work right away, but to add it to the pluto-admin instead.

Best regards, Andreas
Title: Re: Audio only Xine player for lmce
Post by: Hagen on November 14, 2007, 12:25:13 pm
One of the strengths of LMCE is that any orbiter can control and media device, just change the room it thinks its in
Indeed, but to make an example I thought about.
It is very countrerproductive to have a dedicated computer at every 'outdoor area' rather one could assign audio channels/sound cards to these locations and even have them play different music.

Say soundcard one is assigned 'outdoor area 1' and soundcard two is assigned 'outdoor area 2' that can be on the other side of the house, and could play different files.

this is merely an idea, I have a few PIIs that I use now, but running four computers for this runs up the electricity bill.
Title: Re: Audio only Xine player for lmce
Post by: bulek on November 14, 2007, 04:05:28 pm
One of the strengths of LMCE is that any orbiter can control and media device, just change the room it thinks its in (the button on the bottom of the screen). I use this feature all the time and it makes for a much less cluttered screen than having multiple controls in a single screen. You can also create virtual rooms (like background music) and devote an Squeezebox to it. or even a squeezeplayer, which may operate on the core. http://wiki.slimdevices.com/index.cgi?PluginPlayers (http://wiki.slimdevices.com/index.cgi?PluginPlayers) I pushed for the upgrade to the current Slimserver in the system to support the virtual player.
Hi, this sounds like a nice workaround. Can you please give more info about what you achieved ? Maybe you can start Wiki page about it. I also thought i nthis direction, but at that time I think Slimserver had a problem having more players on single ip. I'm also particularly interested if you managed to create virtual room and put software media player in it...

For all other responses :

I see that idea is not so bad. Since Xine player has already sync possibility for 1source-to many players that would be great. I can try to get it working, what I miss right now is knowledge if right now, I'm able to work on Xine player and if LMCE is in such state that one can pull sources, compile few libraries and compile Xine player....  Anyone with more knowledge in that ?

It would be pretty straight forward to change Xine player not to spawn any video resources. I just need help on possibility of compiling from source code repository and how to create new rooms to put those Xine player into it, so I can have controls on Orbiter. For a start, workaround is possible (you just create dummy diskless MD and use ID from that Xine player, but this takes a lot of disk space)...

Thanks in advance,

regards,

Bulek.
Title: Re: Audio only Xine player for lmce
Post by: jspeckman on November 15, 2007, 03:14:22 pm
Hi all,
  Just thought I'd throw in my 2 cents.  I was working on using JACK and mplayer under pluto to achieve multi zone audio on the core under pluto.  I recently built an mce core that I'm in the process of migrating to.  Even though I got a working jack plugin, I never got anywhere with the mplayer plugin due to my lack of c++ knowledge.  Anyway I'm currently looking into using squeezeslave as a solution.  It's a command line only counterpart to softsqueeze.  The good thing is it's written in c.  The bad thing is it only supports oss and not alsa or jack, so out of the box it doesn't support breaking up the sound card(s) into multiple channels.  I'm investigating workarounds for this as I think this would be easier than a new plugin from the ground up.  If you guys think an audio only xine player is the way to go, great.  I'd like to help out any way I can with getting some kind of multi zone core audio solution up and running.

Thanks,
Jason
Title: Re: Audio only Xine player for lmce
Post by: bulek on November 15, 2007, 04:01:33 pm
Hi all,
  Just thought I'd throw in my 2 cents.  I was working on using JACK and mplayer under pluto to achieve multi zone audio on the core under pluto.  I recently built an mce core that I'm in the process of migrating to.  Even though I got a working jack plugin, I never got anywhere with the mplayer plugin due to my lack of c++ knowledge.  Anyway I'm currently looking into using squeezeslave as a solution.  It's a command line only counterpart to softsqueeze.  The good thing is it's written in c.  The bad thing is it only supports oss and not alsa or jack, so out of the box it doesn't support breaking up the sound card(s) into multiple channels.  I'm investigating workarounds for this as I think this would be easier than a new plugin from the ground up.  If you guys think an audio only xine player is the way to go, great.  I'd like to help out any way I can with getting some kind of multi zone core audio solution up and running.

Thanks,
Jason
Hi,

I already had xine audio only player working under Pluto and it was not so hard task (even for non-programmer like me). It's jus necessary to add a bunch of if-then-else constructs to prevent starting any video resources that would confuse media plugin. The MAIN reason why I'm doing this on existing Xine player is that one-to-many play will be also possible out of the box (I heard that this should be already working ok on audio)...

Can squeezeslave synhronize with squeezeboxes and other Xine players ?

Thanks in advance,

regards,

Bulek.
Title: Re: Audio only Xine player for lmce
Post by: jspeckman on November 15, 2007, 04:23:07 pm
Sounds like the audio only xine player has come a long way.  I am all about not reinventing the wheel.  Does it still require creating a fake md?  What all if-then-else's need to be added and where?  The squeezeslave is supposed to be able to sync to each other and/or it's hardware counterparts.  The benefit over not being written in java is that it should be able to stay in sync and not suffer any lag or other performance issues.  As to syncing with xine players I do not know.

Jason
Title: Re: Audio only Xine player for lmce
Post by: darrenmason on November 15, 2007, 10:48:32 pm
  Anyway I'm currently looking into using squeezeslave as a solution.  It's a command line only counterpart to softsqueeze.  The good thing is it's written in c.  The bad thing is it only supports oss and not alsa or jack, so out of the box it doesn't support breaking up the sound card(s) into multiple channels. 

What about "MOC" from the list of SlimDevice plugin players that was linked previously in this thread?

Title: Re: Audio only Xine player for lmce
Post by: bulek on November 16, 2007, 12:43:15 am
Sounds like the audio only xine player has come a long way.  I am all about not reinventing the wheel.  Does it still require creating a fake md?  What all if-then-else's need to be added and where?  ...
Jason
I think that fake MD is still needed. But do have a hope, that if audio xine will work ok, then we will find proper way of dealing with it also...

I don't remember exact places, but it goes to each place where Xine tries to play video, start graphic window (not to confuse window manager) and give different settings on Xine lib call...

It would not be so hard to try it, but I'm waiting to the moment when one can work on sources with LMCE.

BTW, isn't the problem of using squeezeslave similar to xine audio problem - you cannot put it on Orbiter in nice and easy way ? or am i missing something...

HTH,

regards,

Bulek.
 
Title: Re: Audio only Xine player for lmce
Post by: Matthew on January 15, 2008, 07:20:06 am
I like the architecture where the audio server is streaming just standard data, whether MP3, WAV, FLAC (Ogg FLAC), etc. Then that stream can be pulled (eg. with curl) to any local MD with a soundcard, or by a Core from itself to its soundcard for further distributing audio data over local peripherals (eg. analog, S/PDIF, other digital). Doesn't the SlimServer already do all that? Rather than use Xine for the audio stream client, how about just something really simple like madplay? That can run on really tiny HW, like iPaqs, or even Gumstix.
Title: Re: Audio only Xine player for lmce
Post by: darrenmason on January 15, 2008, 07:44:34 am
Yep, SlimServer already does that.

In fact any software that can open a streamed MP3 can be a software based audio device.
For example, I can opena stream on my Nokia 770 using the standard audio player and it will register as a slimserver audio device and can be controlled from the web interface. This requires no further install on the Nokia 770.

I was then trying to create the relevant devices and code so that these can then also be controlled using LMCE orbiters. The main aim for me was to have an old PC loaded up with sound cards which could be wired to different rooms in the house. Multi zone audio without the extra hardware of a Squeezebox.
I was getting close but put it on hold whilst I waited for 7.10 to come out. I am on leave soon so hopefully will get back to it.

It becomes a much simpler device to implement than the Audio only xine player as it can be as simple as calling an external player with a stream. The harder bit is assigning the device to a room and having the controls in that room.
Title: Re: Audio only Xine player for lmce
Post by: Matthew on January 15, 2008, 08:10:51 am
Yep, SlimServer already does that.

In fact any software that can open a streamed MP3 can be a software based audio device.
For example, I can opena stream on my Nokia 770 using the standard audio player and it will register as a slimserver audio device and can be controlled from the web interface. This requires no further install on the Nokia 770.

I was then trying to create the relevant devices and code so that these can then also be controlled using LMCE orbiters. The main aim for me was to have an old PC loaded up with sound cards which could be wired to different rooms in the house. Multi zone audio without the extra hardware of a Squeezebox.
I was getting close but put it on hold whilst I waited for 7.10 to come out. I am on leave soon so hopefully will get back to it.

It becomes a much simpler device to implement than the Audio only xine player as it can be as simple as calling an external player with a stream. The harder bit is assigning the device to a room and having the controls in that room.

As we've been discussing in "Adding softsqueeeze as LMCE's player (http://forum.linuxmce.org/index.php?topic=3805.0)", I think that the same code that calls a streaming audio client (eg. curl | madplay) when triggered by BT detection scripts could also assign a new ethernet interface, a dhclient on it, get an IP# from DHCP (thereby starting a SlimServer stream), and altogether constitute a manageable device. Since it's starting the audio client, that client code should also be able to control it (and optionally direct audio data over a BT connection, my ultimate use case for this facility). That same code should also be startable from the Orbiter/Adminsite even if it's an MD/Hybrid audio card instead of BT to BT speakers.
Title: Re: Audio only Xine player for lmce
Post by: bulek on January 15, 2008, 11:38:10 am
Yep, SlimServer already does that.

In fact any software that can open a streamed MP3 can be a software based audio device.
For example, I can opena stream on my Nokia 770 using the standard audio player and it will register as a slimserver audio device and can be controlled from the web interface. This requires no further install on the Nokia 770.

I was then trying to create the relevant devices and code so that these can then also be controlled using LMCE orbiters. The main aim for me was to have an old PC loaded up with sound cards which could be wired to different rooms in the house. Multi zone audio without the extra hardware of a Squeezebox.
I was getting close but put it on hold whilst I waited for 7.10 to come out. I am on leave soon so hopefully will get back to it.

It becomes a much simpler device to implement than the Audio only xine player as it can be as simple as calling an external player with a stream. The harder bit is assigning the device to a room and having the controls in that room.

As far as I tried the problem would go from working on "audio only" Xine to enhancing Slimserver support... Currently I do have one HW SB and softsqueeze on Windows and I must say that SB integration is crippled at the moment... see here :

I'll probably start working on Xine, cause it has some advantages (had a talk with one of developers) :
- currently it is a major media player in LMCE and will be maintained for quite some time
- it know how to sync with other Xines already (the only problem is bug with more audio songs in a row, but as I was told it works ok on video...)
- currently you can't sync SBs with Xine players, so if you want clean solution, you should choose between them...

I'll probably start working on Xine, cause I guess this would be easy way for now (could be wrong)... One of the developers will think about it and give us general directions.... next week..

Regards,

Bulek.