Coder Social home page Coder Social logo

babelpod's People

Contributors

afaden avatar maexdaemaege avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

babelpod's Issues

Sonos different functionality than Apple?

Hello

by installing according to "wrenchpilot" with the babelpod from "maexdaemaege" at least the functionality around Apple (Airpods, Mac, etc.) seems to work. However, when it comes to SONOS devices, no sound comes out despite the connection. Has anyone had the same problem and was there a solution?

Thank you

Successful install, but on HomePod "airplay status: stopped"

Hi,

I have successfully installed BabelPod on my Raspberry Pi. For this I used the code from @maexdaemaege, because there is no error.

but if I use one of my HomePods as output, I immediately get "airplay status: stopped" no matter which one I select.

If I use the output on USB or Headphone, the music will be played as well.

Do you have an idea how I can fix this?

HomePod Version: 13.4.5
Same network

here the complete log from the terminal, where I changed the in and out and the message comes, that it was stopped.

pi@raspberrypi:~/babelpod $ node index.js
(node:17924) Warning: N-API is an experimental feature and could change at any time.
listening on *:3000
a user connected
switch_input: plughw:1,0
switch_output: airplay_192.168.178.25_7000
inputStream Socket {
  connecting: false,
  _hadError: false,
  _handle: Pipe { owner: [Circular], onread: [Function: onread], reading: false },
  _parent: null,
  _host: null,
  _readableState: 
   ReadableState {
     objectMode: false,
     highWaterMark: 16384,
     buffer: BufferList { head: [Object], tail: [Object], length: 1 },
     length: 22052,
     pipes: 
      ToVoid {
        _writableState: [WritableState],
        writable: true,
        _events: [Object],
        _eventsCount: 5,
        _maxListeners: undefined },
     pipesCount: 1,
     flowing: false,
     ended: false,
     endEmitted: false,
     reading: false,
     sync: false,
     needReadable: false,
     emittedReadable: true,
     readableListening: false,
     resumeScheduled: false,
     destroyed: false,
     defaultEncoding: 'utf8',
     awaitDrain: 1,
     readingMore: false,
     decoder: null,
     encoding: null },
  readable: true,
  _events: 
   { end: [ [Function], [Function] ],
     finish: [Function: onSocketFinish],
     _socketEnd: [Function: onSocketEnd],
     close: [Function],
     data: [Function: ondata] },
  _eventsCount: 5,
  _maxListeners: undefined,
  _writableState: 
   WritableState {
     objectMode: false,
     highWaterMark: 16384,
     finalCalled: false,
     needDrain: false,
     ending: false,
     ended: false,
     finished: false,
     destroyed: false,
     decodeStrings: false,
     defaultEncoding: 'utf8',
     length: 0,
     writing: false,
     corked: 0,
     sync: true,
     bufferProcessing: false,
     onwrite: [Function: bound onwrite],
     writecb: null,
     writelen: 0,
     bufferedRequest: null,
     lastBufferedRequest: null,
     pendingcb: 0,
     prefinished: false,
     errorEmitted: false,
     bufferedRequestCount: 0,
     corkedRequestsFree: 
      { next: null,
        entry: null,
        finish: [Function: bound onCorkedFinish] } },
  writable: false,
  allowHalfOpen: false,
  _bytesDispatched: 0,
  _sockname: null,
  _pendingData: null,
  _pendingEncoding: '',
  server: null,
  _server: null,
  [Symbol(asyncId)]: 161,
  [Symbol(lastWriteQueueSize)]: 0,
  [Symbol(bytesRead)]: 0 }
outputStream ToVoid {
  _writableState: 
   WritableState {
     objectMode: false,
     highWaterMark: 16384,
     finalCalled: false,
     needDrain: true,
     ending: false,
     ended: false,
     finished: false,
     destroyed: false,
     decodeStrings: true,
     defaultEncoding: 'utf8',
     length: 22096,
     writing: true,
     corked: 0,
     sync: false,
     bufferProcessing: false,
     onwrite: [Function: bound onwrite],
     writecb: [Function: nop],
     writelen: 44,
     bufferedRequest: 
      { chunk: <Buffer 01 00 01 00 ff ff ff ff ff ff ff ff 02 00 02 00 00 00 00 00 ff ff ff ff fe ff fe ff ff ff ff ff fe ff fe ff fe ff fe ff 00 00 00 00 00 00 00 00 00 00 ... >,
        encoding: 'buffer',
        isBuf: true,
        callback: [Function: nop],
        next: null },
     lastBufferedRequest: 
      { chunk: <Buffer 01 00 01 00 ff ff ff ff ff ff ff ff 02 00 02 00 00 00 00 00 ff ff ff ff fe ff fe ff ff ff ff ff fe ff fe ff fe ff fe ff 00 00 00 00 00 00 00 00 00 00 ... >,
        encoding: 'buffer',
        isBuf: true,
        callback: [Function: nop],
        next: null },
     pendingcb: 2,
     prefinished: false,
     errorEmitted: false,
     bufferedRequestCount: 1,
     corkedRequestsFree: 
      { next: null,
        entry: null,
        finish: [Function: bound onCorkedFinish] } },
  writable: true,
  _events: 
   { unpipe: [Function: onunpipe],
     drain: [Function],
     error: [Function: onerror],
     close: { [Function: bound onceWrapper] listener: [Function: onclose] },
     finish: { [Function: bound onceWrapper] listener: [Function: onfinish] } },
  _eventsCount: 5,
  _maxListeners: undefined }
