Git Product home page Git Product logo

e-nguyen's Introduction

E-Nguyen

Prototype Phase Complete!  Real-time-ish Spectrogram

CircleCI Published on Crates.io LGPL Licensed Donate Ethereum (Taxable)

Produce engaging visual output from arbitrary input, especially sound, in a context designed to composably remix content with minimal prep work.

E-Nguyen is written in Rust and uses the Vulkan graphics API. The current license is LGPL3+ and content is recommended to submitted as Creative Commons Attribution Share-Alike 4.0+ (CC-BY-SA 4.0)

The project has two goals:

  1. Seemlessly compose creative works and processing algorithms & heuristics to maximize the richness added by each contribution.
  2. Provide a context for studying and overcoming computing challenges that is highly relaxed and free-form without sacrificing any headroom to skate the bleeding edge.

Building

E-Nguyen can be built on Rust's stable toolchain. Install Rust

You may need to install a Vulkan ICD (Installable Client Driver) for your OS & graphics card combination. Consult your OS's Vulkan installation documentation.

Clone this repository and run it (building will be performed if necessary).

git clone https://github.com/e-nguyen/e-nguyen.git
cd e-nguyen
cargo run --release --fullscreen

Troubleshooting

For graphics issues, first try building and running examples from the Vulkano project. The teapot and other examples should run.

Use the -l switch to activate the standard Vulkan validation layers, which may reveal invalid API calls.

The Wiki contains some information about configuring and tuning your sound server for E-Nguyen to play well.

Contributing

Please review the Contributing document and remember to double-emoji your PR's to leave a verifiable record and enable the LGPL and other protections.

Status

Fresh off the press. Architecture for visualizaiton composition and other documentation inbound. Get involved!

Currently only the PulseAudio sound server (Linux) can be monitored.

e-nguyen's People

Contributors

dependabot-support avatar knappador avatar

Stargazers

 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

Forkers

chrispetkau

e-nguyen's Issues

Error Chaining

No coherent error chaining scheme has been implemented so far. I greatly prefer keeping ? available in all functions while ensuring that any information that can inform recovery / contingency decisions of callers is propagated for semantically informative pattern matching.

Launch Button

Launching without the -f flag will lead to the "settings" window. While there are currently still no meaningfully configurable settings, at the least there should be a launch button so that confused users can open the actual Mesmerizer

Render some more text and use mouse-click UserEvent from input.rs to see if both the associated mouse-down and mouse-up were within a reasonable click box. For bonus points, change the color during hover and other states. Use uppercase text if you want to get fancy.

We don't need to build a full UI library for retained mode rendering with event bubbling and all that, but who knows what kinds of structured data we'll want to edit before Rust has an obviously good UI lilbrary to employ here.

Core Audio (iOS support)

Check the design of audio.rs and create the necessary AudioRing for compute.rs to obtain a RingBytes RingReceiver defined in ring.rs. If the data can't be obtained in 2-channel S16LE (signed 16-bit little endian) either by asking the audio server nicely or coercion, modifying compute to actually inspect the SimpleSource and switch behavior on it will yield a working implementation.

cfg tags for Linux

Hide pulse audio behind some config tags and get the build to try and inform the user why it's just not going to work yet on Windows / Mac

Docs & Module Structure

Since this project is fresh off the press, while the modules work, there are undoubtedly some weird habits brewing.

In addition, I'd like to document traits that are intended for extension so that the parts of the API that people want to use (could be destined for a library / application split) to implement new visualizations are easily navigated to and easy to link to when created & modified. My first spike didn't seem to be yielding docs more useful than reading the source.

Is Something Broken?

  • Can run other Vulkan software and I can use the Vulkano examples
  • Supported sound server installed such as PulseAudio on Linux

Type of Support Being Sought

  • Can program Rust and want to learn how to fix the problem and be a master of the git
  • Honorable colleague, just point me to the right files
  • Willing to run diagnostics specific to my platform and test fixes
  • I need to think about my life

Before you submit

  • Checked for duplicate issues and PR's related to my issue
  • Linked to any PR's and issues that looked related
  • Put a lot of support emoji's on PR's related to my issue

Crash in fullscreen mode

Is Something Broken?

  • Can run other Vulkan software and I can use the Vulkano examples
  • Supported sound server installed such as PulseAudio on Linux

Type of Support Being Sought

  • Can program Rust and want to learn how to fix the problem and be a master of the git
  • Honorable colleague, just point me to the right files
  • Willing to run diagnostics specific to my platform and test fixes
  • I need to think about my life

Before you submit

  • Checked for duplicate issues and PR's related to my issue
  • Linked to any PR's and issues that looked related
  • Put a lot of support emoji's on PR's related to my issue
