Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 May 2011 00:35:21 +0200
From:      Torfinn Ingolfsen <torfinn.ingolfsen@broadpark.no>
To:        freebsd-multimedia@FreeBSD.org
Subject:   Audacity tries playback on wrong device while recording
Message-ID:  <20110521003521.10336c7e.torfinn.ingolfsen@broadpark.no>

next in thread | raw e-mail | index | archive | help
Hello,

(This is also logged in the audacity forum, in this thread[1])
I am using Audacity 1.3.13 (ports: audacity-devel) under FreeBSD 8.2-stable. I have also tried Audacity 1.3.12 and Auacity 1.2.4b_9 (ports: audacity), and all versions exhibit the same problem. FreeBSD version:
root@kg-quiet# uname -a
FreeBSD kg-quiet.kg4.no 8.2-STABLE FreeBSD 8.2-STABLE #0: Sun Apr  3 19:49:05 CEST 2011     root@kg-quiet.kg4.no:/usr/obj/usr/src/sys/GENERIC  amd64

The sound setup setup is like this: I have an internal sound card, which is used for playback, and a usb device (like this one[2]), which is used for recording, it looks like this:
root@kg-quiet# cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
Installed devices:
pcm0: <ATI IXP 400> at memory 0xfe029000 irq 17 kld snd_atiixp (1p:2v/1r:1v) default
pcm1: <USB audio> at ? kld snd_uaudio (1p:1v/1r:1v)

pcm0 (shown as "/dev/dsp" in Audacity preferences, devices) is the internal sound card, used for playback
pcm1 (shown as "/dev/dsp1: Line" in Audacity preferences, devices) is the usb sound device, used for recording
First of all; Audacity and this setup works, I can record, and I can playback sound afterwards. There is just one small problem; during recording, there is no sound. Yes, Software Playthrough is enabled.
A bit of debugging shows this (done while Audacity was recording)
root@kg-quiet# sysctl hw.snd.verbose=2
hw.snd.verbose: 1 -> 2
root@kg-quiet# cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
Installed devices:
pcm0: <ATI IXP 400> at memory 0xfe029000 irq 17 kld snd_atiixp (1p:2v/1r:1v) default
   snddev flags=0x2e2<AUTOVCHAN,BUSY,MPSAFE,REGISTERED,VPC>
   [pcm0:play:dsp0.p0]: spd 48000, fmt 0x00200010, flags 0x00002100, 0x00000004
   interrupts 1115, underruns 0, feed 1115, ready 0 [b:4096/2048/2|bs:4096/2048/2]
   channel flags=0x2100<BUSY,HAS_VCHAN>
   {userland} -> feeder_mixer(0x00200010) -> {hardware}
   pcm0:play:dsp0.p0[pcm0:virtual:dsp0.vp0]: spd 44100/48000, fmt 0x00200010, flags 0x10000000, 0x00000029
   interrupts 0, underruns 0, feed 0, ready 0 [b:0/0/0|bs:65536/2048/32]
   channel flags=0x10000000<VIRTUAL>
   {userland} -> feeder_root(0x00200010) -> feeder_volume(0x00200010) -> feeder_rate(0x00200010 q:1 44100 -> 48000) -> {hardware}
   pcm0:play:dsp0.p0[pcm0:virtual:dsp0.vp1]: spd 44100/48000, fmt 0x00200010, flags 0x10000000, 0x00000029
   interrupts 0, underruns 0, feed 0, ready 0 [b:0/0/0|bs:65536/2048/32]
   channel flags=0x10000000<VIRTUAL>
   {userland} -> feeder_root(0x00200010) -> feeder_volume(0x00200010) -> feeder_rate(0x00200010 q:1 44100 -> 48000) -> {hardware}
   [pcm0:record:dsp0.r0]: spd 48000, fmt 0x00200010, flags 0x00002100, 0x00000005
   interrupts 0, overruns 0, feed 0, hfree 4096, sfree 4096 [b:4096/2048/2|bs:4096/2048/2]
   channel flags=0x2100<BUSY,HAS_VCHAN>
   {hardware} -> feeder_root(0x00200010) -> feeder_mixer(0x00200010) -> {userland}
   pcm0:record:dsp0.r0[pcm0:virtual:dsp0.vr0]: spd 44100/48000, fmt 0x00100010/0x00200010, flags 0x10000000, 0x00000069
   interrupts 0, overruns 0, feed 0, hfree 0, sfree 32768 [b:0/0/0|bs:32768/1024/32]
   channel flags=0x10000000<VIRTUAL>
   {hardware} -> feeder_root(0x00200010) -> feeder_matrix(2.0 -> 1.0) -> feeder_volume(0x00100010) -> feeder_rate(0x00100010 q:1 48000 -> 44100) -> {userland}
