Audacity won't play or record

Asked by Rossco

I have used audacity a lot in Gutsy Gibbon, but since doing a fresh install with Hardy Heron audacity seems to do everything accept play or record. I have the same window come up every time, "Error while opening sound device. Please check the input device settings and the project sample rate." or "Error while opening sound device. Please check the output device settings and the project sample rate." I've tried changing both bit rates and devices, but nothing is happening. Is their something not happening with Hardy Heron, am I missing something or am I just a nood! please help.

Thanks
Rossco

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu audacity Edit question
Assignee:
No assignee Edit question
Solved by:
Stephen Irons
Solved:
Last query:
Last reply:
Revision history for this message
Isak Frants (isakfrants) said :
#1

Edit-->Preferences-->Audio IN/Out
Change devices from OSS to perhaps Alsa:default or something.

Revision history for this message
Rossco (wudgulah) said :
#2

I have spent some time changing the devices in both input and output, OSS, ALSA, Jack, nothing seems to work

Revision history for this message
Isak Frants (isakfrants) said :
#3

Perhaps you can try changing your overall sound system to ALSA, and then try ALSA once more in Audacity. (Hardy Heron have PulseAudio as default. Maybe there are conflicts.)
System-->Settings-->Audio. Change to ALSA and see how Audacity with ALSA does.

Revision history for this message
Rossco (wudgulah) said :
#4

I have experimented changing all the settings both in the system and in audacity. I've tried running the Jack Control sever and then audacity at the same time, and then I just happen to have a go at audacity coincidently while playing Rhythmbox Music Player and it worked in both recording and playing. The settings are all on ALSA in the system and ALSA:default on both input and output in audacity. As long as Rhythmbox is playing when I start audacity everything seems to work, I can exit Rhythmbox after audacity is opened and everything still keeps working great. Is this able to be fixed, or am I going to have to run Rhythmbox every time I want to use audacity?

Revision history for this message
Isak Frants (isakfrants) said :
#5

Hm. Strange. Sounds like a bug or something.

I can use Audacity with no problem. I've selected ALSA on all my devices in system sound, and also ALSA-mixer as mixer.
In Audacity I have quality 44100Hz and 32-bit float. As devices I have ALSA:default on both. It says under Playback "Using: Portaudio v19" and under Recording I have 2 channels.

Have you got these settings aswell?

Revision history for this message
Rossco (wudgulah) said :
#6

I don't have anything called ALSA-mixer on its own. What I have is under Default Mixer Tracks -- Device: -- VIA 8233A (alsa mixer).
The other devices are:
Sigmatel STAC 9721,23 (OSS mixer);
Playback: ALSA PCM on front:0 (VIA 8233A);
Capture: Monitor Source of ALSA PCM on front:0 (VIA 8... ;
Capture: ALSA PCM on front:0 (VIA 8233A) VIA DMA (P...
Everything else is the same.
does it look like I'm missing something?

Revision history for this message
Isak Frants (isakfrants) said :
#7

Hm mine looks like this:
http://img355.imageshack.us/img355/1413/skrmbildljudinstllningaye6.png

I have the same options as you, except for Ali M5455 audio codec instead of Via. And Realtek instead of Sigmatel.
So no, there are nothing called Alsa-mixer on its own.

Why oh why is it only working when you have Rhytmhbox running? Hmm...

I hope you get this solved, perhaps you could file a bug about this. I'm going to the army tomorrow and wont have internet for a couple of weeks. Good luck!

Revision history for this message
Best Stephen Irons (stephen-irons) said :
#8

Audacity supports lots of different sound drivers: OSS, ALSA and in the new version, also JACK. When Audacity starts up, it automatically starts jackd, the JACK daemon with a bunch of standard settings: 48000 samples per second using the default ALSA sound device.

So JACK has grabbed the sound device, meaning that neither ALSA nor OSS can use it.

The further problem is that JACK can ONLY work at its configured sample rate, so if your Audacity project is anything other than 48000, it will not play.

So you have a few options:

1. Change the Audacity project sample rate to the JACK sample rate (default 48000)
2. Change the JACK sample rate to match your Audacity project rate
3. Disable JACK and use ALSA or OSS for audio input and output.

1. is easy

To change the JACK configuration, you need to have a file /etc/jackdrc (a system wide setting that overrides the jackd built in settings) or ~/.jackdrc (a per-user setting that overrides the built-in defaults and /etc/jackdrc).

To change the JACK sample rate, create a file called /etc/jackdrc or ~/.jackdrc containing the one line:

/usr/bin/jackd -R -T -d alsa -d hw:0 -r 48000 -p 128 -n 3

The number following the -r sets the sample rate.

You can read more about this by typing 'man jackd' at a terminal.

There are two ways to disable jackd: you can either prevent jackd from starting at all, or you can make jackd use a dummy sound card.

To prevent jackd from starting, ensure that /etc/jackdrc or ~/.jackdrc contains an illegal command: my jackdrc contains the line:
#/usr/bin/jackd -R -T -d alsa -d hw:0 -r 48000 -p 128 -n 3

Then, in Audacity you will have access to all your ALSA and OSS sound devices, and there will be no JACK device.

To make jackd using a dummy sound card, /etc/jackdrc or ~/.jackdrc should contain the line:
/usr/bin/jackd -T -d dummy -C 2 -P 2 -r 48000 -p 128

This makes JACK pretend to have a sound card with two inputs (-C 2) and two outputs (-P 2) running at 48000 samples per second.

Then in Audacity you will have access to all your ALSA and OSS sound devices, and there will be a JACK device. It will be set to 48000 samples per second and, if your Audacity project sample rate matches this, then you can play and record from this device. Of course, you will not actually hear anything...

Revision history for this message
Rossco (wudgulah) said :
#9

Thanks Stephen Irons, that solved my question.

Revision history for this message
Rossco (wudgulah) said :
#10

The explanation was great, just what I needed.
I just quit the Jack Control in the end, and everything works great now.
Thanks again.

Revision history for this message
Omar S. Hafez (omar-the-pythoner) said :
#11

I don't even have Jack Control anywhere in my system.. -_-

Revision history for this message
Omar S. Hafez (omar-the-pythoner) said :
#12

I don't even have Jack Control anywhere in my system.. -_-

Revision history for this message
Alisonnos (alisonnos) said :
#13

I have the same problem and no Jack Control also. I am running Audacity on Vista. This is a new computer. Is this part of the problem?

Revision history for this message
David Henningsson (diwic) said :
#14

Omar and Alisonnos, have you tried Isak's initial suggestions about changing Edit-->Preferences-->Audio IN/Out ? Which versions of Ubuntu/Audactiy are you using?