~geb/numen

16 2

Change command

Details
Message ID
<09h9WHILKI81588_W6nSKJ_OHml33rs-0ZUo22eXetpviZdXSAEpCpnhrttD0xyQCzWZKk7Jdg7RgR_HHRzRE8HHqNImC87SL6i5wZVtQ-0=@protonmail.com>
Sender timestamp
1680023736
DKIM signature
missing
Download raw message
Hey John, I'm in the middle of reinstalling everything along with numen and tiles to see if I can correct some audio issues I've been experiencing the past few weeks. One of the errors I'm getting is, "displaying: Could not determine the active X display", when I say 'change'. I found the file that is giving this error but I'm still in scripting infancy and was wondering if you could help me out with this. I have dmenu installed and a menu will pop up with alternative transcripts but I can't select any of them by saying 'down' or 'up' or 'okay'. Once I minimize the active X display (window) or close it then I can do everything you would expect with the menu except it will print the alternative transcript I select in the most recent window which didn't initiate the 'change' command (in a text editor for example). I'm on Ubuntu 22.04 LTS (just reinstalled).
Details
Message ID
<CRID5XNCYCGW.2TXPGC1GHSP6T@d>
In-Reply-To
<09h9WHILKI81588_W6nSKJ_OHml33rs-0ZUo22eXetpviZdXSAEpCpnhrttD0xyQCzWZKk7Jdg7RgR_HHRzRE8HHqNImC87SL6i5wZVtQ-0=@protonmail.com> (view parent)
Sender timestamp
1680045542
DKIM signature
missing
Download raw message
Hi sublime, nice to hear from you even if it's because something's goofed.

I'm pretty sure it's because you're on Wayland not X11.  The environment
variable WAYLAND_DISPLAY is set if you're on Wayland, so you can check:

    [ "$WAYLAND_DISPLAY" ] && echo 'on Wayland'

Try changing to Tiles or "GNOME on Xorg" in your display manager if that's
the case.  dmenu won't usually work in Wayland (but there are alternatives
like wmenu).

By the way, the tiles master branch uses `~/.config/tiles/browser` instead of
`~/.config/tiles-browser` as it was on the develop branch.
Details
Message ID
<DjAsMx-adyBaBNupQP5knybqsFp-wOqiFhuAyKwXOoifjswTjl5yT5Cnlpj1LotYlZZS_oUfZ22mS0bOq2YNMo06TT5pHrKQrXHiocywDZg=@protonmail.com>
In-Reply-To
<CRID5XNCYCGW.2TXPGC1GHSP6T@d> (view parent)
Sender timestamp
1680117841
DKIM signature
missing
Download raw message
You were right I'm the one that goofed. Back on X11. What would I do without you? You'd think I'm drinking bleach with a question like that but only when I have covid. 

The develop branch of tiles has more features correct? That's what I was on and planned on using again. 

By the way, I came across a few zsh key bindings that you may like and I've been using on a regular basis. I've also been using fzf which is a command line fuzzy finder and is really useful. Below is the contents of my zsh and fzf configuration file. Hope it helps!

### ZSH CONFIGURATIONS ###
# In order to see the sequence to give to bindkey for the key you want, use `cat > /dev/null` and then press the key combination.
# Commented the following two history search commands because '^R' is already a default key binding for fzf history search which provides backward and forward search but better.
#bindkey '^R' history-incremental-pattern-search-backward
#bindkey '^F' history-incremental-pattern-search-forward
# ^[. corresponds to alt+. according to `cat > /dev/null` followed by pressing those keys. Insert the last word from the previous history event at the cursor position. Repeating the key binding shuffles between the words of the last commands.
bindkey '^[.' insert-last-word
# Kill the current word (from the cursor position to the end of the word).
bindkey '^D' kill-word
# Kill from the cursor to the end of the line. If already on the end of the line, kill the new line character.
bindkey '^K' kill-line
# Kill the current line
bindkey '^L' kill-whole-line
bindkey '^A' beginning-of-line
bindkey '^E' end-of-line


