9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] usb audio
@ 2003-02-21 18:02 rog
  2003-02-21 18:02 ` Russ Cox
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: rog @ 2003-02-21 18:02 UTC (permalink / raw)
  To: 9fans

i just got my new xitel hifi-link (on presotto's recommendation), and
hacked madplay so that it sets the speed and number of channels
appropriately to the mp3 file.

only problem is that doing this when the /dev/audio is already open
reliably crashes the kernel.
(first i get a write error from usbaudio:
	writing ep 4 1 w 4 44100 to #U/usb0/1/ctl: permission denied,
then the kernel panics with "fault: xxx")

i've now fixed it so it closes /dev/audio before writing to audioctl
and then reopens it, but it doesn't seem like this should be
necessary.

the other thing is i'd really like usbaudio to attach to the correct
usb port automatically: is there enough information provided by the
usb device to automatically identify an audio device (currently i look
at the output of usbd -v, or have a look in /dev/usb0)?

those issues aside, it works very nicely, thanks...  i can finally
play mp3 files. (mind you, i've only got two so far!)

i guess the next step is a little audio plumbing client that knows how
to stop one stream and start another when a new plumbing request comes
in; then the world is my jukebox.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] usb audio
  2003-02-21 18:02 [9fans] usb audio rog
@ 2003-02-21 18:02 ` Russ Cox
  2003-02-21 18:33 ` Fco.J.Ballesteros
  2003-02-21 18:43 ` Scott Schwartz
  2 siblings, 0 replies; 7+ messages in thread
From: Russ Cox @ 2003-02-21 18:02 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 164 bytes --]

save a kernel stack trace or run ktrace -i.
i've been trying to implicate devusb in that panic
for many months.  if you can reproduce it, please
do so!

russ

[-- Attachment #2: Type: message/rfc822, Size: 2301 bytes --]

From: rog@vitanuova.com
To: 9fans@cse.psu.edu
Subject: [9fans] usb audio
Date: Fri, 21 Feb 2003 18:02:16 0000
Message-ID: <a9d149fc65c213559c703d64275367b6@vitanuova.com>

i just got my new xitel hifi-link (on presotto's recommendation), and
hacked madplay so that it sets the speed and number of channels
appropriately to the mp3 file.

only problem is that doing this when the /dev/audio is already open
reliably crashes the kernel.
(first i get a write error from usbaudio:
	writing ep 4 1 w 4 44100 to #U/usb0/1/ctl: permission denied,
then the kernel panics with "fault: xxx")

i've now fixed it so it closes /dev/audio before writing to audioctl
and then reopens it, but it doesn't seem like this should be
necessary.

the other thing is i'd really like usbaudio to attach to the correct
usb port automatically: is there enough information provided by the
usb device to automatically identify an audio device (currently i look
at the output of usbd -v, or have a look in /dev/usb0)?

those issues aside, it works very nicely, thanks...  i can finally
play mp3 files. (mind you, i've only got two so far!)

i guess the next step is a little audio plumbing client that knows how
to stop one stream and start another when a new plumbing request comes
in; then the world is my jukebox.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] usb audio
  2003-02-21 18:02 [9fans] usb audio rog
  2003-02-21 18:02 ` Russ Cox
@ 2003-02-21 18:33 ` Fco.J.Ballesteros
  2003-02-21 18:43 ` Scott Schwartz
  2 siblings, 0 replies; 7+ messages in thread
From: Fco.J.Ballesteros @ 2003-02-21 18:33 UTC (permalink / raw)
  To: 9fans

I redirect the audio using redirfs. Not a plumber, but can be used for that.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] usb audio
  2003-02-21 18:02 [9fans] usb audio rog
  2003-02-21 18:02 ` Russ Cox
  2003-02-21 18:33 ` Fco.J.Ballesteros
@ 2003-02-21 18:43 ` Scott Schwartz
  2 siblings, 0 replies; 7+ messages in thread
From: Scott Schwartz @ 2003-02-21 18:43 UTC (permalink / raw)
  To: 9fans

| i guess the next step is a little audio plumbing client that knows how
| to stop one stream and start another when a new plumbing request comes
| in; then the world is my jukebox.

You also want a way to mix streams.  Most often, two writes to an audio
device should generate the two sounds a the same time, right?



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [9fans] USB audio
@ 2004-11-06  3:25 Jack Johnson
  0 siblings, 0 replies; 7+ messages in thread
From: Jack Johnson @ 2004-11-06  3:25 UTC (permalink / raw)
  To: 9fans

Came across a mention of another USB audio device:

http://us.hercules.com/products/showpage.php?p=84&b=1&f=1

According to the blurb basic audio works under Linux and FreeBSD and
runs about $70.  I wonder if it might be a good choice for Plan 9
workstations.

-Jack


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [9fans] USB audio
@ 2004-08-07 14:01 Sape Mullender
  0 siblings, 0 replies; 7+ messages in thread
From: Sape Mullender @ 2004-08-07 14:01 UTC (permalink / raw)
  To: sape, 9fans

[-- Attachment #1: Type: text/plain, Size: 9125 bytes --]

I spent two days hacking on USB and USB audio in particular and pushed the
result out to sources about a week ago.

usb/usbaudio can now drive the following audio devices (and probably more, but I haven't
tested them).  Below is the output from running usb/usbaudio -V:

Xitel AN1:
	Audio output unit 1
	Audio Feature Unit 2 for Playback
		mute control on master channel
		bass control on master channel
		treble control on master channel
		volume control on channel 1
		volume control on channel 2
	Interface 1, alt 1: mono, 8 bits, frequency variable between 4990 and 55010
	Interface 1, alt 2: stereo, 8 bits, frequency variable between 4990 and 55010
	Interface 1, alt 3: mono, 16 bits, frequency variable between 4990 and 55010
	Interface 1, alt 4: stereo, 16 bits, frequency variable between 4990 and 55010
	Interface 1, alt 5: mono, 20 bits, frequency variable between 4990 and 55010
	Interface 1, alt 6: stereo, 20 bits, frequency variable between 4990 and 55010
	Buttons on endpoint 3
	Playback on endpoint 4
	Playback speed control, min 4990, max 55010, step 1, value 44100
	Playback mute control, value 0
	Playback volume control, min -15616, max 0, step 256, values[1] -5376  [2] -5376
	Playback bass control, min 0, max 96, step 8, value 0
	Playback treble control, min 0, max 24, step 8, value 0
	Playback channels control, min 1, max 2, value 2
	Playback resolution control, min 8, max 20, value 16
Philips USB speakers, model DSS 370/17:
	Audio output unit 1
	Audio Feature Unit 2 for Playback
		mute control on master channel
		bass control on master channel
		treble control on master channel
		bassboost control on master channel
		volume control on channel 1
		volume control on channel 2
	Interface 1, alt 1: mono, 8 bits, frequency variable between 4990 and 55010
	Interface 1, alt 2: stereo, 8 bits, frequency variable between 4990 and 55010
	Interface 1, alt 3: mono, 16 bits, frequency variable between 4990 and 55010
	Interface 1, alt 4: stereo, 16 bits, frequency variable between 4990 and 55010
	Interface 1, alt 5: mono, 20 bits, frequency variable between 4990 and 55010
	Interface 1, alt 6: stereo, 20 bits, frequency variable between 4990 and 55010
	Buttons on endpoint 3
	Playback on endpoint 4
	Playback speed control, min 4990, max 55010, step 1, value 44100
	Playback mute control, value 0
	Playback volume control, min -15616, max 0, step 256, values[1] -10752  [2] -10752
	Playback bass control, min 0, max 96, step 8, value 0
	Playback treble control, min 0, max 24, step 8, value 0
	Playback bassboost control, value 0
	Playback channels control, min 1, max 2, value 2
	Playback resolution control, min 8, max 20, value 16
Edirol UA-3:
	Audio output unit 1
	Device can record from Line connector
	Audio input unit 13
	Device can play to USB Streaming
	Audio Selector Unit 11
	Audio Feature Unit 9 for Playback
		mute control on master channel
		volume control on channel 1
		volume control on channel 2
	Interface 1, alt 1: mono, 16 bits, discrete frequencies are: 44100
	Interface 1, alt 2: stereo, 16 bits, discrete frequencies are: 44100
	Interface 2, alt 1: mono, 16 bits, discrete frequencies are: 32000 44100 48000
	Interface 2, alt 2: stereo, 16 bits, discrete frequencies are: 32000 44100 48000
	Buttons on endpoint 1
	Playback on endpoint 2
	Record on endpoint 3
	Playback speed control, min 44100, max 44100, value 44100
	Playback mute control, value 0
	Playback volume control, min -5888, max 2048, step 256, values[1] -2048  [2] -2048
	Playback channels control, min 1, max 2, value 2
	Playback resolution control, min 16, max 16, value 16
	Record speed control, min 32000, max 48000, value 44100
	Record channels control, min 1, max 2, value 2
	Record resolution control, min 16, max 16, value 16
Edirol UA-1X (haven't tested recording, but I believe it'll work):
	Audio output unit 1
	Audio Feature Unit 3 for Playback
		mute control on master channel
		volume control on channel 1
		volume control on channel 2
	Device can record from <unnamed>
	Audio input unit 5
	Device can play to USB Streaming
	Interface 1, alt 1: stereo, 16 bits, discrete frequencies are: 32000 44100 48000
	Interface 1, alt 2: mono, 16 bits, discrete frequencies are: 32000 44100 48000
	Interface 1, alt 3: stereo, 8 bits, discrete frequencies are: 32000 44100 48000
	Interface 1, alt 4: mono, 8 bits, discrete frequencies are: 32000 44100 48000
	Interface 1, alt 5: stereo, 8 bits, discrete frequencies are: 32000 44100 48000
	Interface 1, alt 6: mono, 8 bits, discrete frequencies are: 32000 44100 48000
	Interface 2, alt 1: stereo, 16 bits, discrete frequencies are: 48000
	Interface 2, alt 2: mono, 16 bits, discrete frequencies are: 48000
	Interface 2, alt 3: stereo, 16 bits, discrete frequencies are: 44100
	Interface 2, alt 4: mono, 16 bits, discrete frequencies are: 44100
	Interface 2, alt 5: stereo, 16 bits, discrete frequencies are: 32000
	Interface 2, alt 6: mono, 16 bits, discrete frequencies are: 32000
	Interface 2, alt 7: stereo, 16 bits, discrete frequencies are: 22050
	Interface 2, alt 8: mono, 16 bits, discrete frequencies are: 22050
	Interface 2, alt 9: stereo, 16 bits, discrete frequencies are: 16000
	Interface 2, alt 10: mono, 16 bits, discrete frequencies are: 16000
	Interface 2, alt 11: stereo, 8 bits, discrete frequencies are: 16000
	Interface 2, alt 12: mono, 8 bits, discrete frequencies are: 16000
	Interface 2, alt 13: stereo, 8 bits, discrete frequencies are: 8000
	Interface 2, alt 14: mono, 8 bits, discrete frequencies are: 8000
	Interface 2, alt 15: stereo, 16 bits, discrete frequencies are: 11025
	Playback on endpoint 2
	Record on endpoint 4
	Playback speed control, min 32000, max 48000, value 44100
	Playback mute control, value 0
	Playback volume control, min -32768, max 0, step 256, values[1] 0  [2] 0
	Playback channels control, min 1, max 2, value 2
	Playback resolution control, min 8, max 16, value 16
	Record speed control, min 44100, max 44100, value 44100
	Record channels control, min 1, max 2, value 2
	Record resolution control, min 8, max 16, value 16
Xitel Pro HiFi-Link (Although I could set and read back the volume, it
didn't seem to affect the playback.  Strange):
	Audio output unit 1
	Audio Feature Unit 9 for Playback
		mute control on master channel
		volume control on channel 1
		volume control on channel 2
	Interface 1, alt 1: stereo, 16 bits, discrete frequencies are: 48000
	Playback on endpoint 1
	Buttons on endpoint 3
	Warning, can't configure playout for 44100 Hz, configuring for 48000 Hz instead
	Playback speed control, min 48000, max 48000, value 48000
	Playback mute control, value 0
	Playback volume control, min -12256, max -16, step 48, values[1] -16  [2] -16
	Playback channels control, min 2, max 2, value 2
	Playback resolution control, min 16, max 16, value 16

And here's one that doesn't work yet; volume needs to be controlled
through the mixer and I haven't had time to write mixer code yet.
Volunteers should read
	www.usb.org/developers/devclass_docs/audio10.pdf
It describes how to control a mixer.  A warning, look at the
attachment to see what you're up against.

Creative SB0270
	Audio output unit 1
	Device can record from <unnamed>
	Device can record from Line connector
	Device can record from <unnamed>
	Audio input unit 7
	Device can play to USB Streaming
	Audio Selector Unit 8
	Audio Feature Unit 9, not known what for
		mute control on master channel
		volume control on channel 1
		volume control on channel 2
	Audio Feature Unit 10 for Record
		mute control on master channel
		volume control on master channel
		agc control on master channel
	Audio Feature Unit 11 for Record
	Second feature unit (10, 11) on record
		mute control on master channel
		volume control on channel 1
		volume control on channel 2
	Audio Feature Unit 12 for Record
	Second feature unit (11, 12) on record
		mute control on master channel
	Audio Feature Unit 13 for Record
	Second feature unit (12, 13) on record
		mute control on master channel
		volume control on master channel
	Audio Feature Unit 14 for Record
	Second feature unit (13, 14) on record
		mute control on master channel
		volume control on channel 1
		volume control on channel 2
	Audio Mixer Unit 15
	Interface 1, alt 1: stereo, 16 bits, discrete frequencies are: 48000
	Interface 2, alt 1: stereo, 16 bits, discrete frequencies are: 48000 44100
	Playback on endpoint 1
	Record on endpoint 2
	Warning, can't configure playout for 44100 Hz, configuring for 48000 Hz instead
	Playback speed control, min 48000, max 48000, value 48000
	Playback channels control, min 2, max 2, value 2
	Playback resolution control, min 16, max 16, value 16
	Record speed control, value -2147483648
	Record mute control, value 1
	Record volume control, min 0, max 12240, step 48, values[1] 9168  [2] 9168
	Record agc control
	Record channels control, min 2, max 2, value 2
	Record resolution control, min 16, max 16, value 16
	usb/usbaudio: Can't set record speed

[-- Attachment #2: blaster.ps --]
[-- Type: application/postscript, Size: 59152 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] usb audio
@ 2003-02-21 18:55 rog
  0 siblings, 0 replies; 7+ messages in thread
From: rog @ 2003-02-21 18:55 UTC (permalink / raw)
  To: 9fans

i hadn't found ktrace -i before... good for saving lots of typing!

i've now rebooted four times, and it crashed twice at
/sys/src/9/pc/usbuhci.c:/panic\("packet

once with no kernel stack trace,

and once with "fault: 0x4010" from this line in  isoio():
			td->flags &= ~IsoClean;

hope this helps!



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-11-06  3:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-21 18:02 [9fans] usb audio rog
2003-02-21 18:02 ` Russ Cox
2003-02-21 18:33 ` Fco.J.Ballesteros
2003-02-21 18:43 ` Scott Schwartz
2003-02-21 18:55 rog
2004-08-07 14:01 [9fans] USB audio Sape Mullender
2004-11-06  3:25 Jack Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).