- C 96.2%
- Meson 3.8%
| src | added logfile and exits on poll error | |
| .clang-format | more cleanup, added more to project | |
| .editorconfig | more cleanup, added more to project | |
| .gitignore | more cleanup, added more to project | |
| avrd.1.scd | more cleanup, added more to project | |
| LICENSE | more cleanup, added more to project | |
| meson.build | more message handling. refactoring. | |
| meson_options.txt | more cleanup, added more to project | |
| README.md | more message handling. refactoring. | |
AVR Utils
Programs for controlling your Denon/Marantz/Onkyo or compatible AVR and integrate into your OS. I call it avr-utils for now because I am not sure whether I am done with making utility programs yet for this.
It was inspired by wob and can optionally be used in with it.
It was created to serve a simple purpose, namely controlling my Marantz AVR over the RS-232C port or TELNET port, because I got tired of HDMI-CEC, and its slow somewhat buggy transport. I prefer the RS-232C as it is the most problem free method for me and it exposes more AVR functionality.
The avrd daemon simply makes it easier to control my AVR from my window manager while using wob(1) to display the volume, power and mute state.
Building
Install dependencies:
- meson *
- scdoc (optional: man page) *
Run these commands:
git clone https://codeberg.org/shaohme/dotfiles.git
cd avr-utils
meson setup --buildtype=release build
meson compile -C build/
sudo meson install -C build
For coverage, build with coverage options:
meson setup --wipe -Db_coverage=true build
After usage, run:
ninja coverage -C build
This should create reports that can be browsed and read.
- meson-logs/coveragereport/index.html
General use case
You could use a named pipe to for sending commands to it while
running. Create a named pipe, e.g. /tmp/avrd.pipe, on your
file system using.
mkfifo /tmp/avrd.pipe
Connect the named pipe to the standard input of a wob instance.
tail -f /tmp/avrd.pipe | avrd -d /dev/ttyUSB0
Optionally, you can add a wob(1) pipe into the mix passing its pipe path to avrd.
tail -f /tmp/avrd.pipe | avrd -d /dev/ttyUSB0 -w /tmp/wobsock
This will avrd print current volumes to wob(1) when received from AVR and changed.
You should now be able to write commands to the avrd pipe, like so for turning the AVR on.
echo ON > /tmp/avrd.pipe
You can also change master volumes the same way.
echo VOLUP > /tmp/avrd.pipe
Refer to the man page for all commands.
Features to come
- Announce current state using DBus org.freedesktop.Notifications, like surround modes.
- Automatic surround mode according to program. Like switch to 2.1 stereo on some programs and 5.1 on others.
Configuration
avrd does not use any configuration files. See the man page for options, or run:
avrd -h
When integrated with wob(1), styles names can be configured with avrd so wob(1) becomes colored when volume changes.
Caveats
These are known issues not yet fixed, which could affect users.
Limited buffer
avrd only have 512 byte caches to read and write from. Messages are not expected to get larger and according to Denon no message from AVR should exceed 135 chars. This could be violated for numerous reasons and avrd will exit when it occurs.
Poor socket error handling
If the TELNET connection is lost, or becomes invalid avrd will fail and exit. This just needs to be implemented if used by more. Consider it laziness from the developers side.
License
ISC, see LICENSE.