[2019-03-28T21:28:41Z WARN  e_nguyen::ewin] No discrete device was found.
[2019-03-28T21:28:41Z INFO  e_nguyen::ewin] Using device: Intel(R) HD Graphics 530 (Skylake GT2) (type: IntegratedGpu)
[2019-03-28T21:28:41Z DEBUG e_nguyen::audio] Input devices detected [
    (
        ServerStream {
            name: "alsa_output.pci-0000_00_1f.3.analog-stereo.monitor",
            index: 0,
            desc: "Monitor of Built-in Audio Analog Stereo",
            spec: Spec {
                format: S16le,
                rate: 44100,
                channels: 2
            }
        },
        SimpleSource {
            name: "alsa_output.pci-0000_00_1f.3.analog-stereo.monitor",
            index: 0,
            rate: 44100,
            channels: 2,
            sample_format: S16le
        }
    ),
    (
        ServerStream {
            name: "alsa_input.pci-0000_00_1f.3.analog-stereo",
            index: 1,
            desc: "Built-in Audio Analog Stereo",
            spec: Spec {
                format: S16le,
                rate: 44100,
                channels: 2
            }
        },
        SimpleSource {
            name: "alsa_input.pci-0000_00_1f.3.analog-stereo",
            index: 1,
            rate: 44100,
            channels: 2,
            sample_format: S16le
        }
    ),
    (
        ServerStream {
            name: "tunnel.ubik.local.alsa_output.usb-AudioQuest_AudioQuest_DragonFly_Black_v1.5_AQDFBL0100004381-01.analog-stereo.monitor",
            index: 28,
            desc: "Monitor Source of AudioQuest DragonFly Black v1.5 Analog Stereo on [email protected]",
            spec: Spec {
                format: S24le,
                rate: 44100,
                channels: 2
            }
        },
        SimpleSource {
            name: "tunnel.ubik.local.alsa_output.usb-AudioQuest_AudioQuest_DragonFly_Black_v1.5_AQDFBL0100004381-01.analog-stereo.monitor",
            index: 28,
            rate: 44100,
            channels: 2,
            sample_format: S24le
        }
    ),
    (
        ServerStream {
            name: "tunnel.ubik.local.alsa_output.usb-AudioQuest_AudioQuest_DragonFly_Black_v1.5_AQDFBL0100004381-01.analog-stereo.2.monitor",
            index: 29,
            desc: "Monitor Source of AudioQuest DragonFly Black v1.5 Analog Stereo on [email protected]",
            spec: Spec {
                format: S24le,
                rate: 44100,
                channels: 2
            }
        },
        SimpleSource {
            name: "tunnel.ubik.local.alsa_output.usb-AudioQuest_AudioQuest_DragonFly_Black_v1.5_AQDFBL0100004381-01.analog-stereo.2.monitor",
            index: 29,
            rate: 44100,
            channels: 2,
            sample_format: S24le
        }
    )
]
[2019-03-28T21:28:41Z DEBUG e_nguyen::audio] Using monitor: "alsa_output.pci-0000_00_1f.3.analog-stereo.monitor"
[2019-03-28T21:28:41Z WARN  e_nguyen::audio] PA state callback for Stream called with lock held
INTEL-MESA: error: ../mesa-19.0.0/src/intel/vulkan/anv_queue.c:45: execbuf2 failed: Invalid argument (VK_ERROR_DEVICE_LOST)
INTEL-MESA: error: ../mesa-19.0.0/src/intel/vulkan/anv_queue.c:244: vkQueueSubmit() failed (VK_ERROR_DEVICE_LOST)
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: DeviceLost', src/libcore/result.rs:997:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: DeviceLostError', src/libcore/result.rs:997:5
stack backtrace:
   0:     0x556028f00123 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::h39625934646a062b
                               at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1:     0x556028efbd7b - std::sys_common::backtrace::_print::h5ed439e79e04d188
                               at src/libstd/sys_common/backtrace.rs:71
   2:     0x556028efec96 - std::panicking::default_hook::{{closure}}::h13bf33e40bf761d8
                               at src/libstd/sys_common/backtrace.rs:59
                               at src/libstd/panicking.rs:197
   3:     0x556028efea29 - std::panicking::default_hook::h7e24c700cb9d2623
                               at src/libstd/panicking.rs:211
   4:     0x556028eff39f - std::panicking::rust_panic_with_hook::h37915b26028fb081
                               at src/libstd/panicking.rs:474
   5:     0x556028efef21 - std::panicking::continue_panic_fmt::h940255bf34f40feb
                               at src/libstd/panicking.rs:381
   6:     0x556028efee05 - rust_begin_unwind
                               at src/libstd/panicking.rs:308
   7:     0x556028f1742c - core::panicking::panic_fmt::h3022c09ba47ed570
                               at src/libcore/panicking.rs:85
   8:     0x556028afcf60 - core::result::unwrap_failed::h3f22ac4de5ca2418
   9:     0x556028b437ed - core::ptr::real_drop_in_place::h4ae50795ed01f1c7
  10:     0x556028adac3f - core::ptr::real_drop_in_place::hb67e42d79d8e8d29
  11:     0x556028af4335 - <e_nguyen::mesmerize::MezFramer as e_nguyen::rendering::Framer<'a, 'f, e_nguyen::mesmerize::MezFramer, e_nguyen::mesmerize::MezState, e_nguyen::mesmerize::MezResources>>::render_one::h1cd4a107e5442ef5
  12:     0x556028aed5cc - e_nguyen::mesmerize::mezmerize::h1c9883e47eb9c487
  13:     0x556028b1e915 - e_nguyen::application::MezLauncher::launch::h091a108ea32a642f
  14:     0x556028f03c49 - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:87
  15:     0x556028b7a99b - <F as alloc::boxed::FnBox<A>>::call_box::h0f750f672d168be4
  16:     0x556028f02fdd - std::sys::unix::thread::Thread::new::thread_start::h0b141bcf37c246b9
                               at /rustc/e68bf8ae15ee6c052d0bcc9252386c5c5ee86de2/src/liballoc/boxed.rs:759
                               at src/libstd/sys_common/thread.rs:14
                               at src/libstd/sys/unix/thread.rs:80
  17:     0x7fd44be32a9c - start_thread
  18:     0x7fd44bd48b22 - clone
  19:                0x0 - <unknown>