adding device: 192.168.178.25:7000
airplay status: stopped

Playback stopping after about 3 minutes

Hey, great work so far.

I've got it going on a Pi3 with a Behringer UFO202 USB Phono stage + ADC.

Unfortunately something is causing playback to consistently stop after about 3 minutes.
"airplay status: stopped"

I suspect the issue might be with the underlying node_airtunes system, as I get a similar drop out when using the play_ffmpeg.js example script from them.

Airplay playback not working - shows two Homepods

Just set up babelpod with the loopback function and bluetooth capabilities. Have run into a few snags-

The first is that as of right now, I can't seem to get any audio to go through over airplay. At first launch, it sees my HomePod and I have both an input and output selected (in this case, loop back and homepod respectively. It does show two loopback devices but I'm not sure if that's by design.), but when I go to play nothing plays- it doesn't seem to facilitate an airplay connection as any previously attached device isn't kicked from the connection.

I've also noticed that bluetooth currently isn't functioning at all. It tells me on my iPhone that the device is unsupported and tries to get me to forget it from the Bluetooth list. Quick looking at the logs while BabelPod is running show:
Nov 29 01:10:08 raspberrypi node[4849]: airplay status: stopped

Could this have something to do with the airplay issue by any chance?

Edit: Huh, over the time that I typed this it added six more homepods to the list with the same name. XD

Babelpod as a service

Not sure if my issue is like others or as result of making Babelpod a service, but basically after a minute or two I have to reconnect to airplay device.

Here is how I setup Babelpod and got it running as a service on Pi Zero.

Installed Raspberry Lite

Installed Node this way:
wget https://nodejs.org/dist/v8.9.0/node-v8.9.0-linux-armv6l.tar.gz
tar -xzf node-v8.9.0-linux-armv6l.tar.gz
cd node-v6.11.1-linux-armv6l/
sudo cp -R * /usr/local/
Check version node -v

Followed rest of afaden's instructions for AirTunes and Babelpod.

Created a service by doing this:
sudo nano /etc/systemd/system/babelpod.service

Add:

[Service]
#Couldn't get BP to work as a service unless /usr/local/bin/node
ExecStart=/usr/local/bin/node /home/pi/babelpod/index.js
StandardOutput=journal

Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

sudo systemctl daemon-reload
sudo systemctl enable babelpod
sudo systemctl start babelpod
sudo system status babelpod

Should see something like this:
CGroup: /system.slice/babelpod.service
├─446 /usr/local/bin/node /home/pi/babelpod/index.js
├─452 bash
└─454 bluetoothctl

May 13 14:33:51 raspberrypi systemd[1]: Started babelpod.service.
May 13 14:33:56 raspberrypi node[446]: listening on *:3000
May 13 14:33:56 raspberrypi node[446]: bluetooth controller exists
May 13 14:33:58 raspberrypi node[446]: a user connected

using RPi as streaming device

Is it possible to use a RPi without the USB soundcard since I'm not interested in "line in" and use the RPi as input device instead of using a phone?

Airplay2 support?

Will there be an Airplay2 support?
For example to use stereo HomePods or for reducing the 2 second sound delay?

Bluetooth not connecting

When I try to connect to my raspberry pi from an iPhone the raspberry pi doesn't show up, but when we do the other way it just says "Paired succesfully but this device has no services which can be used with raspberry pi"

Google Cast support?

Looking at this to be able to use the homepod as a Google Cast endpoint, we have a homepod we bought cheap but use android phones so it is difficult to integrate into our system. Any ideas?

Stutter in stream

This is a great project! I got this all working fairly well with Raspberry Pi Zero. Unfortunately the stream occasionally stutters. Maybe additional buffer would help?

failed during install

The install failed at this step:

pi@raspberrypi:~/babelpod $ sudo npm install
(node:18541) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No license field.
\

[email protected] install /home/pi/babelpod/node_modules/airtunes
node-gyp rebuild