pcm1: <USB audio> at ? kld snd_uaudio (1p:1v/1r:1v)
   snddev flags=0x2e6<AUTOVCHAN,SOFTPCMVOL,BUSY,MPSAFE,REGISTERED,VPC>
   [pcm1:play:dsp1.p0]: spd 48000, fmt 0x00200010, flags 0x00002108, 0x00000004
   interrupts 910, underruns 0, feed 909, ready 0 [b:3072/1536/2|bs:4096/2048/2]
   channel flags=0x2108<TRIGGERED,BUSY,HAS_VCHAN>
   {userland} -> feeder_mixer(0x00200010) -> {hardware}
   pcm1:play:dsp1.p0[pcm1:virtual:dsp1.vp0]: spd 44100/48000, fmt 0x00200010, flags 0x1000114c, 0x00000029, pid 58968 (audacity)
   interrupts 0, underruns 33, feed 987, ready 2012 [b:0/0/0|bs:2048/512/4]
   channel flags=0x1000114c<RUNNING,TRIGGERED,NBIO,BUSY,HAS_SIZE,VIRTUAL>
   {userland} -> feeder_root(0x00200010) -> feeder_volume(0x00200010) -> feeder_rate(0x00200010 q:1 44100 -> 48000) -> {hardware}
   [pcm1:record:dsp1.r0]: spd 48000, fmt 0x00200010, flags 0x00002108, 0x00000005
   interrupts 910, overruns 0, feed 1820, hfree 3072, sfree 4095 [b:3072/1536/2|bs:4096/2048/2]
   channel flags=0x2108<TRIGGERED,BUSY,HAS_VCHAN>
   {hardware} -> feeder_root(0x00200010) -> feeder_mixer(0x00200010) -> {userland}
   pcm1:record:dsp1.r0[pcm1:virtual:dsp1.vr0]: spd 44100/48000, fmt 0x00200010, flags 0x1000115c, 0x00000029, pid 58968 (audacity)
   interrupts 0, overruns 9, feed 2719, hfree 0, sfree 2012 [b:0/0/0|bs:2048/512/4]
   channel flags=0x1000115c<RUNNING,TRIGGERED,NOTRIGGER,NBIO,BUSY,HAS_SIZE,VIRTUAL>
   {hardware} -> feeder_root(0x00200010) -> feeder_rate(0x00200010 q:1 48000 -> 44100) -> feeder_volume(0x00200010) -> {userland}

Audacity tries to playback on pcm1 instead of pcm0, and that can't be right. Note again: this doesn't affect the recording, Audacity actually records fine.
And afterwards, playback works fine too. It's just that there is no sound while recording.

If anyone of you have two sound devices in your FreeBSD machine, and at least one of them can record, would you be kind enough to try this:
- use Audacity
- set one device for record
- set the other device for playback
- make sure that record and playback works in Audacity
- enable software playthrough
- do you have sound while recording?
- report  in this thread ifd it works or not?

References:
1) http://forum.audacityteam.org/viewtopic.php?f=18&t=56170
2) http://www.amazon.co.uk/FUTURISTIX-CASSETTE-MP3-CONVERTER-POWERED/dp/B003OSVQFS/ref=sr_1_2?ie=UTF8&qid=1304779903&sr=8-2
-- 
Torfinn




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110521003521.10336c7e.torfinn.ingolfsen>