Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jan 2006 03:54:56 -0500
From:      "Michael W. Oliver" <michael@gargantuan.com>
To:        multimedia@freebsd.org
Subject:   cwpcm straight to dsp is way fast
Message-ID:  <200601150355.02939.michael@gargantuan.com>

next in thread | raw e-mail | index | archive | help
--nextPart16327788.L8tj6OXlRF
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hey guys,

I am using cwpcm to generate morse, and when using this:

  echo "sos sos sos" | cwpcm -w 20 -F 24 -f 800 | sox -r 8000 -bu -t raw - =
sos.wav lowpass 1500

I get a wav file that sounds perfect.  However, when using this:

  echo "sos sos sos" | cwpcm -w 20 -F 24 -f 800 >/dev/dsp
    -or-
  echo "sos sos sos" | cwpcm -w 20 -F 24 -f 800 >sos.raw && cat sos.raw >/d=
ev/dsp

I get horrible noise from speakers.  I am _guessing_ that it has something
to do with the rate at which dsp is processing that raw data, but I don't
know how to fix it so that I can just play the code without creating the
wav file.


Those two files are here...

http://michael.gargantuan.com/sos.wav
http://michael.gargantuan.com/sos.raw


I am using...
=2D-----------------------------------------------------
$ cat /dev/sndstat
=46reeBSD Audio Driver (newpcm)
Installed devices:
pcm0: <VIA VT8235> at io 0x1400 irq 22 kld snd_via8233 (5p/1r/8v channels d=
uplex default)


on...
=2D-----------------------------------------------------
$ uname -a
=46reeBSD gambit.gargantuan.com 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Tue
Jan 10 11:38:19 EST 2006
mwoliver@gambit.gargantuan.com:/usr/obj/usr/src/sys/GAMBIT  i386


and some sysctl stuff...
=2D-----------------------------------------------------
$ sysctl -a | grep pcm
pcm0: <VIA VT8235> port 0x1400-0x14ff irq 22 at device 17.5 on pci0
pcm0: Reserved 0x100 bytes for rid 0x10 type 4 at 0x1400
pcm0: [MPSAFE]
pcm0: <Avance Logic ALC650 AC97 Codec (id =3D 0x414c4720)>
pcm0: Codec features 20 bit DAC, 18 bit ADC, 5 bit master volume, Realtek 3=
D Stereo Enhancement
pcm0: Primary codec extended features variable rate PCM, double rate PCM, r=
eserved 1, center DAC, surround DAC, LFE DAC, reserved 4
pcm0: ac97 codec dac ready count: 0
pcm0: sndbuf_setmap 3e3fa000, 1000; 0xc51a6000 -> 3e3fa000
pcm0: sndbuf_setmap 3e4bf000, 1000; 0xc51cb000 -> 3e4bf000
pcm0: sndbuf_setmap 3e27d000, 1000; 0xc51c9000 -> 3e27d000
pcm0: sndbuf_setmap 3dedb000, 1000; 0xc51c7000 -> 3dedb000
pcm0: sndbuf_setmap 3e319000, 1000; 0xc51c5000 -> 3e319000
pcm0: sndbuf_setmap 3dff7000, 1000; 0xc51c3000 -> 3dff7000
pcm0: <VIA DXS Enabled: DXS 4 / SGD 1 / REC 1>
<118>hw.snd.pcm0.vchans:
Danger! pcm0:play:1 bufsoft size increasing from 2048 to 4096 after CHANNEL=
_SETBLOCKSIZE()
Danger! pcm0:play:1 bufsoft size increasing from 2048 to 4096 after CHANNEL=
_SETBLOCKSIZE()
hw.snd.pcm0.buffersize: 4096
hw.snd.pcm0.vchans: 8
hw.snd.pcm0.vchanrate: 48000
hw.snd.pcm0.spdif_enabled: 0
hw.snd.pcm0.via_dxs_src: 0
dev.pcm.0.%desc: VIA VT8235
dev.pcm.0.%driver: pcm
dev.pcm.0.%location: slot=3D17 function=3D5 handle=3D\_SB_.PCI0.AU97
dev.pcm.0.%pnpinfo: vendor=3D0x1106 device=3D0x3059 subvendor=3D0x1558 subd=
evice=3D0x4701 class=3D0x040100
dev.pcm.0.%parent: pci0


and the driver is kldloaded...
=2D-----------------------------------------------------
$ kldstat
Id Refs Address    Size     Name
 1   26 0xc0400000 839068   kernel
 2    2 0xc0c3a000 25be8    sound.ko
 3    1 0xc0c60000 6948     snd_via8233.ko
 4    1 0xc0c67000 80f0     ng_ubt.ko
 5    6 0xc0c70000 daa0     netgraph.ko
 6    1 0xc0c7e000 1e658    radeon.ko
 7    2 0xc0c9d000 10c44    drm.ko
 8    1 0xc0cae000 943c     cpufreq.ko
 9    1 0xc0cb8000 61b60    acpi.ko
10    1 0xc5423000 6000     linprocfs.ko
11    1 0xc542e000 19000    linux.ko
12    4 0xc566d000 2000     ng_bluetooth.ko
13    1 0xc5687000 d000     ng_hci.ko
14    1 0xc5694000 10000    ng_l2cap.ko
15    1 0xc56a4000 18000    ng_btsocket.ko
16    1 0xc56c7000 4000     ng_socket.ko



Thanks very much for your help!

=2D-=20
Mike Oliver
[see complete headers for contact information]

--nextPart16327788.L8tj6OXlRF
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (FreeBSD)

iD8DBQBDyg3msWv7q8X6o8kRArGJAJ0eBRO93uQ7uq1DszI8N34OPQ9m+wCgvxq3
me+6qENB9MbjAb8lPMI0meY=
=VhWR
-----END PGP SIGNATURE-----

--nextPart16327788.L8tj6OXlRF--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601150355.02939.michael>