Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pulseaudio module to provide ohSongcast function?
22-10-2012, 03:18 PM
Post: #1
Pulseaudio module to provide ohSongcast function?
Being a linux user (ubuntu) I have been waiting to be able to songcast from my machine. Please could you advise on what steps I need to take to accomplish this.

I see two possible solutions, my preferred being 1) a pulseaudio module or 2) installing whatever you have already written (ohOS,ohNet,OhSongcast??) onto my computer (- I am not sure how this would work).

Please could you advise on how to do these? as I find the current level of documentation inadequate for this purpose (although this is most probably more a reflection on me than the project team).

Thanks in advance,
Paul
Find all posts by this user
26-10-2012, 07:59 AM
Post: #2
RE: Pulseaudio module to provide ohSongcast function?
We don't yet have songcast integration for PulseAudio.

I wasn't clear whether you were looking for a complete solution or offering to help code one. If its the latter, we'd be very happy to provide support.

In summary, building a PulseAudio plug-in will require experience in C and C++ development. We could provide detailed guidance on how to use the relevant OpenHome modules - ohSongcast and ohNet.

Let us know if you're interested in getting involved with this.
Find all posts by this user
28-10-2012, 10:56 AM
Post: #3
RE: Pulseaudio module to provide ohSongcast function?
Thank you for your reply. I know I'm not the only one interested in this, so please give detailed guidance in how to use the OpenHome modules in Linux e.g in Ubuntu 12.10 whilst using VLC, say, to send its audio to a Songcast receiver.

My C/C++ skills are limited so have no real expectation of being able to help in building the module, although getting the above working may help my(and others) understanding of what is going on on the OpenHome side.

Once I have this I will look at existing pa modules e.g. pulseaudio-module-raop ( which unfortunately does not seem to work correctly on my hardware) to use as a template to try and achieve the task.

Your support in this will be appreciated.

Regards,
Find all posts by this user
29-10-2012, 09:56 AM
Post: #4
RE: Pulseaudio module to provide ohSongcast function?
You'll need to have development tools installed. Git and gcc at a minimum; any others hinted at by errors in the build process.

First you'll need to fetch the relevant code:
git clone https://github.com/openhome/ohNet.git ohNet
git clone https://github.com/openhome/ohSongcast.git ohSongcast


Then you'll need to build ohNet:
cd ohNet
make

Check that Build/Obj/Posix/Release/libohNetCore.a has been created.

Now create a project directory for your songcast sender. Copy *.h, *.cpp from the ohSongcast directory and libohNetCore.a from ohNet's build directory into it.

Then you'll need to write your songcast sender. See ohSongcast/WavSender/WavSender.cpp for an example of how to do this. In short, you'll need to:
  • Create a DvDeviceStandard and set the appropriate attributes on it. Use WavSender as a template for this.
  • Create an icon for your songcast sender. Use WavSender as a template for this.
  • Create an OhmSenderDriver instance
  • Create an OhmSender instance
  • Call OhmSenderDriver::SetAudioFormat to set the sample rate, number of channels etc. This must be called before sending any audio and again whenever any of these details change. You'll have to retrieve this information from PulseAudio.
  • Call OhmSenderDriver::SendAudio repeatedly to send pcm audio. As above, its an exercise for you to figure out how to retrieve this from PulseAudio.
  • Note that audio data must be sent packed. i.e. 16-bit samples must only take up 16 bits and cannot have been expanded to 24 or 32 bits.

Once this is done, you'll have a songcast sender. You'll then need a songcast receiver - http://www.linn.co.uk/all-products/netwo...c-players. You can use a control point for Linn's renderers to select the songcast source on your receiver, then select the stream of your new songcast sender.

As a later task, you could consider writing a Linux UI to enable/disable songcast and select a receiver. ohSongcast has examples of such UIs for Windows and Mac - see ohSongcast/ohSongcast/Windows or ohSongcast/ohSongcast/Mac.
Find all posts by this user
29-10-2012, 11:00 AM
Post: #5
RE: Pulseaudio module to provide ohSongcast function?
Thank you for the instructions. The ohNet build did not work. I got:-

