GithubHelp home page GithubHelp logo

bark's People

Contributors

haileys 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

bark's Issues

Build failure on musl due to missing libc::sched_param fields

on musl libc, the sched_param struct has more fields:

    pub struct sched_param {
        pub sched_priority: ::c_int,
        #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
        pub sched_ss_low_priority: ::c_int,
        #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
        pub sched_ss_repl_period: ::timespec,
        #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
        pub sched_ss_init_budget: ::timespec,
        #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
        pub sched_ss_max_repl: ::c_int,
    }

without them, compiling bark fails:

   Compiling bark v0.1.0
error[E0063]: missing fields `sched_ss_init_budget`, `sched_ss_low_priority`, `sched_ss_max_repl` and 1 other field in initializer of `sched_param`
  --> src/thread.rs:19:14
   |
19 |             &libc::sched_param {
   |              ^^^^^^^^^^^^^^^^^ missing `sched_ss_init_budget`, `sched_ss_low_priority`, `sched_ss_max_repl` and 1 other field

For more information about this error, try `rustc --explain E0063`.
error: could not compile `bark` (bin "bark") due to previous error

Build instructions

Just some quick notes on build instructions.

I'm doing this on Fedora, so I'm just writing down those instructions

  1. Needs speexdsp (rpm: speexdsp-devel, apt: libspeexdsp-dev), alsa
  2. cargo build

cross-compiling (eg raspberry pi) fedora:

  1. Cross-compiling system stuff (rpm: binutils-arm-linux-gnu, gcc-arm-linux-gnu / binutils-aarch64-linux-gnu, gcc-aarch64-linux-gnu)
  2. Get appropriate rust bits (rustup target add arm-unknown-linux-gnueabihf / rustup target add aarch64-unknown-linux-gnu / etc)
  3. libraries???
  4. PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu cargo build --target aarch64-unknown-linux-gnu / PKG_CONFIG_SYSROOT_DIR=/usr/arm-none-eabi cargo build --target arm-unknown-linux-gnueabihf

actually, i never figured out how to fix the linking errors on fedora (i think it's trying to link in the x86 libraries into the arm binaries), so I'm just going to compile on the Pis.

Integration with moOde audio player

Hi,

My name is Tim Curtis. I'm the maintainer for the moOde audio player project (a FOSS non-commercial project). It's an MPD based player/streamer for the Raspberry Pi family of SBC's.
https://github.com/moode-player
https://moodeaudio.org

One of our Forum users mentioned your nice project today https://moodeaudio.org/forum/showthread.php?tid=5734&pid=48016#pid48016 and I wanted to follow up with you to see if you might be interested in discussing integration of your software into moOde.

Currently we are using the TRX Realtime audio over IP toolset to implement our Multiroom Audio feature and it's working ok. It uses Multicast, RTP/UDP, ALSA directly, the Opus CODEC (16/48K) for the audio format and does not support clock sync but rather simply relies on low network latency. It also doesn't support playback on the sending device. The sender reads PCM from the ALSA Loopback device and the Receiver outputs to either ALSA plughw:n,m or hw:n,m device.

Clock sync would be a nice enhancement for us and since you are using raw uncompressed PCM format possibly a way to support native source rates, mostly 16/44.1K but also the usual "HiRes" rates up to 24/192K. Also support for having the sending device also be a receiver.

Regards,
-Tim

Here's some additional background info on our solution.

TRX sources

https://github.com/bitkeeper/trx/releases/tag/0.6

TRX launch args

#
# Sender
#
pi@moode:~ $ trx-tx -H
trx 0.6.0
(C) Copyright 2020 Mark Hills <[email protected]>
(C) Copyright 2021 Tim Curtis <[email protected]>

Usage: tx [<parameters>]
Real-time audio transmitter over IP

Audio device (ALSA) parameters:
  -d <dev>    Device name (default 'default')
  -m <ms>     Buffer time (default 16 milliseconds)

Network parameters:
  -h <addr>   IP address to send to (default ::)
  -p <port>   UDP port number (default 1350)

Encoding parameters:
  -r <rate>   Sample rate (default 48000 Hz, see (1) below.)
  -c <n>      Number of channels (default 2)
  -f <n>      Frame size (default 960 samples, see (2) below)
  -b <kbps>   Bitrate (approx., default 128)

Program parameters:
  -v <n>      Verbosity level (default 1)
  -D <file>   Run as a daemon, writing process ID to the given file
  -R <prio>   Realtime priority (default 45)
  -H          Print program help

(1) Sampling rate (-r) of the input signal (Hz) This must be one
of 8000, 12000, 16000, 24000, or 48000.

(2) Allowed frame sizes (-f) are defined by the Opus codec. For example,
at 48000 Hz the permitted values are 120, 240, 480, 960, 1920 or 2880 which
correspond to 2.5, 7.5, 10, 20, 40 or 60 milliseconds respectively.

### From PHP
$cmd = 'trx-tx -d trx_send -h ' . $cfgMultiroom['tx_host'] . ' -p ' . $cfgMultiroom['tx_port'] . ' -m ' . $cfgMultiroom['tx_bfr'] . ' -f ' . $cfgMultiroom['tx_frame_size'] . ' -R ' . $cfgMultiroom['tx_rtprio'] . ' -D /tmp/trx-txpid  >/dev/null';
$result = shell_exec($cmd);

#
# Receiver
#
pi@moode:~ $ trx-rx -H
trx 0.6.0
(C) Copyright 2020 Mark Hills <[email protected]>
(C) Copyright 2021 Tim Curtis <[email protected]>

Usage: rx [<parameters>]
Real-time audio receiver over IP

Audio device (ALSA) parameters:
  -d <dev>    Device name (default 'default')
  -m <ms>     Buffer time (default 16 milliseconds)

Network parameters:
  -h <addr>   IP address to listen on (default ::)
  -p <port>   UDP port number (default 1350)
  -j <ms>     Jitter buffer (default 16 milliseconds)

Encoding parameters (must match sender):
  -r <rate>   Sample rate (default 48000 Hz)
  -c <n>      Number of channels (default 2)
  -f <n>      Frame size (default 960 samples, see (1) below)

Program parameters:
  -v <n>      Verbosity level (default 1)
  -D <file>   Run as a daemon, writing process ID to the given file
  -R <prio>   Realtime priority (default 45)
  -H          Print program help

(1) Allowed frame sizes (-f) are defined by the Opus codec. For example,
at 48000 Hz the permitted values are 120, 240, 480, 960, 1920 or 2880 which
correspond to 2.5, 7.5, 10, 20, 40 or 60 milliseconds respectively.

### From PHP
$cmd = 'trx-rx -d ' . $cfgMultiroom['rx_alsa_output_mode'] . ':' . $_SESSION['cardnum'] . ',0 -h ' . $cfgMultiroom['rx_host'] . ' -p ' . $cfgMultiroom['rx_port'] . ' -m ' . $cfgMultiroom['rx_bfr'] . ' -j ' . $cfgMultiroom['rx_jitter_bfr'] . ' -f ' . $cfgMultiroom['rx_frame_size'] . ' -R ' . $cfgMultiroom['rx_rtprio'] . ' -D /tmp/trx-rxpid  >/dev/null';
$result = shell_exec($cmd);

Multiroom Configuration screen shot

Screenshot 2023-08-21 at 10 17 56 AM

Doesn't run on RPi3

image

Not enough CPU, so it never catches up--ALSA also complains about buffer underruns, and bark stats consistently shows it 500ms off.

It might run if PulseAudio wasn't necessary? But I couldn't figure out how to run it without pulse.

Compare to Snapcast?

Hi there, I stumbled upon this project and have absolutely no experience in HIFI or multiroom audio. Could you please just sum up a few points how this is similar / different to snapcast? approach? Bark looks nice so far and I'm wondering if it would be compatible with esp32 / esp8266 based qC solutions?

Allow setting alsa device name

currently, when pactl is unavailable, bark falls back to a "default audio device"; as such, it's not possible to explicitly specify an output device like hw:0,2 when using pure alsa

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.