Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Archlinux compilation and/or AUR package #62

Open
LefterisJP opened this issue Jan 18, 2024 · 13 comments
Open

Archlinux compilation and/or AUR package #62

LefterisJP opened this issue Jan 18, 2024 · 13 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@LefterisJP
Copy link

Hey thanks a lot for your work on this awesome package!

I wanted to try and build it under archlinux but the guide does not work due to

   =>   Check Linux build requirements
   ✖︎   No apt-get command found. Please install apt

As archlinux uses pacman I guess some adjustment are needed but I am not very familiar with the best way to do it.

What would be amazing if this was packaged in an AUR package like someone did for your other extension to remove the background: https://github.com/Bitals/obs-backgroundremoval-aur/tree/master

Any help appreciated ❤️

@royshil
Copy link
Collaborator

royshil commented Jan 18, 2024

i will look into this as soon as i can... but it'll take a while since I'm swamped...
join maybe my live stream and we can work on it together?

@royshil royshil added this to the 0.1.0 milestone Jan 18, 2024
@royshil royshil added the enhancement New feature or request label Jan 18, 2024
@deweydbdecibel
Copy link

I absolutely love this idea! I'm using Garuda and fish doesn't like me trying to install this either. I spent hours trying to get brain to work on Garuda and ultimately frustration got the best of me. :P I'll be following this as I do a DJ stream and want to see if it will do captions for my ethnically diverse music selection!

BTW, From what I see on your github, ya'll are doing some amazing work!

@royshil
Copy link
Collaborator

royshil commented Jan 25, 2024

@umireon whats the process of getting an AUR on aur.archlinux.org ?

@umireon
Copy link
Member

umireon commented Jan 25, 2024

@royshil I don't think downloading dependencies by CMake is not permitted on AUR so we need to change the build script to accept tarballs of dependencies first.

Anyway, here is the PKGBUILD script to build the package for pacman.

# Maintainer: Kaito Udagawa <umireon at gmail dot com>
pkgname=obs-localvocal

pkgver=0.1.0
pkgrel=1
pkgdesc='OBS plugin for local speech recognition and captioning using AI'
_source="${pkgname}-${pkgver}"

arch=(x86_64)
url='https://github.com/occ-ai/obs-localvocal'
license=('GPL2')
depends=('obs-studio' 'curl')
makedepends=('cmake' 'ninja')
source=("${_source}.tar.gz::$url/archive/refs/tags/${pkgver}.tar.gz")
sha256sums=('90b7321f2cc7e04854d05e97e9f9c6dcac7856923cc4465f0656049e110c6317')

build() {
  cd "$_source"
  cmake -B build --preset linux-x86_64 -DUSE_SYSTEM_CURL=ON
  cmake --build build
}

package() {
  cd "$_source"
  cmake --install build --prefix "$pkgdir/usr"
}

Gist: https://gist.github.com/umireon/eb83c2bd0657931345a3382bfbc4caed

And here are the instructions to build our plugin on Arch Linux

sudo pacman -Syu base-devel git
git clone https://gist.github.com/eb83c2bd0657931345a3382bfbc4caed.git obs-localvocal
makepkg -s
sudo pacman -U obs-localvocal-0.1.0-1-x86_64.pkg.tar.zst

Disclaimer: I haven't checked if this plugin works on OBS built in this way.

@LefterisJP
Copy link
Author

So found some time to play with it.

Just by making the package manually with the PKGBUILD and .SRCINFO provided by @umireon it seems to succesfully build. For some reason ninja was not pulled as a build dependency but I manually installed it and it seems to have worked.

Now I have never used this plugin before so tried to use it but I am either doing something wrong or it's not properly installed.

2024-02-05_12-57

As per the tutorial, I put it as a filter in the audio source and connected it to a text/subs element. But nothing appears there or in the logs.

@royshil
Copy link
Collaborator

royshil commented Feb 6, 2024

@LefterisJP you get in the log "skipping inference" which means it can't hear any sound to process so it skips the Whisper inference

@LefterisJP
Copy link
Author

@LefterisJP you get in the log "skipping inference" which means it can't hear any sound to process so it skips the Whisper inference

yeah works now. Needed to speak louder and wait for quite some time to see the results. Need to play with the parameters I guess.

But anyway for the purpose of this issue the files to make the AUR package seem to work!

@Lunasciel
Copy link

What is the status of the AUR package? ^^

Tabby added a commit to Tabby/obs-localvocal that referenced this issue May 27, 2024
Largely based on @umireon's [AUR build script](locaal-ai#62 (comment)), these steps worked for me on a
Gentoo Linux system as well, so I figured it might be helpful to add them to
the README.

I feel like some of this could be merged with the Ubuntu section above (which
might also in itself be applicable to Debian as well as Ubuntu), but for now
this should at least help people
royshil pushed a commit that referenced this issue May 31, 2024
Largely based on @umireon's [AUR build script](#62 (comment)), these steps worked for me on a
Gentoo Linux system as well, so I figured it might be helpful to add them to
the README.

I feel like some of this could be merged with the Ubuntu section above (which
might also in itself be applicable to Debian as well as Ubuntu), but for now
this should at least help people
@royshil royshil added the help wanted Extra attention is needed label Jun 25, 2024
@royshil
Copy link
Collaborator

royshil commented Jun 25, 2024

is anyone willing to invest some time to make an AUR pkg?

@umireon
Copy link
Member

umireon commented Jun 25, 2024

We first need to organize dependent libraries to register our plugin to AUR. That's why I have not been tackling this request.

@umireon
Copy link
Member

umireon commented Jun 25, 2024

AUR won't allow the pre-built libraries, so we need to enable our plugin to build with the source of the dependent libraries.
If all the dependent libraries of localvocal can already be provided from their source, I can quickly submit the PKGBUILD to AUR.

@suwagawaki
Copy link

suwagawaki commented Jun 26, 2024

Update: installed ccache and openblas before compiling again, module loaded!

Thank you @umireon for the build script. I was able to compile the latest master as well as 0.3.1, though the plug-in has issues loading.

00:42:37.122: 
00:42:37.126: os_dlopen(/usr//lib/obs-plugins/obs-localvocal.so->/usr//lib/obs-plugins/obs-localvocal.so): /usr//lib/obs-plugins/obs-localvocal.so: undefined symbol: _ZN11ctranslate23cpu10reduce_sumILNS0_6CpuIsaE1EN10half_float4halfEEET0_PKS5_l
00:42:37.126: 
00:42:37.126: Module '/usr//lib/obs-plugins/obs-localvocal.so' not loaded

@royshil
Copy link
Collaborator

royshil commented Jun 26, 2024

@suwagawaki looks like CTranslate2 is missing either as a shared or static library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants