* Re: cs4248 / thinkpad 755 / 755c , patch suggestions [PATCH]]
@ 2003-07-07 20:53 Ryan Underwood
2003-07-08 10:50 ` Takashi Iwai
0 siblings, 1 reply; 13+ messages in thread
From: Ryan Underwood @ 2003-07-07 20:53 UTC (permalink / raw)
To: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 1804 bytes --]
Hi Takashi,
On Thu, Jul 03, 2003 at 02:29:01PM +0200, Takashi Iwai wrote:
> At Wed, 2 Jul 2003 15:29:55 -0500,
> Ryan Underwood wrote:
> >
> > 1) What is ALSA's policy on module options? For example, would it be
> > okay to add an option like "thinkpad" to the ad1848 module, so that
> > inserting it with "thinkpad=1" would cause the necessary ports to be
> > prodded?
>
> this looks like a feasible solution.
>
> > 2) Since the chip's power mode can be controlled through a write to that
> > port (bit 2 on, cs4248 power on; bit 2 off, cs4248 power off), would it
> > be a good idea to add the _suspend, _resume, and _set_power_state
> > functions within a #ifdef CONFIG_PM block, like in other drivers?
>
> yep. we haven't done that just becase of lack of hardware.
> if you can write and test it, it would be greatly appreciated.
I have attached a patch against the ALSA 0.94. ad1848.c, ad1848_lib.c,
and ad1848.h have changed.
I tested the module against 2.4.21 on a Debian system, gcc 3.3 and it
works fine; simply set the proper resources and thinkpad=1 and the
thinkpad works.
One issue is to note, I don't know if this is a problem with the ad1848
driver in general or what; if I cat a 11025hz mono 8-bit file to
/dev/dsp, the sound comes out verrrrry slllloooowwwllly. But using
aplay, it works fine.
I am not sure the best way to test the power managmeent code -- it
doesn't crash the machine at least. ;)
I added a note to the ALSA wiki about this option. I tried to fix the
OSS driver too but it does some other weird things like not allowing a
IRQ > 7 to be used. (It thinks the CS4248 is an 8bit card or
something). So this will have to be an alsa-only fix for now at least.
Let me know if the patch is ok,
--
Ryan Underwood, <nemesis at icequake.net>, icq=10317253
[-- Attachment #2: cs4248_thinkpad.diff --]
[-- Type: text/plain, Size: 6433 bytes --]
diff -ur alsa-driver/alsa-kernel/include/ad1848.h alsanew/alsa-kernel/include/ad1848.h
--- alsa-driver/alsa-kernel/include/ad1848.h 2003-04-23 05:01:29.000000000 -0500
+++ alsanew/alsa-kernel/include/ad1848.h 2003-07-03 20:29:59.000000000 -0500
@@ -121,6 +121,11 @@
#define AD1848_HW_CS4248 0x0003 /* CS4248 chip */
#define AD1848_HW_CMI8330 0x0004 /* CMI8330 chip */
+/* IBM Thinkpad specific stuff */
+#define AD1848_THINKPAD_CTL_PORT1 0x15e8
+#define AD1848_THINKPAD_CTL_PORT2 0x15e9
+#define AD1848_THINKPAD_CS4248_ENABLE_BIT 0x02
+
struct _snd_ad1848 {
unsigned long port; /* i/o port */
struct resource *res_port;
@@ -140,6 +145,10 @@
int mce_bit;
int calibrate_mute;
int dma_size;
+ int thinkpad_flag; /* Thinkpad CS4248 needs some extra help */
+#ifdef CONFIG_PM
+ struct pm_dev *thinkpad_pmstate;
+#endif
spinlock_t reg_lock;
struct semaphore open_mutex;
@@ -157,7 +166,7 @@
int snd_ad1848_create(snd_card_t * card,
unsigned long port,
- int irq, int dma,
+ int irq, int dma, int thinkpad,
unsigned short hardware,
ad1848_t ** chip);
diff -ur alsa-driver/alsa-kernel/isa/ad1848/ad1848.c alsanew/alsa-kernel/isa/ad1848/ad1848.c
--- alsa-driver/alsa-kernel/isa/ad1848/ad1848.c 2002-10-21 13:28:21.000000000 -0500
+++ alsanew/alsa-kernel/isa/ad1848/ad1848.c 2003-07-07 13:11:55.000000000 -0500
@@ -46,6 +46,7 @@
static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */
static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */
+static int thinkpad[SNDRV_CARDS]; /* Thinkpad special case */
MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(index, "Index value for AD1848 soundcard.");
@@ -65,6 +66,9 @@
MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(dma1, "DMA1 # for AD1848 driver.");
MODULE_PARM_SYNTAX(dma1, SNDRV_DMA_DESC);
+MODULE_PARM(thinkpad, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+MODULE_PARM_DESC(thinkpad, "Enable only for the onboard CS4248 of IBM Thinkpad 360/750/755 series.");
+MODULE_PARM_SYNTAX(thinkpad, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
static snd_card_t *snd_ad1848_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
@@ -96,6 +100,7 @@
if ((err = snd_ad1848_create(card, port[dev],
irq[dev],
dma1[dev],
+ thinkpad[dev],
AD1848_HW_DETECT,
&chip)) < 0) {
snd_card_free(card);
@@ -116,6 +121,10 @@
sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
pcm->name, chip->port, irq[dev], dma1[dev]);
+ if (thinkpad[dev]) {
+ strcat(card->longname, " [Thinkpad]");
+ }
+
if ((err = snd_card_register(card)) < 0) {
snd_card_free(card);
return err;
@@ -168,7 +177,8 @@
get_id(&str,&id[nr_dev]) == 2 &&
get_option(&str,(int *)&port[nr_dev]) == 2 &&
get_option(&str,&irq[nr_dev]) == 2 &&
- get_option(&str,&dma1[nr_dev]) == 2);
+ get_option(&str,&dma1[nr_dev]) == 2 &&
+ get_option(&str,&thinkpad[nr_dev]) == 2);
nr_dev++;
return 1;
}
diff -ur alsa-driver/alsa-kernel/isa/ad1848/ad1848_lib.c alsanew/alsa-kernel/isa/ad1848/ad1848_lib.c
--- alsa-driver/alsa-kernel/isa/ad1848/ad1848_lib.c 2003-05-30 07:28:34.000000000 -0500
+++ alsanew/alsa-kernel/isa/ad1848/ad1848_lib.c 2003-07-03 20:25:21.000000000 -0500
@@ -625,6 +625,92 @@
*/
+static void snd_ad1848_thinkpad_twiddle(ad1848_t *chip, int on) {
+
+ int tmp;
+
+ if (!chip->thinkpad_flag) return;
+
+ outb(0x1c, AD1848_THINKPAD_CTL_PORT1);
+ tmp = inb(AD1848_THINKPAD_CTL_PORT2);
+
+ switch (on) {
+ case 0: /* turn it off */
+ tmp &= ~AD1848_THINKPAD_CS4248_ENABLE_BIT;
+ default: /* turn it on */
+ tmp |= AD1848_THINKPAD_CS4248_ENABLE_BIT;
+ }
+
+ outb(tmp, AD1848_THINKPAD_CTL_PORT2);
+
+}
+
+#ifdef CONFIG_PM
+static void snd_ad1848_suspend(ad1848_t *chip) {
+
+ snd_card_t *card = chip->card;
+
+ if (card->power_state == SNDRV_CTL_POWER_D3hot)
+ return;
+
+ if (chip->thinkpad_flag) {
+ snd_pcm_suspend_all(chip->pcm);
+ snd_ad1848_thinkpad_twiddle(chip, 0);
+ snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+ }
+
+}
+
+static void snd_ad1848_resume(ad1848_t *chip) {
+
+ snd_card_t *card = chip->card;
+
+ if (card->power_state == SNDRV_CTL_POWER_D0)
+ return;
+
+ if (chip->thinkpad_flag) {
+ snd_ad1848_thinkpad_twiddle(chip, 1);
+ snd_power_change_state(card, SNDRV_CTL_POWER_D0);
+ }
+}
+
+/* callback for control API */
+static int snd_ad1848_set_power_state(snd_card_t *card, unsigned int power_state)
+{
+ ad1848_t *chip = (ad1848_t *) card->power_state_private_data;
+ switch (power_state) {
+ case SNDRV_CTL_POWER_D0:
+ case SNDRV_CTL_POWER_D1:
+ case SNDRV_CTL_POWER_D2:
+ snd_ad1848_resume(chip);
+ break;
+ case SNDRV_CTL_POWER_D3hot:
+ case SNDRV_CTL_POWER_D3cold:
+ snd_ad1848_suspend(chip);
+ break;
+ default:
+ return -EINVAL;
+ }
+ return 0;
+}
+
+static int snd_ad1848_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data)
+{
+ ad1848_t *chip = snd_magic_cast(ad1848_t, dev->data, return 0);
+
+ switch (rqst) {
+ case PM_SUSPEND:
+ snd_ad1848_suspend(chip);
+ break;
+ case PM_RESUME:
+ snd_ad1848_resume(chip);
+ break;
+ }
+ return 0;
+}
+
+#endif /* CONFIG_PM */
+
static int snd_ad1848_probe(ad1848_t * chip)
{
unsigned long flags;
@@ -799,6 +885,10 @@
static int snd_ad1848_free(ad1848_t *chip)
{
+#ifdef CONFIG_PM
+ if (chip->thinkpad_flag && chip->thinkpad_pmstate)
+ pm_unregister(chip->thinkpad_pmstate);
+#endif
if (chip->res_port) {
release_resource(chip->res_port);
kfree_nocheck(chip->res_port);
@@ -832,7 +922,7 @@
int snd_ad1848_create(snd_card_t * card,
unsigned long port,
- int irq, int dma,
+ int irq, int dma, int thinkpad,
unsigned short hardware,
ad1848_t ** rchip)
{
@@ -870,6 +960,22 @@
}
chip->dma = dma;
+ if (thinkpad) {
+ chip->thinkpad_flag = 1;
+ snd_ad1848_thinkpad_twiddle(chip, 1);
+#ifdef CONFIG_PM
+ chip->thinkpad_pmstate = pm_register(PM_ISA_DEV, 0, snd_ad1848_pm_callback);
+ if (chip->thinkpad_pmstate) {
+ chip->thinkpad_pmstate->data = chip;
+ card->set_power_state = snd_ad1848_set_power_state; /* callback */
+ card->power_state_private_data = chip;
+ }
+#endif
+ }
+ else {
+ chip->thinkpad_flag = 0;
+ }
+
if (snd_ad1848_probe(chip) < 0) {
snd_ad1848_free(chip);
return -ENODEV;
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: cs4248 / thinkpad 755 / 755c , patch suggestions [PATCH]]
2003-07-07 20:53 cs4248 / thinkpad 755 / 755c , patch suggestions [PATCH]] Ryan Underwood
@ 2003-07-08 10:50 ` Takashi Iwai
2003-07-08 13:58 ` Ryan Underwood
2003-07-08 17:01 ` Ryan Underwood
0 siblings, 2 replies; 13+ messages in thread
From: Takashi Iwai @ 2003-07-08 10:50 UTC (permalink / raw)
To: Ryan Underwood; +Cc: alsa-devel
At Mon, 7 Jul 2003 15:53:57 -0500,
Ryan Underwood wrote:
>
> Hi Takashi,
>
> On Thu, Jul 03, 2003 at 02:29:01PM +0200, Takashi Iwai wrote:
> > At Wed, 2 Jul 2003 15:29:55 -0500,
> > Ryan Underwood wrote:
> > >
> > > 1) What is ALSA's policy on module options? For example, would it be
> > > okay to add an option like "thinkpad" to the ad1848 module, so that
> > > inserting it with "thinkpad=1" would cause the necessary ports to be
> > > prodded?
> >
> > this looks like a feasible solution.
> >
> > > 2) Since the chip's power mode can be controlled through a write to that
> > > port (bit 2 on, cs4248 power on; bit 2 off, cs4248 power off), would it
> > > be a good idea to add the _suspend, _resume, and _set_power_state
> > > functions within a #ifdef CONFIG_PM block, like in other drivers?
> >
> > yep. we haven't done that just becase of lack of hardware.
> > if you can write and test it, it would be greatly appreciated.
>
> I have attached a patch against the ALSA 0.94. ad1848.c, ad1848_lib.c,
> and ad1848.h have changed.
thanks!
i applied the patch to cvs with a small modification.
instead of adding a new argument, i created a new hardware type
AD1848_HW_THINKPAD, so that the function call is kept compatible.
> One issue is to note, I don't know if this is a problem with the ad1848
> driver in general or what; if I cat a 11025hz mono 8-bit file to
> /dev/dsp, the sound comes out verrrrry slllloooowwwllly. But using
> aplay, it works fine.
could you check the parameters in /proc/asound/card0/pcm0p/sub0/*
during playback via oss?
> I am not sure the best way to test the power managmeent code -- it
> doesn't crash the machine at least. ;)
it looks ok - but i guess we need to restore the registers (mixer
status, etc) too.
Takashi
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: cs4248 / thinkpad 755 / 755c , patch suggestions [PATCH]]
2003-07-08 10:50 ` Takashi Iwai
@ 2003-07-08 13:58 ` Ryan Underwood
2003-07-08 17:27 ` Takashi Iwai
2003-07-08 17:01 ` Ryan Underwood
1 sibling, 1 reply; 13+ messages in thread
From: Ryan Underwood @ 2003-07-08 13:58 UTC (permalink / raw)
To: alsa-devel
Hi Takashi,
On Tue, Jul 08, 2003 at 12:50:05PM +0200, Takashi Iwai wrote:
>
> > One issue is to note, I don't know if this is a problem with the ad1848
> > driver in general or what; if I cat a 11025hz mono 8-bit file to
> > /dev/dsp, the sound comes out verrrrry slllloooowwwllly. But using
> > aplay, it works fine.
>
> could you check the parameters in /proc/asound/card0/pcm0p/sub0/*
> during playback via oss?
The results are pasted below -- what is strange is that aplay identifies
the file as 11025Hz but apparently the OSS driver thinks it is 8000Hz
data.
> > I am not sure the best way to test the power managmeent code -- it
> > doesn't crash the machine at least. ;)
>
> it looks ok - but i guess we need to restore the registers (mixer
> status, etc) too.
You are right -- I just checked the registers before and after flipping
that bit, and it seems they are set to default values afterwards, which
would seem to support the possibility that this is a power management
feature.
The main thing I was wondering about is if some other machine with a
AD1848 goes into D0 for instance, and the suspend function does nothing
(since it is not a thinkpad), is the system still in an ok state as long
as the card's status is not set to D0 when the card is actually not in
D0? Does that make sense?
---------------------------------------------------------------------
<start of playback>
$ cat /proc/asound/card0/pcm0p/sub0/*
no setup
card: 0
device: 0
subdevice: 0
stream: PLAYBACK
id: AD1848
name: CS4248
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 0
64
state: OPEN
trigger_time: -1061273892.-1072503897
tstamp : -1071322800.-1071322416
delay : -1056799360
avail : -1056014772
avail_max : 3747840
-----
hw_ptr : 0
appl_ptr : 0
no setup
<little later in playback>
$ cat /proc/asound/card0/pcm0p/sub0/*
access: RW_INTERLEAVED
format: U8
subformat: STD
channels: 1
rate: 8000 (8000/1)
period_size: 4096
buffer_size: 65536
tick_time: 10000
OSS format: U8
OSS channels: 1
OSS rate: 8000
OSS period bytes: 4096
OSS periods: 16
card: 0
device: 0
subdevice: 0
stream: PLAYBACK
id: AD1848
name: CS4248
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 0
64
state: DRAINING
trigger_time: 1057672530.000584530
tstamp : 1057672533.000162630
delay : 8029
avail : 57507
avail_max : 61467
-----
hw_ptr : 20643
appl_ptr : 28672
tstamp_mode: NONE
period_step: 1
sleep_min: 0
avail_min: 4096
xfer_align: 1
start_threshold: 1
stop_threshold: 65536
silence_threshold: 0
silence_size: 0
boundary: 1073741824
--
Ryan Underwood, <nemesis at icequake.net>, icq=10317253
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: cs4248 / thinkpad 755 / 755c , patch suggestions [PATCH]]
2003-07-08 10:50 ` Takashi Iwai
2003-07-08 13:58 ` Ryan Underwood
@ 2003-07-08 17:01 ` Ryan Underwood
2003-07-08 17:21 ` Takashi Iwai
1 sibling, 1 reply; 13+ messages in thread
From: Ryan Underwood @ 2003-07-08 17:01 UTC (permalink / raw)
To: alsa-devel
Takashi,
Please amend the previous patch. I forgot breaks in
snd_ad1848_thinkpad_twiddle. The behavior would be to always fall
through to enabling the device.
Sorry! :)
--
Ryan Underwood, <nemesis at icequake.net>, icq=10317253
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: cs4248 / thinkpad 755 / 755c , patch suggestions [PATCH]]
2003-07-08 17:01 ` Ryan Underwood
@ 2003-07-08 17:21 ` Takashi Iwai
0 siblings, 0 replies; 13+ messages in thread
From: Takashi Iwai @ 2003-07-08 17:21 UTC (permalink / raw)
To: Ryan Underwood; +Cc: alsa-devel
At Tue, 8 Jul 2003 12:01:21 -0500,
Ryan Underwood wrote:
>
>
> Takashi,
>
> Please amend the previous patch. I forgot breaks in
> snd_ad1848_thinkpad_twiddle. The behavior would be to always fall
> through to enabling the device.
ok fixed.
Takashi
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: cs4248 / thinkpad 755 / 755c , patch suggestions [PATCH]]
2003-07-08 13:58 ` Ryan Underwood
@ 2003-07-08 17:27 ` Takashi Iwai
2003-07-08 17:32 ` Ryan Underwood
0 siblings, 1 reply; 13+ messages in thread
From: Takashi Iwai @ 2003-07-08 17:27 UTC (permalink / raw)
To: Ryan Underwood; +Cc: alsa-devel
At Tue, 8 Jul 2003 08:58:21 -0500,
Ryan Underwood wrote:
>
>
> Hi Takashi,
>
> On Tue, Jul 08, 2003 at 12:50:05PM +0200, Takashi Iwai wrote:
> >
> > > One issue is to note, I don't know if this is a problem with the ad1848
> > > driver in general or what; if I cat a 11025hz mono 8-bit file to
> > > /dev/dsp, the sound comes out verrrrry slllloooowwwllly. But using
> > > aplay, it works fine.
> >
> > could you check the parameters in /proc/asound/card0/pcm0p/sub0/*
> > during playback via oss?
>
> The results are pasted below -- what is strange is that aplay identifies
> the file as 11025Hz but apparently the OSS driver thinks it is 8000Hz
> data.
ah, i understand. you cannot cat to /dev/dsp in general.
if you do this, it's supposed to be 8kHz mono samples.
> > > I am not sure the best way to test the power managmeent code -- it
> > > doesn't crash the machine at least. ;)
> >
> > it looks ok - but i guess we need to restore the registers (mixer
> > status, etc) too.
>
> You are right -- I just checked the registers before and after flipping
> that bit, and it seems they are set to default values afterwards, which
> would seem to support the possibility that this is a power management
> feature.
>
> The main thing I was wondering about is if some other machine with a
> AD1848 goes into D0 for instance, and the suspend function does nothing
> (since it is not a thinkpad), is the system still in an ok state as long
> as the card's status is not set to D0 when the card is actually not in
> D0? Does that make sense?
if the chip supports really something the power management, we should
implement it, too. but AFAIK, ad1848 itself has no such a control.
so, the suspend callback is expected just to save the last status so
that it can be restored in the resume callback.
Takashi
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: cs4248 / thinkpad 755 / 755c , patch suggestions [PATCH]]
2003-07-08 17:27 ` Takashi Iwai
@ 2003-07-08 17:32 ` Ryan Underwood
2003-07-08 17:37 ` Takashi Iwai
0 siblings, 1 reply; 13+ messages in thread
From: Ryan Underwood @ 2003-07-08 17:32 UTC (permalink / raw)
To: alsa-devel
Hi Takashi,
On Tue, Jul 08, 2003 at 07:27:06PM +0200, Takashi Iwai wrote:
> > The results are pasted below -- what is strange is that aplay identifies
> > the file as 11025Hz but apparently the OSS driver thinks it is 8000Hz
> > data.
>
> ah, i understand. you cannot cat to /dev/dsp in general.
> if you do this, it's supposed to be 8kHz mono samples.
Hmm, limitation of the ad1848 driver, of ALSA OSS emulation, or OSS API?
> > AD1848 goes into D0 for instance, and the suspend function does nothing
> > (since it is not a thinkpad), is the system still in an ok state as long
> > as the card's status is not set to D0 when the card is actually not in
> > D0? Does that make sense?
>
> if the chip supports really something the power management, we should
> implement it, too. but AFAIK, ad1848 itself has no such a control.
> so, the suspend callback is expected just to save the last status so
> that it can be restored in the resume callback.
Ok, will see about doing that in some time.
--
Ryan Underwood, <nemesis at icequake.net>, icq=10317253
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: cs4248 / thinkpad 755 / 755c , patch suggestions [PATCH]]
2003-07-08 17:32 ` Ryan Underwood
@ 2003-07-08 17:37 ` Takashi Iwai
2003-07-08 19:54 ` Ryan Underwood
0 siblings, 1 reply; 13+ messages in thread
From: Takashi Iwai @ 2003-07-08 17:37 UTC (permalink / raw)
To: Ryan Underwood; +Cc: alsa-devel
At Tue, 8 Jul 2003 12:32:29 -0500,
Ryan Underwood wrote:
>
>
> Hi Takashi,
>
> On Tue, Jul 08, 2003 at 07:27:06PM +0200, Takashi Iwai wrote:
> > > The results are pasted below -- what is strange is that aplay identifies
> > > the file as 11025Hz but apparently the OSS driver thinks it is 8000Hz
> > > data.
> >
> > ah, i understand. you cannot cat to /dev/dsp in general.
> > if you do this, it's supposed to be 8kHz mono samples.
>
> Hmm, limitation of the ad1848 driver, of ALSA OSS emulation, or OSS API?
IIRC, it's the definition of this OSS device.
well, i'm not sure this is officially so.
but at least, /dev/audio is supposed to be in these formats, and we
initialize /dev/dsp as well.
btw, for testing the OSS emulation, you can try play command included
in sox package.
Takashi
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: cs4248 / thinkpad 755 / 755c , patch suggestions [PATCH]]
2003-07-08 17:37 ` Takashi Iwai
@ 2003-07-08 19:54 ` Ryan Underwood
2003-07-09 12:39 ` Takashi Iwai
0 siblings, 1 reply; 13+ messages in thread
From: Ryan Underwood @ 2003-07-08 19:54 UTC (permalink / raw)
To: alsa-devel
Hi Takashi,
On Tue, Jul 08, 2003 at 07:37:50PM +0200, Takashi Iwai wrote:
> > On Tue, Jul 08, 2003 at 07:27:06PM +0200, Takashi Iwai wrote:
> > > > The results are pasted below -- what is strange is that aplay identifies
> > > > the file as 11025Hz but apparently the OSS driver thinks it is 8000Hz
> > > > data.
> > >
> > > ah, i understand. you cannot cat to /dev/dsp in general.
> > > if you do this, it's supposed to be 8kHz mono samples.
> >
> > Hmm, limitation of the ad1848 driver, of ALSA OSS emulation, or OSS API?
>
> IIRC, it's the definition of this OSS device.
> well, i'm not sure this is officially so.
> but at least, /dev/audio is supposed to be in these formats, and we
> initialize /dev/dsp as well.
>
> btw, for testing the OSS emulation, you can try play command included
> in sox package.
You are correct, play works correctly but catting does not. It seems,
however, that many OSS drivers support cat a wav file directly to /dev/dsp,
and do the detection of the format parameters internally. I guess this is not
required by the OSS specification?
--
Ryan Underwood, <nemesis at icequake.net>, icq=10317253
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: cs4248 / thinkpad 755 / 755c , patch suggestions [PATCH]]
2003-07-08 19:54 ` Ryan Underwood
@ 2003-07-09 12:39 ` Takashi Iwai
2003-07-09 16:05 ` Ryan Underwood
0 siblings, 1 reply; 13+ messages in thread
From: Takashi Iwai @ 2003-07-09 12:39 UTC (permalink / raw)
To: Ryan Underwood; +Cc: alsa-devel
At Tue, 8 Jul 2003 14:54:37 -0500,
Ryan Underwood wrote:
>
>
> Hi Takashi,
>
> On Tue, Jul 08, 2003 at 07:37:50PM +0200, Takashi Iwai wrote:
> > > On Tue, Jul 08, 2003 at 07:27:06PM +0200, Takashi Iwai wrote:
> > > > > The results are pasted below -- what is strange is that aplay identifies
> > > > > the file as 11025Hz but apparently the OSS driver thinks it is 8000Hz
> > > > > data.
> > > >
> > > > ah, i understand. you cannot cat to /dev/dsp in general.
> > > > if you do this, it's supposed to be 8kHz mono samples.
> > >
> > > Hmm, limitation of the ad1848 driver, of ALSA OSS emulation, or OSS API?
> >
> > IIRC, it's the definition of this OSS device.
> > well, i'm not sure this is officially so.
> > but at least, /dev/audio is supposed to be in these formats, and we
> > initialize /dev/dsp as well.
> >
> > btw, for testing the OSS emulation, you can try play command included
> > in sox package.
>
> You are correct, play works correctly but catting does not. It seems,
> however, that many OSS drivers support cat a wav file directly to /dev/dsp,
> and do the detection of the format parameters internally. I guess this is not
> required by the OSS specification?
really do _many_ oss drivers support these features?
i've never thought of that...
Takashi
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: cs4248 / thinkpad 755 / 755c , patch suggestions [PATCH]]
2003-07-09 12:39 ` Takashi Iwai
@ 2003-07-09 16:05 ` Ryan Underwood
2003-07-09 16:28 ` Jaroslav Kysela
0 siblings, 1 reply; 13+ messages in thread
From: Ryan Underwood @ 2003-07-09 16:05 UTC (permalink / raw)
To: alsa-devel
Hi,
On Wed, Jul 09, 2003 at 02:39:58PM +0200, Takashi Iwai wrote:
> >
> > You are correct, play works correctly but catting does not. It seems,
> > however, that many OSS drivers support cat a wav file directly to /dev/dsp,
> > and do the detection of the format parameters internally. I guess this is not
> > required by the OSS specification?
>
> really do _many_ oss drivers support these features?
> i've never thought of that...
Every one I've used has done so (Aureal Vortex2, CS4614, c-media, etc).
I don't know if it's the rule but it seems like fairly common behavior
from my experience.
In any case it's really not a big deal, just that ALSA's OSS emulation
seems to be divergent from the typical OSS driver's behavior in that
regard.
--
Ryan Underwood, <nemesis at icequake.net>, icq=10317253
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: cs4248 / thinkpad 755 / 755c , patch suggestions [PATCH]]
2003-07-09 16:05 ` Ryan Underwood
@ 2003-07-09 16:28 ` Jaroslav Kysela
2003-07-09 21:04 ` Ryan Underwood
0 siblings, 1 reply; 13+ messages in thread
From: Jaroslav Kysela @ 2003-07-09 16:28 UTC (permalink / raw)
To: Ryan Underwood; +Cc: alsa-devel@lists.sourceforge.net
On Wed, 9 Jul 2003, Ryan Underwood wrote:
>
> Hi,
>
> On Wed, Jul 09, 2003 at 02:39:58PM +0200, Takashi Iwai wrote:
> > >
> > > You are correct, play works correctly but catting does not. It seems,
> > > however, that many OSS drivers support cat a wav file directly to /dev/dsp,
> > > and do the detection of the format parameters internally. I guess this is not
> > > required by the OSS specification?
> >
> > really do _many_ oss drivers support these features?
> > i've never thought of that...
>
> Every one I've used has done so (Aureal Vortex2, CS4614, c-media, etc).
> I don't know if it's the rule but it seems like fairly common behavior
> from my experience.
>
> In any case it's really not a big deal, just that ALSA's OSS emulation
> seems to be divergent from the typical OSS driver's behavior in that
> regard.
Show me a wav header parser code in these drivers. I guess that you are
a bit confused. The standard parameters are 8000Hz, mono, 8-bit unsigned
(/dev/dsp) or 8000Hz, mono, 16-bit unsigned (/dev/dsp16) or 8000Hz,
mono, muLaw (/dev/audio) as far as I work with sound drivers since 1994.
Jaroslav
-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: cs4248 / thinkpad 755 / 755c , patch suggestions [PATCH]]
2003-07-09 16:28 ` Jaroslav Kysela
@ 2003-07-09 21:04 ` Ryan Underwood
0 siblings, 0 replies; 13+ messages in thread
From: Ryan Underwood @ 2003-07-09 21:04 UTC (permalink / raw)
To: alsa-devel@lists.sourceforge.net
Hi Jaroslav,
On Wed, Jul 09, 2003 at 06:28:05PM +0200, Jaroslav Kysela wrote:
> Show me a wav header parser code in these drivers. I guess that you are
> a bit confused. The standard parameters are 8000Hz, mono, 8-bit unsigned
> (/dev/dsp) or 8000Hz, mono, 16-bit unsigned (/dev/dsp16) or 8000Hz,
> mono, muLaw (/dev/audio) as far as I work with sound drivers since 1994.
You are correct that I was either confused, or always used 8kHz sound
files all the time. I unloaded ALSA and loaded up the old OSS driver to
prove you wrong, and only found out that I was wrong instead. :)
Sorry for the confusion,
--
Ryan Underwood, <nemesis at icequake.net>, icq=10317253
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2003-07-09 21:04 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-07 20:53 cs4248 / thinkpad 755 / 755c , patch suggestions [PATCH]] Ryan Underwood
2003-07-08 10:50 ` Takashi Iwai
2003-07-08 13:58 ` Ryan Underwood
2003-07-08 17:27 ` Takashi Iwai
2003-07-08 17:32 ` Ryan Underwood
2003-07-08 17:37 ` Takashi Iwai
2003-07-08 19:54 ` Ryan Underwood
2003-07-09 12:39 ` Takashi Iwai
2003-07-09 16:05 ` Ryan Underwood
2003-07-09 16:28 ` Jaroslav Kysela
2003-07-09 21:04 ` Ryan Underwood
2003-07-08 17:01 ` Ryan Underwood
2003-07-08 17:21 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.