### FZF CONFIGURATIONS ###
source /usr/share/doc/fzf/examples/key-bindings.zsh
source /usr/share/doc/fzf/examples/completion.zsh
# Setting fd as the default source for fzf. This command ignores .git directories, respects .gitignore, follows symbolic links and doesn't exclude hidden files. It also searches for regular files, directories, symbolic links, sockets, and named pipes (FIFOs). To search for executable files see man fd. To search for empty files or directories see man fd.
export FZF_DEFAULT_COMMAND='fd --type f --type d --type l --type s --type p --strip-cwd-prefix --hidden --follow --exclude .git'
# {} is replaced with the single-quoted string of the focused line
export FZF_DEFAULT_OPTS="
  --exact
  --preview 'bat -n --color=always {}'
  --preview-window hidden
  --bind 'ctrl-p:toggle-preview'"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_CTRL_T_OPTS="$FZF_DEFAULT_OPTS"
export FZF_CTRL_R_OPTS="--exact --preview 'echo {}' --preview-window down:3:hidden:wrap --bind 'ctrl-p:toggle-preview'"
# Searches for directories (including hidden). To search for empty directories see man fd.
export FZF_ALT_C_COMMAND='fd --type d --strip-cwd-prefix --hidden'
# Print tree structure in the preview window
export FZF_ALT_C_OPTS="--exact --preview 'tree -C {}' --preview-window hidden --bind 'ctrl-p:toggle-preview'"
# Advanced customization of fzf options via _fzf_comprun function
# - The first argument to the function is the name of the command.
# - You should make sure to pass the rest of the arguments to fzf.
_fzf_comprun() {
  local command=$1
  shift

  case "$command" in
    cd)           fzf --preview 'tree -C {}'		   "$@" ;;
    export|unset) fzf --preview "eval 'echo \$'{}"         "$@" ;;
    ssh)          fzf --preview 'dig {}'                   "$@" ;;
    # Not quite sure what case * is used for. Something to do with shell expansion?
    *)            fzf --preview 'bat -n --color=always {}' "$@" ;;
  esac
}
Details
Message ID
<CRLDND7Y3W2A.2XHC979DD1AN6@d>
In-Reply-To
<DjAsMx-adyBaBNupQP5knybqsFp-wOqiFhuAyKwXOoifjswTjl5yT5Cnlpj1LotYlZZS_oUfZ22mS0bOq2YNMo06TT5pHrKQrXHiocywDZg=@protonmail.com> (view parent)
Sender timestamp
1680351588
DKIM signature
missing
Download raw message
That's no problemo.

Yes, the develop branch is where I put stuff first and that's good if you're
testing it too.

It's nice you've found tools you like, but it's kind of my job to be no fun
and say no to most to things to keep things minimal and focused. Hope that's
all right.

I'm working on new tools and I'll give you a shout when they're out :)
Details
Message ID
<TKPtBtLPcTIpmzoR9vycQiJcj1Iiz1u9r51Ry1hRfIqscGM_qVZHbaHK0C8Sz2yz-7g9HlirTZsQQOeeY9bfZNTB9EIPM7jkxUJW87Bx2G4=@protonmail.com>
In-Reply-To
<CRLDND7Y3W2A.2XHC979DD1AN6@d> (view parent)
Sender timestamp
1680371047
DKIM signature
missing
Download raw message
Yeah that's alright I know more features can drag it down. Just wanted to share in case it's helpful (especially the zsh key bindings like delete the whole line no matter the cursor position which is probably the one I use the most). Looking forward to anything you put out :)

On a side note, remember how we were talking about text getting cut off and random text in the terminal when resizing? Well maybe it's not a urxvt problem and something else instead because on a fresh install of Ubuntu 22.04 LTS this is happening in the terminal with default shell settings and everything when I resize the window. I don't think I had this problem in the past but could be wrong.
Details
Message ID
<CSBW8IOONO47.Q4E6M284YW4@d>
In-Reply-To
<TKPtBtLPcTIpmzoR9vycQiJcj1Iiz1u9r51Ry1hRfIqscGM_qVZHbaHK0C8Sz2yz-7g9HlirTZsQQOeeY9bfZNTB9EIPM7jkxUJW87Bx2G4=@protonmail.com> (view parent)
Sender timestamp
1683044585
DKIM signature
missing
Download raw message
Hi sublime, hope all's good.