thread panicked while panicking. aborting.

Black window for about 2 seconds, then crashes. Crashes more quickly when audio is playing. Running on Arch Linux, Gnome, Wayland. Note how, as opposed to #22, it's detecting the audio source.

DPI Support on Settings Screen

#22

The DPI isn't getting set correctly for the text, which is from Vulkan glyph, so it overflows the settings page. The math is really simple to fiddle with once the calls are done correctly.

The issue is in settings.rs and likely has a corresponding issue on winit's github.

How to use windowed mode?

Is Something Broken?

  • Can run other Vulkan software and I can use the Vulkano examples
  • Supported sound server installed such as PulseAudio on Linux

Type of Support Being Sought

  • Can program Rust and want to learn how to fix the problem and be a master of the git
  • Honorable colleague, just point me to the right files
  • Willing to run diagnostics specific to my platform and test fixes
  • I need to think about my life

Before you submit

  • Checked for duplicate issues and PR's related to my issue
  • Linked to any PR's and issues that looked related
  • Put a lot of support emoji's on PR's related to my issue

Windowed mode looks like below. How do I use it?

image

[2019-03-28T21:17:25Z WARN  e_nguyen::ewin] No discrete device was found.
[2019-03-28T21:17:25Z INFO  e_nguyen::ewin] Using device: Intel(R) HD Graphics 530 (Skylake GT2) (type: IntegratedGpu)

Note how there's no message related to the audio source.

pulse audio linking failure on ubuntu 18.04

Besides the link line being bonkers with duplicate libpulse.so.0, I get a linking error in final build:

dynamic" "-ldl" "-ldl" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-l:libpulse.so.0" "-lutil" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
  = note: /usr/bin/ld: /home/abraxis/git/e-nguyen/target/debug/deps/liblibpulse_binding-c1199969bf25a97e.rlib(libpulse_binding-c1199969bf25a97e.libpulse_binding.afyuou7h-cgu.15.rcgu.o): undefined reference to symbol 'pa_encoding_from_string'
          //usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-11.1.so: error adding symbols: DSO missing from command line
          collect2: error: ld returned 1 exit status

Looks like pulse audio sys crate (pulse audio linking story in general?) is pretty broken?

~/git/e-nguyen$ ls -al /usr/lib/x86_64-linux-gnu/ | grep -i pulse
lrwxrwxrwx   1 root root       31 Jan 22 22:54 libpulse-mainloop-glib.so.0 -> libpulse-mainloop-glib.so.0.0.5
-rw-r--r--   1 root root    18424 Jan 22 22:54 libpulse-mainloop-glib.so.0.0.5
lrwxrwxrwx   1 root root       24 Jan 22 22:54 libpulse-simple.so.0 -> libpulse-simple.so.0.1.1
-rw-r--r--   1 root root    18352 Jan 22 22:54 libpulse-simple.so.0.1.1
lrwxrwxrwx   1 root root       18 Jan 22 22:54 libpulse.so.0 -> libpulse.so.0.20.2
-rw-r--r--   1 root root   326544 Jan 22 22:54 libpulse.so.0.20.2
drwxr-xr-x   2 root root     4096 Apr 13 20:34 pulseaudio
~/git/e-nguyen$ ls -al /usr/lib/x86_64-linux-gnu/pulseaudio | grep -i pulse
-rw-r--r--  1 root root 514216 Jan 22 22:54 libpulsecommon-11.1.so
-rw-r--r--  1 root root 682680 Jan 22 22:54 libpulsecore-11.1.so
-rw-r--r--  1 root root  46944 Jan 22 22:54 libpulsedsp.so

looking at the pulse sys crate it looks like pkg-config failed (why?), and the explicit -l:libpulse.so.0 was given.

I think for whatever reason it's trying to link the dso statically, which is that linker error, though i'm not sure why/what/how cargo/rustc/pulseaudio sys went wrong?

I wanted to test and see if the fullscreen failure is related to your immutable image usage, similar to the failure I saw, but can't get past this step unfortunately, so posting this issue here.

Config Migration

Before implementing auto-save of configurations or any configured features, remember to support migration or else it will be more painful someday.

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.