VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Pages: 1 [2]

Author Topic: External Microphone (Audacity)  (Read 18800 times)

wcs

  • Packager
  • Vectorian
  • ****
  • Posts: 1144
Re: External Microphone (Audacity)
« Reply #15 on: April 18, 2008, 05:33:32 pm »

No luck for me with audacity either, with several different settings. I cannot even get playback with OSS or with ALSA (Default).
This problem happens with both the repo package, and the one from slacky that dweeberkitty linked.

Here's the output when trying to play something:
Code: [Select]
Expression 'ret' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1034
Expression 'AlsaOpen( hostApi, parameters, streamDir, &pcm )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1066
Expression 'ret' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1034
Expression 'AlsaOpen( hostApi, parameters, streamDir, &pcm )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1066
Expression 'ret' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1034
Expression 'AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir, &self->pcm )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1191
Expression 'PaAlsaStreamComponent_Initialize( &self->playback, alsaApi, outParams, StreamDirection_Out, NULL != callback )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1411
Expression 'PaAlsaStream_Initialize( stream, alsaHostApi, inputParameters, outputParameters, sampleRate, framesPerBuffer, callback, streamFlags, userData )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1983

It seems something is wrong between this version of audacity and something sound-related in VL.

I tried compiling the previous stable version, but that one only compiles with wxGTK 2.4.... I don't know if installing that might screw up something that needs the newer version of wxGTK in the repos.

Any ideas?
Thank you!
Logged

wcs

  • Packager
  • Vectorian
  • ****
  • Posts: 1144
Re: External Microphone (Audacity)
« Reply #16 on: April 18, 2008, 05:39:39 pm »

Quote
Well I've looked around on the web since I first posted; and it seems the next step up from  the cheapo talk to your buddies while you play counterstrike mic is in the hundred dollar range. This in turn requires a several hundred dollar hardware interface with your computer. Not what I had in mind for surprise recording for his mother of my son and his teacher playing a duet.

I guess it's tough to actually make a home recording sound any good  (unless you have good hardware). My only experience was with Audacity recording speech. This was supposed to be a "good" recording, as the files were materials to be used in a psychology experiment. I bought a more or less ok Shure microphone for voice and plugged that directly in the laptop line-in. Then with Audacity I amplified it, applied the "noise reduction" filter, found the silence bits, and cut it.

It wasn't that bad, but it still sounded crap. It it was music, it would've sounded even worse, I guess...
Logged

wcs

  • Packager
  • Vectorian
  • ****
  • Posts: 1144
Re: External Microphone (Audacity)
« Reply #17 on: October 16, 2008, 02:37:40 pm »

Ok, I seem to have fixed it.
Several people were having the same problem with audacity, also with different distros as described here:
http://audacityteam.org/forum/viewtopic.php?f=18&t=128&st=0&sk=t&sd=a

I don't know why it's affecting some people but not others.

The problem is actually related to jack. Audacity starts jack, then whatever the reason is, alsa gets messed up.

The solution in that thread is to kill jackd after audacity starts it.
So i've just made a little script to kill it after starting audacity and changed the audacity desktop file to call the script instead:
Code: [Select]
#!/bin/bash
audacity &
sleep 2
killall jackd

The best solution might actually be to revert the package in the repo to 1.3.2. That thread suggests that version might work.
There's also a new 1.3.5 out that might be better.
Logged

The Headacher

  • Louder than you
  • Global Moderator
  • Vectorian
  • *****
  • Posts: 1553
  • I like the bass to go BOOM!
    • Multimedia on VL (work in progress)
Re: External Microphone (Audacity)
« Reply #18 on: October 17, 2008, 01:19:57 am »

Quote
Audacity starts jack, then whatever the reason is, alsa gets messed up.
Jack takes control of Alsa, that is, it blocks all other programs trying to send audio to alsa, to make sure no other programs mess up your recording (it probably also has to do with performance). Bottomline is: if jack is running, nothing should make a sound unless connected through Jack. So if audacity is trying to record through alsa but jackd is running, it shouldn't get a signal.

Audacity starting jackd without asking is just wrong. Whoever decided that was necessary made a big mistake: If you need Jack, you'll have to start jackd yourself and make sure it gets realtime priority. If you can't do that, using Jack is no good, and you're better off using alsa, oss or whatever. I'm not even sure Audacity could start jackd with realtime priority unless it too was granted realtime priority.
Logged
Most music on my soundcloud page was arranged in programs running on VL.

wcs

  • Packager
  • Vectorian
  • ****
  • Posts: 1144
Re: External Microphone (Audacity)
« Reply #19 on: October 17, 2008, 09:11:19 am »

Thanks for the very clear explanation, headacher.
It actually makes perfect sense then... the problem is just audacity starting jack and not anything in alsa.
Removing jack however, leads to audacity not starting because of a missing lib (at least here, with the repo package).
Logged

mick12345678

  • Vectorite
  • ***
  • Posts: 140
Re: External Microphone (Audacity)
« Reply #20 on: October 17, 2008, 04:16:02 pm »

If I  start a console session and enter
Code: [Select]
audacity &
! now I wait a bit
killall jackd
then it works (sometimes - other times, the 'kill' seems to be ignored  ???. When this happens, if I kill the process by processid then its ok).

I created a text file called "start_audacity" containing 
Code: [Select]
audacity &
sleep 2
killall jackd

If I then start a console session and enter
Code: [Select]
/bin/bash start_audacity

then Audacity starts up and the console session shows
Code: [Select]
jack main caught signal 15
but Jackd is still running (as evidenced by "ps -A") and consequently recording fails.

What am I doing wrong  ???
« Last Edit: October 17, 2008, 04:26:36 pm by mick12345678 »
Logged

wcs

  • Packager
  • Vectorian
  • ****
  • Posts: 1144
Re: External Microphone (Audacity)
« Reply #21 on: October 17, 2008, 05:25:18 pm »

Maybe
Code: [Select]
killall jackd -9
It's a bit tough, but nothing beats a kill dash nine.  :)
Logged

mick12345678

  • Vectorite
  • ***
  • Posts: 140
Re: External Microphone (Audacity)
« Reply #22 on: October 18, 2008, 10:50:45 am »

Thanks - that seems to do it  ;D.

Now, when Audacity is running, I get a zombie process :

Code: [Select]
user:$ ps -ef | grep aud
user      4351     1  7 18:29 ?        00:00:00 audacity
user      4354  4351  0 18:29 ?        00:00:00 [audacity] <defunct>

which is odd, but not really a problem, especially since the zombie process goes away once I exit Audacity. of course.
Logged

wcs

  • Packager
  • Vectorian
  • ****
  • Posts: 1144
Re: External Microphone (Audacity)
« Reply #23 on: October 18, 2008, 11:38:04 am »

I dunno about that one. Perhaps the audacity process that called jackd?

I suppose if it bothered you, you could get the script to kill that one as well....

Maybe get the id of the defunct process and then kill it.

Or the killall command for jackd might have some option to kill the one that called it as well.
(perhaps the -g switch? Then again, that might actually kill everything, the whole of audacity included  :) )

I don't know how to do it, but hey, it's linux. There must be a way.  ;D 
Logged
Pages: 1 [2]