make: Entering directory '/home/pi/babelpod/node_modules/airtunes/build'
CXX(target) Release/obj.target/airtunes/src/codec.o
In file included from ../src/../alac/ALACEncoder.h:29:0,
from ../src/codec.cc:15:
../src/../alac/ALACAudioTypes.h:64:32: warning: multi-character character constant [-Wmultichar]
kALACFormatAppleLossless = 'alac',
^~~~~~
../src/../alac/ALACAudioTypes.h:65:28: warning: multi-character character constant [-Wmultichar]
kALACFormatLinearPCM = 'lpcm'
^~~~~~
../src/../alac/ALACAudioTypes.h:154:22: warning: multi-character character constant [-Wmultichar]
kALACCodecFormat = 'alac',
^~~~~~
../src/../alac/ALACAudioTypes.h:182:26: warning: multi-character character constant [-Wmultichar]
AudioChannelLayoutAID = 'chan'
^~~~~~
../src/codec.cc: In function ‘void nodeairtunes::encoder_weak_callback(v8::Persistentv8::Value, void*)’:
../src/codec.cc:59:15: error: ‘v8::HandleScope::HandleScope()’ is protected within this context
HandleScope scope;
^~~~~
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../src/codec.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:875:13: note: declared protected here
V8_INLINE HandleScope() {}
^~~~~~~~~~~
../src/codec.cc:62:11: error: ‘class v8::Persistentv8::Value’ has no member named ‘Dispose’
wrapper.Dispose();
^~~~~~~
../src/codec.cc: At global scope:
../src/codec.cc:67:32: error: ‘Arguments’ does not name a type
Handle NewEncoder(const Arguments& args) {
^~~~~~~~~
../src/codec.cc: In function ‘v8::Handlev8::Value nodeairtunes::NewEncoder(const int&)’:
../src/codec.cc:68:15: error: ‘v8::HandleScope::HandleScope()’ is protected within this context
HandleScope scope;
^~~~~
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../src/codec.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:875:13: note: declared protected here
V8_INLINE HandleScope() {}
^~~~~~~~~~~
../src/codec.cc:78:97: warning: ‘static v8::Localv8::ObjectTemplate v8::ObjectTemplate::New()’ is deprecated: Use isolate version [-Wdeprecated-declarations]
emplate> encoderClass = Persistent::New(ObjectTemplate::New());
^
In file included from /usr/include/nodejs/deps/v8/include/v8.h:26:0,
from /usr/include/nodejs/src/node.h:63,
from ../src/codec.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:5706:69: note: declared here
static V8_DEPRECATED("Use isolate version", Local New());
^
/usr/include/nodejs/deps/v8/include/v8config.h:318:3: note: in definition of macro ‘V8_DEPRECATED’
declarator attribute((deprecated(message)))
^~~~~~~~~~
../src/codec.cc:78:98: error: no matching function for call to ‘v8::Persistentv8::ObjectTemplate::New(v8::Localv8::ObjectTemplate)’
emplate> encoderClass = Persistent::New(ObjectTemplate::New());
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../src/codec.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:9167:4: note: candidate: static T* v8::PersistentBase::New(v8::Isolate*, T*) [with T = v8::ObjectTemplate]
T* PersistentBase::New(Isolate* isolate, T* that) {
^~~~~~~~~~~~~~~~~
/usr/include/nodejs/deps/v8/include/v8.h:9167:4: note: candidate expects 2 arguments, 1 provided
../src/codec.cc:79:15: error: base operand of ‘->’ has non-pointer type ‘v8::Persistentv8::ObjectTemplate’
encoderClass->SetInternalFieldCount(1);
^~
../src/codec.cc:80:62: error: base operand of ‘->’ has non-pointer type ‘v8::Persistentv8::ObjectTemplate’
Persistent o = Persistent::New(encoderClass->NewInstance());
^~
../src/codec.cc:81:4: error: base operand of ‘->’ has non-pointer type ‘v8::Persistentv8::Object’
o->SetPointerInInternalField(0, encoder);
^~
../src/codec.cc:82:5: error: ‘class v8::Persistentv8::Object’ has no member named ‘MakeWeak’; did you mean ‘SetWeak’?
o.MakeWeak(encoder, encoder_weak_callback);
^~~~~~~~
../src/codec.cc:84:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
return scope.Close(o);
^~~~~
../src/codec.cc: At global scope:
../src/codec.cc:87:32: error: ‘Arguments’ does not name a type
Handle EncodeALAC(const Arguments& args) {
^~~~~~~~~
../src/codec.cc: In function ‘v8::Handlev8::Value nodeairtunes::EncodeALAC(const int&)’:
../src/codec.cc:88:15: error: ‘v8::HandleScope::HandleScope()’ is protected within this context
HandleScope scope;
^~~~~
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../src/codec.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:875:13: note: declared protected here
V8_INLINE HandleScope() {}
^~~~~~~~~~~
../src/codec.cc:90:11: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
if(args.Length() < 4) {
^~~~~~
../src/codec.cc:92:18: error: ‘class v8::HandleScope’ has no member named ‘Close’
return scope.Close(Null());
^~~~~
../src/codec.cc:92:29: error: too few arguments to function ‘v8::Localv8::Primitive v8::Null(v8::Isolate*)’
return scope.Close(Null());
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../src/codec.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:314:27: note: declared here
friend Local Null(Isolate* isolate);
^~~~
../src/codec.cc:95:32: error: invalid types ‘const int[int]’ for array subscript
Localwrapper = args[0]->ToObject();
^
../src/codec.cc:96:49: error: ‘class v8::Object’ has no member named ‘GetPointerFromInternalField’; did you mean ‘GetAlignedPointerFromInternalField’?
ALACEncoder encoder = (ALACEncoder)wrapper->GetPointerFromInternalField(0);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/codec.cc:98:34: error: invalid types ‘const int[int]’ for array subscript
Local pcmBuffer = args[1];
^
../src/codec.cc:101:35: error: invalid types ‘const int[int]’ for array subscript
Local alacBuffer = args[2];
^
../src/codec.cc:104:27: error: invalid types ‘const int[int]’ for array subscript
int32_t pcmSize = args[3]->Int32Value();
^
../src/codec.cc:113:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
return scope.Close(Integer::New(alacSize));
^~~~~
../src/codec.cc:113:43: error: no matching function for call to ‘v8::Integer::New(int32_t&)’
return scope.Close(Integer::New(alacSize));
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../src/codec.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:2929:25: note: candidate: static v8::Localv8::Integer v8::Integer::New(v8::Isolate*, int32_t)
static Local New(Isolate* isolate, int32_t value);
^~~
/usr/include/nodejs/deps/v8/include/v8.h:2929:25: note: candidate expects 2 arguments, 1 provided
../src/codec.cc: At global scope:
../src/codec.cc:116:32: error: ‘Arguments’ does not name a type
Handle EncryptAES(const Arguments& args) {
^~~~~~~~~
../src/codec.cc: In function ‘v8::Handlev8::Value nodeairtunes::EncryptAES(const int&)’:
../src/codec.cc:117:15: error: ‘v8::HandleScope::HandleScope()’ is protected within this context
HandleScope scope;
^~~~~
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../src/codec.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:875:13: note: declared protected here
V8_INLINE HandleScope() {}
^~~~~~~~~~~
../src/codec.cc:119:11: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
if(args.Length() < 2) {
^~~~~~
../src/codec.cc:121:18: error: ‘class v8::HandleScope’ has no member named ‘Close’
return scope.Close(Null());
^~~~~
../src/codec.cc:121:29: error: too few arguments to function ‘v8::Localv8::Primitive v8::Null(v8::Isolate*)’
return scope.Close(Null());
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../src/codec.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:314:27: note: declared here
friend Local Null(Isolate* isolate);
^~~~
../src/codec.cc:124:35: error: invalid types ‘const int[int]’ for array subscript
Local alacBuffer = args[0];
^
../src/codec.cc:126:28: error: invalid types ‘const int[int]’ for array subscript
int32_t alacSize = args[1]->Int32Value();
^
../src/codec.cc:149:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
return scope.Close(Null());
^~~~~
../src/codec.cc:149:27: error: too few arguments to function ‘v8::Localv8::Primitive v8::Null(v8::Isolate*)’
return scope.Close(Null());
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../src/codec.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:314:27: note: declared here
friend Local Null(Isolate* isolate);
^~~~
../src/codec.cc: In function ‘void nodeairtunes::InitCodec(v8::Handlev8::Object)’:
../src/codec.cc:153:51: error: invalid conversion from ‘v8::Handlev8::Value ()(const int&) {aka v8::Localv8::Value ()(const int&)}’ to ‘v8::FunctionCallback {aka void ()(const v8::FunctionCallbackInfov8::Value&)}’ [-fpermissive]
NODE_SET_METHOD(target, "encodeALAC", EncodeALAC);
^
In file included from ../src/codec.cc:1:0:
/usr/include/nodejs/src/node.h:291:13: note: initializing argument 3 of ‘void node::NODE_SET_METHOD(v8::Localv8::Object, const char
, v8::FunctionCallback)’
inline void NODE_SET_METHOD(v8::Localv8::Object recv,
^~~~~~~~~~~~~~~
../src/codec.cc:154:51: error: invalid conversion from ‘v8::Handlev8::Value ()(const int&) {aka v8::Localv8::Value ()(const int&)}’ to ‘v8::FunctionCallback {aka void ()(const v8::FunctionCallbackInfov8::Value&)}’ [-fpermissive]
NODE_SET_METHOD(target, "encryptAES", EncryptAES);
^
In file included from ../src/codec.cc:1:0:
/usr/include/nodejs/src/node.h:291:13: note: initializing argument 3 of ‘void node::NODE_SET_METHOD(v8::Localv8::Object, const char
, v8::FunctionCallback)’
inline void NODE_SET_METHOD(v8::Localv8::Object recv,
^~~~~~~~~~~~~~~
../src/codec.cc:155:51: error: invalid conversion from ‘v8::Handlev8::Value ()(const int&) {aka v8::Localv8::Value ()(const int&)}’ to ‘v8::FunctionCallback {aka void ()(const v8::FunctionCallbackInfov8::Value&)}’ [-fpermissive]
NODE_SET_METHOD(target, "newEncoder", NewEncoder);
^
In file included from ../src/codec.cc:1:0:
/usr/include/nodejs/src/node.h:291:13: note: initializing argument 3 of ‘void node::NODE_SET_METHOD(v8::Localv8::Object, const char
, v8::FunctionCallback)’
inline void NODE_SET_METHOD(v8::Localv8::Object recv,
^~~~~~~~~~~~~~~
airtunes.target.mk:101: recipe for target 'Release/obj.target/airtunes/src/codec.o' failed
make: *** [Release/obj.target/airtunes/src/codec.o] Error 1
make: Leaving directory '/home/pi/babelpod/node_modules/airtunes/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.14.98-v7+
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pi/babelpod/node_modules/airtunes
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the airtunes package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls airtunes
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 4.14.98-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi/babelpod
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/babelpod/npm-debug.log
npm ERR! not ok code 0

Please help I'm not the best at this stuff.

Bluetooth not found

I followed the instructions, but the Raspberry Pi doesn't show up as a device under Bluetooth for the Google Home Mini or my iPhone XS Max when I scan.

However, it does show up on my MacBook Pro 2018 when I scan for bluetooth devices. When I go to connect it to my MacBook Pro, I get this error:

Connection failed-GDBus.Error:org.bluez.Error.Failed: Protocol not available. Try to connect manually.

What am I doing wrong?

Love this project!

Hello, introducing myself. I just found this project and was able to use this to stream my turntable to my AirPlay devices! The instructions (http://faden.me/2018/03/18/babelpod.html) are a bit outdated, but I got it working using nvm and installing node lts/hydrogen (18.16.1) on a Raspberry Pi 4 (Raspberry Pi OS 64bit). Just wanted to share my success and say thanks!

Steps

Install nvm

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
nvm install lts/hydrogen

Clone this repo

git clone https://github.com/afaden/babelpod.git
cd babelpod
npm i

Create the service

sudo nano /etc/systemd/system/babelpod.service
[Service]
# need to specify the full path to node
ExecStart=/home/pi/.nvm/versions/node/v18.16.1/bin/node /home/pi/babelpod/index.js
StandardOutput=journal

Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

Start babelpod

sudo systemctl daemon-reload
sudo systemctl enable babelpod
sudo systemctl start babelpod
sudo systemctl status babelpod

macOS Settings (Airdrop & Handoff)

  • Allow AirPlay for: Anyone on the Same Network

Airplay Stereo to paired HomePods

Does or can Babelpod stream to paired HomePods in stereo? That would make Babelpod a perfect add-on to make a streaming turntable

thanks,

Brian

Multiple Airplay Devices

I'd like to get a sense for how difficult it would be to expand the function of this code so that multiple airplay devices can be selected for playback. As things appear now, only one device can be selected at a time.

Duplicate Airplay Streams

Just installed this for the first time. It is listing the same AirPlay devices 3 or 4 times. Quick testing and it seems that none of them work (most AppleTV devices). It also isn’t showing my HomePod, but I have not tried rebooting everything yet.

I do have a separate IoT vlan setup that I have passing traffic into my regular vlan with firewall settings. This may have something to do with it, but do not have the chance to reconfig my entire network structure just to test that theory and break dozens of other devices.

Successful install, but no audio playing on Homepod

Hi all! I'm kind of noob here, but I'll try my best.

I have a raspberrypi. 3b+ with homebridge installed. I've followed afaden guide and successfully installed, but when I select the output device, nothing happens, there's no sound.

In terminal (via ssh on a mac), I've found that when running the node index.js the following thing happen:

$ node index.js

listening on *:3000
bluetooth controller exists
a user connected
switch_output: airplay_192.168.0.25_7000
inputStream FromVoid {
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: null, tail: null, length: 0 },
length: 0,
pipes: null,
pipesCount: 0,
flowing: null,
ended: false,
endEmitted: false,
reading: false,
sync: true,
needReadable: false,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
destroyed: false,
defaultEncoding: 'utf8',
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null },
readable: true,
_events: {},
_eventsCount: 0,
_maxListeners: undefined }
outputStream ToVoid {
_writableState:
WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: false,
needDrain: false,
ending: false,
ended: false,
finished: false,
destroyed: false,
decodeStrings: true,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: true,
bufferProcessing: false,
onwrite: [Function: bound onwrite],
writecb: null,
writelen: 0,
bufferedRequest: null,
lastBufferedRequest: null,
pendingcb: 0,
prefinished: false,
errorEmitted: false,
bufferedRequestCount: 0,
corkedRequestsFree:
{ next: null,
entry: null,
finish: [Function: bound onCorkedFinish] } },
writable: true,
_events: {},
_eventsCount: 0,
_maxListeners: undefined }
adding device: 192.168.0.25:7000
switch_output: airplay_192.168.0.25_7000
inputStream FromVoid {
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: null, tail: null, length: 0 },
length: 0,
pipes: null,
pipesCount: 0,
flowing: null,
ended: false,
endEmitted: false,
reading: false,
sync: true,
needReadable: false,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
destroyed: false,
defaultEncoding: 'utf8',
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null },
readable: true,
_events: {},
_eventsCount: 0,
_maxListeners: undefined }
outputStream ToVoid {
_writableState:
WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: false,
needDrain: false,
ending: false,
ended: false,
finished: false,
destroyed: false,
decodeStrings: true,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: true,
bufferProcessing: false,
onwrite: [Function: bound onwrite],
writecb: null,
writelen: 0,
bufferedRequest: null,
lastBufferedRequest: null,
pendingcb: 0,
prefinished: false,
errorEmitted: false,
bufferedRequestCount: 0,
corkedRequestsFree:
{ next: null,
entry: null,
finish: [Function: bound onCorkedFinish] } },
writable: true,
_events: {},
_eventsCount: 0,
_maxListeners: undefined }
/home/pi/node_airtunes/lib/rtsp.js:385
this.socket.end(this.makeHead('TEARDOWN', '', di) + '\r\n');
^

TypeError: Cannot read property 'end' of null
at Client.sendNextRequest (/home/pi/node_airtunes/lib/rtsp.js:385:17)
at Client.teardown (/home/pi/node_airtunes/lib/rtsp.js:124:8)
at AirTunesDevice.stop (/home/pi/node_airtunes/lib/device_airtunes.js:121:13)
at cleanupCurrentOutput (/home/pi/babelpod/index.js:151:19)
at Socket. (/home/pi/babelpod/index.js:202:5)
at Socket.emit (events.js:180:13)
at /home/pi/babelpod/node_modules/socket.io/lib/socket.js:528:12
at process._tickCallback (internal/process/next_tick.js:112:11)

This happens everytime I select an Airplay device, I've rebooted, made a clean install, and nothing seems to work.

I know on the guide it Says node version 9.8, and the updated installed on the RPI is the 10.x, which in order to install babelpod I had to downgrade to the 9.8.

Does anyone know what might be wrong?

Thanks in advance,

installation gets stuck on Raspberry Pi 3 A+

Somebody got this working recently?

I tried to install on a Raspberry Pi 3 A+ following the instruction from another post here.
Tried to install the node_airtunes2 package manually also but without success as well.

I used Node LTS (18) and also the latest 20 version.
But neither of them worked.

Basically the installation always gets stuck here:

image

"Cannot read property 'end' of null" when clicking on AirPlay device

Hello,
when I select my AirPlay device, it says:
switch_output: airplay_192.168.0.10_7000
but nothing happens - no audio.
When I click on the next AirPlay device to try it out, the following happens:

switch_output: airplay_192.168.0.14_7000
inputStream FromVoid {
  _readableState: 
   ReadableState {
     objectMode: false,
     highWaterMark: 16384,
     buffer: BufferList { head: null, tail: null, length: 0 },
     length: 0,
     pipes: null,
     pipesCount: 0,
     flowing: null,
     ended: false,
     endEmitted: false,
     reading: false,
     sync: true,
     needReadable: false,
     emittedReadable: false,
     readableListening: false,
     resumeScheduled: false,
     destroyed: false,
     defaultEncoding: 'utf8',
     awaitDrain: 0,
     readingMore: false,
     decoder: null,
     encoding: null },
  readable: true,
  _events: {},
  _eventsCount: 0,
  _maxListeners: undefined }
outputStream ToVoid {
  _writableState: 
   WritableState {
     objectMode: false,
     highWaterMark: 16384,
     finalCalled: false,
     needDrain: false,
     ending: false,
     ended: false,
     finished: false,
     destroyed: false,
     decodeStrings: true,
     defaultEncoding: 'utf8',
     length: 0,
     writing: false,
     corked: 0,
     sync: true,
     bufferProcessing: false,
     onwrite: [Function: bound onwrite],
     writecb: null,
     writelen: 0,
     bufferedRequest: null,
     lastBufferedRequest: null,
     pendingcb: 0,
     prefinished: false,
     errorEmitted: false,
     bufferedRequestCount: 0,
     corkedRequestsFree: 
      { next: null,
        entry: null,
        finish: [Function: bound onCorkedFinish] } },
  writable: true,
  _events: {},
  _eventsCount: 0,
  _maxListeners: undefined }
/home/pi/node_airtunes/lib/rtsp.js:385
    this.socket.end(this.makeHead('TEARDOWN', '', di) + '\r\n');
                ^

TypeError: Cannot read property 'end' of null
    at Client.sendNextRequest (/home/pi/node_airtunes/lib/rtsp.js:385:17)
    at Client.teardown (/home/pi/node_airtunes/lib/rtsp.js:124:8)
    at AirTunesDevice.stop (/home/pi/node_airtunes/lib/device_airtunes.js:121:13)
    at cleanupCurrentOutput (/home/pi/babelpod/index.js:151:19)
    at Socket.<anonymous> (/home/pi/babelpod/index.js:202:5)
    at Socket.emit (events.js:180:13)
    at /home/pi/babelpod/node_modules/socket.io/lib/socket.js:528:12
    at process._tickCallback (internal/process/next_tick.js:112:11)

I installed it on my new Raspberry Pi Zero W, latest Raspbian Buster release and the setup as described on the official BabelPod page.

Any ideas what I can try?

Thank you!

Can't install babelpod

If I run npm install
I get
gyp ERR! build error gyp ERR! stack Error: make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.19.66-v7+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/babelpod/node_modules/ptyw.js
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2019-10-26T07_28_01_906Z-debug.log`

Can you help me please?

Pre-Configured Input and Output

I would like to use this as a kind of HomeKit device.
So I could start and stop the playback with Siri.

The HomeKit Integration can be done with Homebridge.
Currently Babelpod can be only configured with the Web-UI.
I would suggest something like that we can start Babelpod with a pre-configured Input and Output device.

What do you think?

HomePod not showing up as an AirPlay device

Awesome project, got it set up this AM. But having an issue and not seeing my HomePod as an output device? Tried power cycling everything, but no luck.

Any ideas? Haven't knowingly updated my HomePod, and cloned repo this morning. Running on a Rasp Pi Zero W.

Installation got stuck on Pi 3B

Trying several approaches to install babelpod. Succeeded until inclusive running airtunes.git, but failed with npm install.
My ultimate wish is to link my physical analog audio sources to wireless SONOS speakers. You are the only one I've discovered in the whole of internet to build this path - reason enough to love you.
So excuse me for bothering you with the 2 files appended describing the path I followed and so far failed it at the very end.
UpTo_airtunes.txt
Airtunes Build Error.txt

bitevader

Help! Babelpod runs but no sound. Stops after selection of AirPlay speaker

Hey everyone!
I really need help to make babelpod to work. I already tried and tried again with no success.
Can someone help me, please?

I followed these steps:

A clean install of latest version of Raspberry OS. (Raspbian GNU/Linux 11 (bullseye))

sudo apt update && sudo apt upgrade -y
wget https://nodejs.org/dist/v9.8.0/node-v9.8.0-linux-armv6l.tar.xz
sudo mkdir /usr/local/lib/nodejs
sudo tar -xJvf node-v9.8.0-linux-armv6l.tar.xz -C /usr/local/lib/nodejs
sudo mv /usr/local/lib/nodejs/node-v9.8.0-linux-armv6l/ /usr/local/lib/nodejs/node-v9.8.0
nano ~/.profile,

then I added the lines:
# Nodejs
export NODEJS_HOME=/usr/local/lib/nodejs/node-v9.8.0
export PATH=$NODEJS_HOME/bin:$PATH

source ~/.profile

Installed an old version of Python:
sudo apt install python2
npm config set python "/usr/bin/python2.7"

then I used @maexdaemaege repo:
git clone https://github.com/maexdaemaege/node_airtunes2
cd node_airtunes2
npm install
cd ..

I also used @maexdaemaege repo for Babelpod:
git clone https://github.com/maexdaemaege/babelpod.git
cd babelpod
npm install
node index.js

Following these steps, Babelpod runs, and I can select the input/output on the web browser.
It evens recognize my USB sound car.
But as soon as I select the AirPlay speaker, it stops.

This is my terminal output:

pi@raspberrypi:~/babelpod $ node index.js
listening on *:3000
bluetooth controller exists
a user connected
a user connected
user disconnected
a user connected
switch_input: plughw:1,0
switch_output: airplay_10.0.1.33_7000
inputStream Socket {
connecting: false,
_hadError: false,
_handle: Pipe { owner: [Circular], onread: [Function: onread], reading: false },
_parent: null,
_host: null,
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: [Object], tail: [Object], length: 1 },
length: 22052,
pipes:
ToVoid {
_writableState: [WritableState],
writable: true,
_events: [Object],
_eventsCount: 5,
_maxListeners: undefined },
pipesCount: 1,
flowing: false,
ended: false,
endEmitted: false,
reading: false,
sync: false,
needReadable: false,
emittedReadable: true,
readableListening: false,
resumeScheduled: false,
destroyed: false,
defaultEncoding: 'utf8',
awaitDrain: 1,
readingMore: false,
decoder: null,
encoding: null },
readable: true,
_events:
{ end: [ [Function], [Function] ],
finish: [Function: onSocketFinish],
_socketEnd: [Function: onSocketEnd],
close: [Function],
data: [Function: ondata] },
_eventsCount: 5,
_maxListeners: undefined,
_writableState:
WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: false,
needDrain: false,
ending: false,
ended: false,
finished: false,
destroyed: false,
decodeStrings: false,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: true,
bufferProcessing: false,
onwrite: [Function: bound onwrite],
writecb: null,
writelen: 0,
bufferedRequest: null,
lastBufferedRequest: null,
pendingcb: 0,
prefinished: false,
errorEmitted: false,
bufferedRequestCount: 0,
corkedRequestsFree:
{ next: null,
entry: null,
finish: [Function: bound onCorkedFinish] } },
writable: false,
allowHalfOpen: false,
_bytesDispatched: 0,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: null,
_server: null,
[Symbol(asyncId)]: 482,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(bytesRead)]: 0 }
outputStream ToVoid {
_writableState:
WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: false,
needDrain: true,
ending: false,
ended: false,
finished: false,
destroyed: false,
decodeStrings: true,
defaultEncoding: 'utf8',
length: 22096,
writing: true,
corked: 0,
sync: false,
bufferProcessing: false,
onwrite: [Function: bound onwrite],
writecb: [Function: nop],
writelen: 44,
bufferedRequest:
{ chunk: <Buffer fd ff fd ff fd ff fd ff fd ff fd ff fc ff fc ff fa ff fa ff fd ff fd ff fb ff fb ff fd ff fd ff ff ff ff ff fc ff fc ff fd ff fd ff fd ff fd ff fd ff ... >,
encoding: 'buffer',
isBuf: true,
callback: [Function: nop],
next: null },
lastBufferedRequest:
{ chunk: <Buffer fd ff fd ff fd ff fd ff fd ff fd ff fc ff fc ff fa ff fa ff fd ff fd ff fb ff fb ff fd ff fd ff ff ff ff ff fc ff fc ff fd ff fd ff fd ff fd ff fd ff ... >,
encoding: 'buffer',
isBuf: true,
callback: [Function: nop],
next: null },
pendingcb: 2,
prefinished: false,
errorEmitted: false,
bufferedRequestCount: 1,
corkedRequestsFree:
{ next: null,
entry: null,
finish: [Function: bound onCorkedFinish] } },
writable: true,
_events:
{ unpipe: [Function: onunpipe],
drain: [Function],
error: [Function: onerror],
close: { [Function: bound onceWrapper] listener: [Function: onclose] },
finish: { [Function: bound onceWrapper] listener: [Function: onfinish] } },
_eventsCount: 5,
_maxListeners: undefined }
adding device: 10.0.1.33:7000
airplay status: stopped

@afaden @maexdaemaege is this project dead and current version doesn't work anymore?
This is such a cool project and I can't get it to work. Frustrating.

Instalation not work

hello everyone

first of all, sorry for my bad english.

This project sounds great. However, the technology has changed since 2018 (Raspberry Pi OS). Will this project be updated to a new version yet?

Even with a Raspberry Pi version from 2018, the project cannot be installed and runs with errors. The impression arises that packages to be installed are no longer available. It would be a pity if the project was no longer continued.

Bluetooth setup description deprecated

Hi,

while fiddling around with this project for a while and trying to get it working i've tried several ways to connect my phone to the pi zero w via bluetooth.

Following the steps on the project setup page wont work for me, i've tried with several raspbian images (lite as well as desktop, the latest buster as well as images from 2017/2018 when this project war created).
For example, Enable=Source,Sink,Media is not a valid argument for the /etc/bluetooth/main.conf file. As stated in several other bluetooth setup guides, it might be used in /etc/bluetooth/input.conf.

However, when establishing the bluetooth connection as stated by @afaden , it will connect but the pi won't be noticed as bluetooth sink, so i tried several other ways like installing pulseaudio (only to learn later that bluealsa and pulseaudio wont work well together) or following the steps on: https://www.sigmdel.ca/michel/ha/rpi/bluetooth_n_buster_01_en.html

After that the pi is at least noticed as audio sink, but the phone will not be displayed in the BabelPod web ui as audio source.

So, did anyone manage to get BabelPod with bluetooth on a pi zero w running? If so, i am highly interested in the exact steps and prerequisites (image, packages) for this!

set the default input

i'm trying to set a default input but i'm unable to modify index.html file. Can anyone help me ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.