I did a big rewrite of numen so it's now just a binary rather than a hodgepodge
with lots of scripts, but there are some changes that require updating the
phrases.  I've also introduced new refined default phrases that are more
accurate and terse, but you're free to stick with the old ones if you'd prefer.

If you'd like to update and try the new phrases, you could:

    git pull
    numen /etc/numen/phrases/*.phrases

You can still get the old (but updated to work) ones if you want, like so:

	git switch -d 2373c41
	cp phrases old-phrases
	git switch master

I'm really happy with the new phrases though and think they're a big
improvement. They're practically the same action-wise, it's mainly the words
for the symbols that have changed.

For example, the old brackets:

	(inner outer) [opener closer] {sister dexter}

and the new brackets:

	(wax wane) [bric brac] {curl crimp}

The breaking changes are a one-off to get numen as good as possible before
version 1.0 when there shouldn't be any breaking changes.  Sorry for the faff.
Details
Message ID
<lMU5NoudsZVCG-naYyhnkkAqwF5sVOB-xdHCxfanODCkX_D4Th7B5KotCjpCazkPod-Xz4Wnr954FYPhaCkrr02bvDgrX0zXFmZwEm7yU_A=@protonmail.com>
In-Reply-To
<CSBW8IOONO47.Q4E6M284YW4@d> (view parent)
Sender timestamp
1683131129
DKIM signature
missing
Download raw message
That's great John. I like the changes to the phrases - definitely more terse. I will likely try this in the coming weeks. Still trying to narrow down what's causing some audio issues but it's getting better slowly. Just a lot of adding and removing one or two things at a time.

I know this may sound kind of obvious, but taking the pop filter off of the arm (admittedly it was a very cheap filter) and moving the microphone closer to my mouth (about chin level and two to three inches away) allows me to see all of the monitor comfortably at eye level. I can speak much softer now to almost a whisper which is especially helpful for passwords and just to conserve energy. As expected, this has also improved when there is background noise such as a fan running. I think this is what has helped the most so far but I think I have also fixed a callback failure error by just bringing back the alsa configuration file at /etc/asound.conf with simply the following:
defaults.pcm.card 1
defaults.ctl.card 1
This still may not be the best way to do it but it seems to be helping so far.
Details
Message ID
<CSEJ6KEILJPD.1OG7H4HM7LTFO@d>
In-Reply-To
<lMU5NoudsZVCG-naYyhnkkAqwF5sVOB-xdHCxfanODCkX_D4Th7B5KotCjpCazkPod-Xz4Wnr954FYPhaCkrr02bvDgrX0zXFmZwEm7yU_A=@protonmail.com> (view parent)
Sender timestamp
1683312437
DKIM signature
missing
Download raw message
Nice, I'm glad you're down with the changes and finding what's best.

I really don't know my asound stuff. You can always check numen's using the
right microphone/card with --verbose and --list-mics.

Besides the cleanup, the new version has an action that lets you switch
phrases or pause numen.  For example, you can pause and resume numen on the
command line like this:

echo load | numenc; sleep 5; echo load /etc/numen/phrases/*.phrases | numenc

The phrases for erasing and going to the start of the transcription (now
"ditch" and "trudge") no longer get messed up if you type keys while they're
going.
Details
Message ID
<u8AFmFhSm-89-9QsV1LaZeRRx0FGtQ1M4a2elZjW0NjlmInitTQB8V4EIyKweIP3do_eZHrnth4a7NFJ_a18SVpcfyQuMtK2Ib4cLQUw7tw=@protonmail.com>
In-Reply-To
<CSEJ6KEILJPD.1OG7H4HM7LTFO@d> (view parent)
Sender timestamp
1683391900
DKIM signature
missing
Download raw message
`numen --verbose` tells me my microphone is the default so I don't think there's anything wrong there. I imagine that is the same default that comes up in alsamixer which is the Nano. And that is expected with what I have in /etc/asound.conf. 

It has been difficult to diagnose. For example, things have been working well if not better than ever recently until later in the day on Thursday. Then just everything hit the fan and random actions were being performed that aren't anything like what I said, I had to suddenly speak much louder for commands to register, and sometimes nothing would happen no matter how loud and clear I would speak the commands. Changing the mic gain in pavucontrol and alsamixer didn't help or very little. It was so bad that I ended up just typing the rest of the day. I closed the terminal session and pavucontrol and put the computer into sleep mode overnight. After waking the computer from sleep the next day (Friday) everything was back to normal and working great. Everything is still working great so far today (Saturday). Before reinstalling Ubuntu and my home directory it was messing up almost as bad and similarly to Thursday and stuck around for the most part but some days or half days seemed to be better. 

My computer isn't using that much memory so I don't think that's the issue either. `htop` tells me I'm using roughly 3 GB out of 16 GB total. And that is probably more than I usually use. I shut down my computer most nights too.

I haven't been using tiles for approximately a month now just to potentially help narrow down the issue.

Could you give me an example of a real world application for pausing and resuming numen like that. I read about numenc in the manual some time back but was unsure of when I may want to use it. I would assume most often in an alias, function or script but not sure of the applications.
Details
Message ID
<CSFXW2AY3AH1.1COCP5IF2JYDJ@d>
In-Reply-To
<u8AFmFhSm-89-9QsV1LaZeRRx0FGtQ1M4a2elZjW0NjlmInitTQB8V4EIyKweIP3do_eZHrnth4a7NFJ_a18SVpcfyQuMtK2Ib4cLQUw7tw=@protonmail.com> (view parent)
Sender timestamp
1683455491
DKIM signature
missing
Download raw message
You can compare --verbose with --list-mics.

I get:

    Microphone: sysdefault:CARD=Microphone

and can see:

    ...
    sysdefault:CARD=Microphone
        Yeti Stereo Microphone, USB Audio
        Default Audio Device
    ...

You can also just mute your good microphone and if you can still do stuff,
it must be using the wrong microphone.

It does sound like it was using the wrong microphone when it was bad.  I'd say
most likely because numen started when your good microphone was unplugged.
I would start numen with --mic set explicitly so it just bails if your good
microphone is unavailable, instead of it using another microphone.

numenc just lets you run actions programmatically rather than when a phrase
is said.  For example, you could have a keybinding or menu to pause/resume
numen. Don't worry about it, I don't use it for anything special.
Details
Message ID
<ep6TamuIXnpaIoOrUVwEtDvX2Hy7_2KN0lP6lLWIdIDQ6naklhrjjB_HEZtQn0ml-fBzA3l6-g5ZbvnnYgH--XX8YTQoXWn9Qmf4BxJE6vo=@protonmail.com>
In-Reply-To
<CSFXW2AY3AH1.1COCP5IF2JYDJ@d> (view parent)
Sender timestamp
1683475750
DKIM signature
missing
Download raw message
I have all other mics muted in pavucontrol and alsamixer so I don't think that's the issue.

Everything continued to work great yesterday and still is today.

`numen --verbose` gives:
Model: /usr/local/share/vosk-models/small-en-us
Pipe: /tmp/numen_pipe
Microphone: default

`numen --list-mics` outputs:
PCH
    HDA Intel PCH, ALC269VC Analog
Nano
    Yeti Nano, USB Audio

`numen --mic=Nano` outputs:
ALSA lib pcm_dsnoop.c:601:(snd_pcm_dsnoop_open) unable to open slave
arecord: main:831: audio open error: Device or resource busy
panic: audio must be the WAV format and mono

goroutine 1 [running]:
main.inspectAudio({0x533248?, 0xc000010010})
	/home/$USER/numen/speech.go:96 +0x165
main.main()
	/home/$USER/numen/speech.go:207 +0x21c


It may be worth noting that ever since I've been using the nano with numen, the dial on the microphone is flashing yellow. This hasn't impacted performance as far as I can tell. The only time the dial is a solid green, as far as I know, is if I follow these steps in order:
1. terminate numen (if it is running) 
2. unplug and plugin the microphone again and open pavucontrol (this is the only step where it doesn't matter which I do first)
3. start numen

Gotcha, I'm sure it has its applications I just haven't come across them yet. I use an alias to toggle my microphone and I may make a key binding for it eventually.
Details
Message ID
<CSGABH5KYH3I.SYQB8E5DSR8O@d>
In-Reply-To
<ep6TamuIXnpaIoOrUVwEtDvX2Hy7_2KN0lP6lLWIdIDQ6naklhrjjB_HEZtQn0ml-fBzA3l6-g5ZbvnnYgH--XX8YTQoXWn9Qmf4BxJE6vo=@protonmail.com> (view parent)
Sender timestamp
1683490552
DKIM signature
missing
Download raw message
Speedy email but try again after updating to at least commit:
6306cbd0a9cd8c21df3f9b3d7fe76d7ee22dab56
(which is before the overhaul but fix should fix --mic for you)

git fetch
git merge --ff-only 6306cbd0a9cd8c21df3f9b3d7fe76d7ee22dab56
sudo ./install-numen.sh
Details
Message ID
<LNdtom-jk3bIKp2hfQb7n5fQiehgpK10zBxkHicgkPCinBRthPZLh7tnheew89M5_gYpJ4Tf80G_X0PiVMvpgZUAOhee7w_Gb775z-vS9oI=@protonmail.com>
In-Reply-To
<CSGABH5KYH3I.SYQB8E5DSR8O@d> (view parent)
Sender timestamp
1683566743
DKIM signature
missing
Download raw message
`numen --mic=Nano` now outputs the same except for the first two lines:

ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM Nano
arecord: main:831: audio open error: No such file or directory
panic: audio must be the WAV format and mono

goroutine 1 [running]:
main.inspectAudio({0x533248?, 0xc000010010})
	/home/$USER/numen/speech.go:96 +0x165
main.main()
	/home/$USER/numen/speech.go:207 +0x21c


`numen --mic=sysdefault:CARD=Nano` outputs:

ALSA lib pcm_dsnoop.c:601:(snd_pcm_dsnoop_open) unable to open slave
arecord: main:831: audio open error: Device or resource busy
panic: audio must be the WAV format and mono

goroutine 1 [running]:
main.inspectAudio({0x533248?, 0xc000010010})
	/home/$USER/numen/speech.go:96 +0x165
main.main()
	/home/$USER/numen/speech.go:207 +0x21c


`numen --mic=sysdefault` outputs:

ALSA lib pcm_dsnoop.c:601:(snd_pcm_dsnoop_open) unable to open slave
arecord: main:831: audio open error: Device or resource busy
panic: audio must be the WAV format and mono

goroutine 1 [running]:
main.inspectAudio({0x533248?, 0xc000124000})
	/home/$USER/numen/speech.go:96 +0x165
main.main()
	/home/$USER/numen/speech.go:207 +0x21c


`numen --list-mics` now outputs much more:

null
    Discard all samples (playback) or generate zero samples (capture)
default
    Playback/recording through the PulseAudio sound server
sysdefault
    Default Audio Device
samplerate
    Rate Converter Plugin Using Samplerate Library
speexrate
    Rate Converter Plugin Using Speex Resampler
jack
    JACK Audio Connection Kit
oss
    Open Sound System
pulse
    PulseAudio Sound Server
upmix
    Plugin for channel upmix (4,6,8)
vdownmix
    Plugin for channel downmix (stereo) with a simple spacialization
hw:CARD=PCH,DEV=0
    HDA Intel PCH, ALC269VC Analog
    Direct hardware device without any conversions
plughw:CARD=PCH,DEV=0
    HDA Intel PCH, ALC269VC Analog
    Hardware device with all software conversions
sysdefault:CARD=PCH
    HDA Intel PCH, ALC269VC Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC269VC Analog
    Front output / input
dsnoop:CARD=PCH,DEV=0
    HDA Intel PCH, ALC269VC Analog
    Direct sample snooping device
usbstream:CARD=PCH
    HDA Intel PCH
    USB Stream Output
hw:CARD=Nano,DEV=0
    Yeti Nano, USB Audio
    Direct hardware device without any conversions
plughw:CARD=Nano,DEV=0
    Yeti Nano, USB Audio
    Hardware device with all software conversions
sysdefault:CARD=Nano
    Yeti Nano, USB Audio
    Default Audio Device
front:CARD=Nano,DEV=0
    Yeti Nano, USB Audio
    Front output / input
dsnoop:CARD=Nano,DEV=0
    Yeti Nano, USB Audio
    Direct sample snooping device
usbstream:CARD=Nano
    Yeti Nano
    USB Stream Output


`numen --verbose` outputs the same as before updating to the commit you mentioned:

Model: /usr/local/share/vosk-models/small-en-us
Pipe: /tmp/numen_pipe
Microphone: default


Maybe we're getting somewhere :)
Details
Message ID
<CSH56ALQFIG0.2AIH954VUJMDL@d>
In-Reply-To
<LNdtom-jk3bIKp2hfQb7n5fQiehgpK10zBxkHicgkPCinBRthPZLh7tnheew89M5_gYpJ4Tf80G_X0PiVMvpgZUAOhee7w_Gb775z-vS9oI=@protonmail.com> (view parent)
Sender timestamp
1683577600
DKIM signature
missing
Download raw message
Ah nice, try:

	numen --mic=sysdefault:CARD=Nano
Details
Message ID
<yPPT62tnZ3Q_-D_0sW_Fm3N2J2cu9PcsDqqqWXa0qs8sh6u8jyQ42rjOH8a2s3kg7OFYKuwGEsBgTXA-Sb9twabptnYx_eZiiw_0bXG9yVM=@protonmail.com>
In-Reply-To
<CSH56ALQFIG0.2AIH954VUJMDL@d> (view parent)
Sender timestamp
1683581902
DKIM signature
missing
Download raw message
`numen --mic=sysdefault:CARD=Nano` outputs:

ALSA lib pcm_dsnoop.c:601:(snd_pcm_dsnoop_open) unable to open slave
arecord: main:831: audio open error: Device or resource busy
panic: audio must be the WAV format and mono

goroutine 1 [running]:
main.inspectAudio({0x533248?, 0xc000010010})
	/home/$USER/numen/speech.go:96 +0x165
main.main()
	/home/$USER/numen/speech.go:207 +0x21c


Any ideas?
Details
Message ID
<CSHLFNHCPE71.125YXYDJD471O@d>
In-Reply-To
<yPPT62tnZ3Q_-D_0sW_Fm3N2J2cu9PcsDqqqWXa0qs8sh6u8jyQ42rjOH8a2s3kg7OFYKuwGEsBgTXA-Sb9twabptnYx_eZiiw_0bXG9yVM=@protonmail.com> (view parent)
Sender timestamp
1683623471
DKIM signature
missing
Download raw message
Deary me, that's the one that would have worked for me, but I don't use
PulseAudio/PipeWire.

I'm most hopeful for:

plughw:CARD=Nano,DEV=0

but failing that I'd just try all the ones that mention Nano.  Numen uses
arecord internally and --mic is just like arecord's -D and --list-mics is
just like arecord -L.

arecord -D blah:CARD=blah -f S16_LE -c 1 -r 16000 > me.wav
Details
Message ID
<ADUCqR4H72CI1jTPvOhVK3a_-RxYmJBga4tw_RA5HJzX00z69A8fS5_DWbss9pnERhbIi4P1OKqWaqTsh_30-kw-XXTjY3Drauk4LHpv7iM=@protonmail.com>
In-Reply-To
<CSHLFNHCPE71.125YXYDJD471O@d> (view parent)
Sender timestamp
1683730591
DKIM signature
missing
Download raw message
Hey John, that mic appears to be working so far. If I encounter audio problems again I'll probably just try the others that mention Nano like you said or look into that Alsa error some more. Thanks for your help :)
Reply to thread Export thread (mbox)