mkdir -p Generated
o Generated/Devices.mak OpenHome/Net/T4/Templates/DvUpnpMakeDevices.tt -a xml:OpenHome/Net/Service/Services.xml
make: o: Command not found
make: [Generated/Devices.mak] Error 127 (ignored)
Attention: a makefile has been re-generated.
mkdir -p Generated
o Generated/Proxies.mak OpenHome/Net/T4/Templates/CpUpnpMakeProxies.tt -a xml:OpenHome/Net/Service/Services.xml
make: o: Command not found
make: [Generated/Proxies.mak] Error 127 (ignored)
Attention: a makefile has been re-generated.
mkdir -p Build/Obj/Posix/Release/
{output removed no error messages here}
rsync -u Os/*.inl Build/Include/OpenHome
gcc -o Build/Obj/Posix/Release/CpiDeviceUpnp.o -c -fexceptions -Wall -pipe -D_GNU_SOURCE -D_REENTRANT -DDEFINE_LITTLE_ENDIAN -DDEFINE_TRACE -O2 -fvisibility=hidden -Wno-psabi -fPIC -Werror -IBuild/Include/ OpenHome/Net/ControlPoint/Upnp/CpiDeviceUpnp.cpp
OpenHome/Net/ControlPoint/Upnp/CpiDeviceUpnp.cpp: In member function ‘virtual void OpenHome::Net::CpiDeviceUpnp::Release()’:
OpenHome/Net/ControlPoint/Upnp/CpiDeviceUpnp.cpp:188:12: error: deleting object of polymorphic class type ‘OpenHome::Net::CpiDeviceUpnp’ which has non-virtual destructor might cause undefined behaviour [-Werror=delete-non-virtual-dtor]
OpenHome/Net/ControlPoint/Upnp/CpiDeviceUpnp.cpp: In destructor ‘OpenHome::Net::CpiDeviceUpnp::~CpiDeviceUpnp()’:
OpenHome/Net/ControlPoint/Upnp/CpiDeviceUpnp.cpp:196:12: error: deleting object of polymorphic class type ‘OpenHome::Net::CpiDeviceUpnp::Invocable’ which has non-virtual destructor might cause undefined behaviour [-Werror=delete-non-virtual-dtor]
cc1plus: all warnings being treated as errors
make: *** [Build/Obj/Posix/Release/CpiDeviceUpnp.o] Error 1

with no Build/Obj/Posix/Release/libohNetCore.a created. If you need the full output I can repost.

Thanks & regards
Find all posts by this user
29-10-2012, 11:06 AM
Post: #6
RE: Pulseaudio module to provide ohSongcast function?
Sounds like you have an old version of gcc (gcc -v will confirm/disprove this).

The easiest fix would be for you to upgrade your version of gcc. We're using 4.6 and it no longer warns about deleting objects which have non-virtual d'tors.

Failing that, you're welcome to submit a patch fixing the build for your old version of gcc. I imagine this'd involve giving the base class for each error instance an empty virtual destructor. Then repeating until you get through a full build without error.
Find all posts by this user
30-10-2012, 02:45 AM
Post: #7
RE: Pulseaudio module to provide ohSongcast function?
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.7/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.7.2-2ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1)
Find all posts by this user
30-10-2012, 09:06 AM
Post: #8
RE: Pulseaudio module to provide ohSongcast function?
That's a pain... it looks like gcc have added this flag back again. I'll get this fixed.
Find all posts by this user
30-10-2012, 01:18 PM
Post: #9
RE: Pulseaudio module to provide ohSongcast function?
I've committed changes to get ohNet building with gcc 4.7 locally. All being well, these should be pushed to github around 8pm this evening. (We have an automated process which tests then publishes code each evening.)
Find all posts by this user
30-10-2012, 01:24 PM
Post: #10
RE: Pulseaudio module to provide ohSongcast function?
Thank you
Find all posts by this user


Forum Jump: