All of lore.kernel.org
 help / color / mirror / Atom feed
* hdsp vs 16bit vs dmix
@ 2004-01-07 17:29 Patrick Shirkey
  2004-01-08 11:19 ` Takashi Iwai
  0 siblings, 1 reply; 10+ messages in thread
From: Patrick Shirkey @ 2004-01-07 17:29 UTC (permalink / raw)
  To: alsa-devel

I am seeing strange things happen while using the hdsp and dmix plugin 
and aplay as a test app.

JACK works perfectly.

I can get sound from aplay if I use this commandline:

aplay -f cd -D plughw audio.wav
Playing WAVE 'audio.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, 
Stereo
underrun!!! (at least 40.147 ms long)
underrun!!! (at least 86.223 ms long)
underrun!!! (at least 145.116 ms long)
underrun!!! (at least 79.109 ms long)
underrun!!! (at least 248.555 ms long)
underrun!!! (at least 180.442 ms long)
underrun!!! (at least 96.117 ms long)
Aborted by signal Interrupt...	

But I get an xrun every second or so which makes the card useless for 
native alsa apps .

aplay -f cd -D hw:0 audio.wav
Playing WAVE 'audio.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, 
Stereo
aplay: set_params:822: Access type not available


If I try the dmix plugin (which also works with the pci card):


  pcm.!default {
            type plug
            slave.pcm "dmixer"
         }

pcm.dmixer  {
     type dmix
     ipc_key 1234
     slave {
         pcm "hw:0"
         period_time 0
         period_size 1024
         buffer_size 4096
#        periods 128
         rate 44100
         format s16_le
     }
     bindings {
         0 0
         1 1
     }
}

ctl.dmixer {
     type hw
     card 0
}

------
  aplay -f cd -D default audio.wav
ALSA lib pcm_hw.c:324:(snd_pcm_hw_hw_params) SNDRV_PCM_IOCTL_HW_PARAMS 
failed: Device or resource busy
ALSA lib pcm_direct.c:712:(snd_pcm_direct_initialize_slave) unable to 
install hw params
ALSA lib pcm_dmix.c:827:(snd_pcm_dmix_open) unable to initialize slave
aplay: main:502: audio open error: Device or resource busy
------

For fun I tried this syntax:


  pcm.!default {
            type plughw
            slave.pcm "dmixer"
         }


------
  aplay -f cd -D default audio.wav
ALSA lib pcm.c:1900:(snd_pcm_open_conf) Cannot open shared library 
/usr/lib/alsa-lib/libasound_module_pcm_plughw.so
aplay: main:502: audio open error: No such file or directory
------


-- 
Patrick Shirkey - Boost Hardware Ltd.
Http://www.boosthardware.com
Http://www.djcj.org - The Linux Audio Users guide
========================================


  Apparently upon the beginning of the barrage, the donkey broke 
discipline and panicked, toppling the cart. At that point, the rockets 
disconnected from the timer, leaving them strewn around the street. 
Tethered to the now toppled cart, the donkey was unable to escape before 
the arrival of U.S. troops.

United Press International
Rockets on donkeys hit major Baghdad sites

By P. MITCHELL PROTHERO
Published 11/21/2003 11:13 AM



-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html

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

* Re: hdsp vs 16bit vs dmix
  2004-01-08 11:19 ` Takashi Iwai
@ 2004-01-08 11:16   ` Jaroslav Kysela
  2004-01-08 15:49   ` Patrick Shirkey
  2004-01-26 12:57   ` Thomas Charbonnel
  2 siblings, 0 replies; 10+ messages in thread
From: Jaroslav Kysela @ 2004-01-08 11:16 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Patrick Shirkey, alsa-devel

On Thu, 8 Jan 2004, Takashi Iwai wrote:

> > pcm.dmixer  {
> >      type dmix
> >      ipc_key 1234
> >      slave {
> >          pcm "hw:0"
> >          period_time 0
> >          period_size 1024
> >          buffer_size 4096
> > #        periods 128
> >          rate 44100
> >          format s16_le

Use 'format s32_le' here. Your harware uses 32-bit (resp. 24-bit stored in 
32-bit word samples).

						Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html

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

* Re: hdsp vs 16bit vs dmix
  2004-01-07 17:29 hdsp vs 16bit vs dmix Patrick Shirkey
@ 2004-01-08 11:19 ` Takashi Iwai
  2004-01-08 11:16   ` Jaroslav Kysela
                     ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Takashi Iwai @ 2004-01-08 11:19 UTC (permalink / raw)
  To: Patrick Shirkey; +Cc: alsa-devel

At Thu, 08 Jan 2004 02:29:13 +0900,
Patrick Shirkey wrote:
> 
> I am seeing strange things happen while using the hdsp and dmix plugin 
> and aplay as a test app.
> 
> JACK works perfectly.
> 
> I can get sound from aplay if I use this commandline:
> 
> aplay -f cd -D plughw audio.wav
> Playing WAVE 'audio.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, 
> Stereo
> underrun!!! (at least 40.147 ms long)
> underrun!!! (at least 86.223 ms long)
> underrun!!! (at least 145.116 ms long)
> underrun!!! (at least 79.109 ms long)
> underrun!!! (at least 248.555 ms long)
> underrun!!! (at least 180.442 ms long)
> underrun!!! (at least 96.117 ms long)
> Aborted by signal Interrupt...	
> 
> But I get an xrun every second or so which makes the card useless for 
> native alsa apps .

i'm not sure which plugin plays wrong yet.

run aplay with -v option and see which plugins and what configurations
are used.  for example, if the native hardware requires 32bit samples,
prepare 32bit samples WAV instead of 16bit, and reduce the plugin.
i don't think the rate conversion is used, so the plugins are linear,
route, and copy plugins.

my rough guess is the copy plugin.  try aplay -M option, so that mmap
mode is used.

> 
> aplay -f cd -D hw:0 audio.wav
> Playing WAVE 'audio.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, 
> Stereo
> aplay: set_params:822: Access type not available

hdsp supports only MMAP access.
aplay uses the RW access as default.


> If I try the dmix plugin (which also works with the pci card):
> 
> 
>   pcm.!default {
>             type plug
>             slave.pcm "dmixer"
>          }
> 
> pcm.dmixer  {
>      type dmix
>      ipc_key 1234
>      slave {
>          pcm "hw:0"
>          period_time 0
>          period_size 1024
>          buffer_size 4096
> #        periods 128
>          rate 44100
>          format s16_le
>      }
>      bindings {
>          0 0
>          1 1
>      }
> }
> 
> ctl.dmixer {
>      type hw
>      card 0
> }
> 
> ------
>   aplay -f cd -D default audio.wav
> ALSA lib pcm_hw.c:324:(snd_pcm_hw_hw_params) SNDRV_PCM_IOCTL_HW_PARAMS 
> failed: Device or resource busy
> ALSA lib pcm_direct.c:712:(snd_pcm_direct_initialize_slave) unable to 
> install hw params
> ALSA lib pcm_dmix.c:827:(snd_pcm_dmix_open) unable to initialize slave
> aplay: main:502: audio open error: Device or resource busy

hmm, it's wierd.  -ENODEV ?

> ------
> 
> For fun I tried this syntax:
> 
> 
>   pcm.!default {
>             type plughw
>             slave.pcm "dmixer"
>          }
> 
> 
> ------
>   aplay -f cd -D default audio.wav
> ALSA lib pcm.c:1900:(snd_pcm_open_conf) Cannot open shared library 
> /usr/lib/alsa-lib/libasound_module_pcm_plughw.so
> aplay: main:502: audio open error: No such file or directory

this one is clear.  there is no plughw type.
it's a defined pcm name.


Takashi


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html

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

* Re: hdsp vs 16bit vs dmix
  2004-01-08 11:19 ` Takashi Iwai
  2004-01-08 11:16   ` Jaroslav Kysela
@ 2004-01-08 15:49   ` Patrick Shirkey
  2004-01-08 16:05     ` Takashi Iwai
  2004-01-12 14:01     ` Justin Cormack
  2004-01-26 12:57   ` Thomas Charbonnel
  2 siblings, 2 replies; 10+ messages in thread
From: Patrick Shirkey @ 2004-01-08 15:49 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

Takashi Iwai wrote:
> At Thu, 08 Jan 2004 02:29:13 +0900,
> Patrick Shirkey wrote:
> 
>>I am seeing strange things happen while using the hdsp and dmix plugin 
>>and aplay as a test app.
>>
>>JACK works perfectly.
>>
>>I can get sound from aplay if I use this commandline:
>>
>>aplay -f cd -D plughw audio.wav
>>Playing WAVE 'audio.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, 
>>Stereo
>>underrun!!! (at least 40.147 ms long)
>>underrun!!! (at least 86.223 ms long)
>>underrun!!! (at least 145.116 ms long)
>>underrun!!! (at least 79.109 ms long)
>>underrun!!! (at least 248.555 ms long)
>>underrun!!! (at least 180.442 ms long)
>>underrun!!! (at least 96.117 ms long)
>>Aborted by signal Interrupt...	
>>
>>But I get an xrun every second or so which makes the card useless for 
>>native alsa apps .
> 
> 
> i'm not sure which plugin plays wrong yet.
> 
> run aplay with -v option and see which plugins and what configurations
> are used.  for example, if the native hardware requires 32bit samples,
> prepare 32bit samples WAV instead of 16bit, and reduce the plugin.
> i don't think the rate conversion is used, so the plugins are linear,
> route, and copy plugins.
> 
> my rough guess is the copy plugin.  try aplay -M option, so that mmap
> mode is used.
> 

IMO the test case should be a 16bit file because this is the CD standard.

-------
  aplay -v -M -f cd -D plughw audio.wav
Playing WAVE 'audio.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, 
Stereo
Plug PCM: Route conversion PCM (sformat=S32_LE)
Transformation table:
0 <- 0
1 <- 1
2 <- none
3 <- none
4 <- none
5 <- none
6 <- none
7 <- none
8 <- none
9 <- none
10 <- none
11 <- none
12 <- none
13 <- none
14 <- none
15 <- none
16 <- none
17 <- none
Its setup is:
stream       : PLAYBACK
access       : MMAP_INTERLEAVED
format       : S16_LE
subformat    : STD
channels     : 2
rate         : 44100
exact rate   : 44100 (44100/1)
msbits       : 16
buffer_size  : 8192
period_size  : 4096
period_time  : 92879
tick_time    : 10000
tstamp_mode  : NONE
period_step  : 1
sleep_min    : 0
avail_min    : 4096
xfer_align   : 4096
start_threshold  : 8192
stop_threshold   : 8192
silence_threshold: 0
silence_size : 0
boundary     : 1073741824
Slave: Hardware PCM card 0 'Hammerfall DSP' device 0 subdevice 0

Its setup is:
stream       : PLAYBACK
access       : MMAP_NONINTERLEAVED
format       : S32_LE
subformat    : STD
channels     : 18
rate         : 44100
exact rate   : 44100 (44100/1)
msbits       : 24
buffer_size  : 8192
period_size  : 4096
period_time  : 92879
tick_time    : 10000
tstamp_mode  : NONE
period_step  : 1
sleep_min    : 0
avail_min    : 4096
xfer_align   : 4096
start_threshold  : 8192
stop_threshold   : 8192
silence_threshold: 0
silence_size : 0
boundary     : 1073741824
underrun!!! (at least 683.032 ms long)
Status:
state       : XRUN
trigger_time: 1073628220.377968000
tstamp      : 1073628221.60968000
delay       : 0
avail       : 8192
avail_max   : 8192
underrun!!! (at least 280.077 ms long)
Status:
state       : XRUN
trigger_time: 1073628222.812390000
tstamp      : 1073628223.92462000
delay       : 0
avail       : 8192
avail_max   : 8192
underrun!!! (at least 179.903 ms long)
Status:
state       : XRUN
trigger_time: 1073628224.413069000
tstamp      : 1073628224.592968000
delay       : 0
avail       : 8192
avail_max   : 8192
underrun!!! (at least 143.721 ms long)
Status:
state       : XRUN
trigger_time: 1073628225.185560000
tstamp      : 1073628225.329276000
delay       : 0
avail       : 8192
avail_max   : 8192
underrun!!! (at least 9.202 ms long)
Status:
state       : XRUN
trigger_time: 1073628225.729596000
tstamp      : 1073628225.738793000
delay       : 0
avail       : 8192
avail_max   : 8192
underrun!!! (at least 126.904 ms long)
Status:
state       : XRUN
trigger_time: 1073628227.274901000
tstamp      : 1073628227.401799000
delay       : 0
avail       : 8192
avail_max   : 8192
underrun!!! (at least 225.002 ms long)
Status:
state       : XRUN
trigger_time: 1073628227.898006000
tstamp      : 1073628228.123003000
delay       : 0
avail       : 8192
avail_max   : 8192
underrun!!! (at least 163.350 ms long)
Status:
state       : XRUN
trigger_time: 1073628229.57122000
.
.
.
------

>>
>>  aplay -f cd -D default audio.wav
>>ALSA lib pcm.c:1900:(snd_pcm_open_conf) Cannot open shared library 
>>/usr/lib/alsa-lib/libasound_module_pcm_plughw.so
>>aplay: main:502: audio open error: No such file or directory
> 
> 
> this one is clear.  there is no plughw type.
> it's a defined pcm name.
> 

Hmm. This would appear to be a problem. While I'm not ecouraging people 
to use the hdsp as a standard consumer playback device... My customer 
(who runs windows mostly) is expecting to be able to view videos etc 
with this device simply because he can in his windows env. Should I be 
encouraging him to purchase a second card or can this be fixed using ALSA?




-- 
Patrick Shirkey - Boost Hardware Ltd.
Http://www.boosthardware.com
Http://www.djcj.org - The Linux Audio Users guide
========================================


  Apparently upon the beginning of the barrage, the donkey broke 
discipline and panicked, toppling the cart. At that point, the rockets 
disconnected from the timer, leaving them strewn around the street. 
Tethered to the now toppled cart, the donkey was unable to escape before 
the arrival of U.S. troops.

United Press International
Rockets on donkeys hit major Baghdad sites

By P. MITCHELL PROTHERO
Published 11/21/2003 11:13 AM



-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html

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

* Re: hdsp vs 16bit vs dmix
  2004-01-08 15:49   ` Patrick Shirkey
@ 2004-01-08 16:05     ` Takashi Iwai
  2004-01-12 14:01     ` Justin Cormack
  1 sibling, 0 replies; 10+ messages in thread
From: Takashi Iwai @ 2004-01-08 16:05 UTC (permalink / raw)
  To: Patrick Shirkey; +Cc: alsa-devel

At Fri, 09 Jan 2004 00:49:34 +0900,
Patrick Shirkey wrote:
> 
> Takashi Iwai wrote:
> > At Thu, 08 Jan 2004 02:29:13 +0900,
> > Patrick Shirkey wrote:
> > 
> >>I am seeing strange things happen while using the hdsp and dmix plugin 
> >>and aplay as a test app.
> >>
> >>JACK works perfectly.
> >>
> >>I can get sound from aplay if I use this commandline:
> >>
> >>aplay -f cd -D plughw audio.wav
> >>Playing WAVE 'audio.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, 
> >>Stereo
> >>underrun!!! (at least 40.147 ms long)
> >>underrun!!! (at least 86.223 ms long)
> >>underrun!!! (at least 145.116 ms long)
> >>underrun!!! (at least 79.109 ms long)
> >>underrun!!! (at least 248.555 ms long)
> >>underrun!!! (at least 180.442 ms long)
> >>underrun!!! (at least 96.117 ms long)
> >>Aborted by signal Interrupt...	
> >>
> >>But I get an xrun every second or so which makes the card useless for 
> >>native alsa apps .
> > 
> > 
> > i'm not sure which plugin plays wrong yet.
> > 
> > run aplay with -v option and see which plugins and what configurations
> > are used.  for example, if the native hardware requires 32bit samples,
> > prepare 32bit samples WAV instead of 16bit, and reduce the plugin.
> > i don't think the rate conversion is used, so the plugins are linear,
> > route, and copy plugins.
> > 
> > my rough guess is the copy plugin.  try aplay -M option, so that mmap
> > mode is used.
> > 
> 
> IMO the test case should be a 16bit file because this is the CD standard.

i asked it only for catching the bug.  of course, 16bit 2ch WAV should
be supported.

> -------
>   aplay -v -M -f cd -D plughw audio.wav
> Playing WAVE 'audio.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, 
> Stereo
> Plug PCM: Route conversion PCM (sformat=S32_LE)
> Transformation table:
(snip)

ok, it's not in copy plugin.

> Slave: Hardware PCM card 0 'Hammerfall DSP' device 0 subdevice 0
> 
> Its setup is:
> stream       : PLAYBACK
> access       : MMAP_NONINTERLEAVED
> format       : S32_LE
> subformat    : STD
> channels     : 18
> rate         : 44100
> exact rate   : 44100 (44100/1)
> msbits       : 24
> buffer_size  : 8192
> period_size  : 4096
> period_time  : 92879

the buffer isn't large, it's 180 msec.
to get rid of the possibility of general kernel scheduling problem,
try to start aplay with nice -10 (as root)

	# nice -n -10 aplay foo.wav

> >>  aplay -f cd -D default audio.wav
> >>ALSA lib pcm.c:1900:(snd_pcm_open_conf) Cannot open shared library 
> >>/usr/lib/alsa-lib/libasound_module_pcm_plughw.so
> >>aplay: main:502: audio open error: No such file or directory
> > 
> > 
> > this one is clear.  there is no plughw type.
> > it's a defined pcm name.
> > 
> 
> Hmm. This would appear to be a problem. While I'm not ecouraging people 
> to use the hdsp as a standard consumer playback device... My customer 
> (who runs windows mostly) is expecting to be able to view videos etc 
> with this device simply because he can in his windows env. Should I be 
> encouraging him to purchase a second card or can this be fixed using ALSA?

sorry, i can't measure how deep the problem is.  i have no this card
by myself.  but viewing a video with hdsp is like going shoping with
Ferrari, i'd like to say :)


Takashi


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html

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

* Re: hdsp vs 16bit vs dmix
  2004-01-08 15:49   ` Patrick Shirkey
  2004-01-08 16:05     ` Takashi Iwai
@ 2004-01-12 14:01     ` Justin Cormack
  2004-01-13  9:24       ` Patrick Shirkey
  1 sibling, 1 reply; 10+ messages in thread
From: Justin Cormack @ 2004-01-12 14:01 UTC (permalink / raw)
  To: Patrick Shirkey; +Cc: Takashi Iwai, alsa list

On Thu, 2004-01-08 at 15:49, Patrick Shirkey wrote:
> Takashi Iwai wrote:
> > At Thu, 08 Jan 2004 02:29:13 +0900,
> > Patrick Shirkey wrote:
> > 
> >>I am seeing strange things happen while using the hdsp and dmix plugin 
> >>and aplay as a test app.
> >>
> >>JACK works perfectly.
> >>
> >>I can get sound from aplay if I use this commandline:
> >>
> >>aplay -f cd -D plughw audio.wav
> >>Playing WAVE 'audio.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, 
> >>Stereo
> >>underrun!!! (at least 40.147 ms long)
> >>underrun!!! (at least 86.223 ms long)
> >>underrun!!! (at least 145.116 ms long)
> >>underrun!!! (at least 79.109 ms long)
> >>underrun!!! (at least 248.555 ms long)
> >>underrun!!! (at least 180.442 ms long)
> >>underrun!!! (at least 96.117 ms long)
> >>Aborted by signal Interrupt...	
> >>
> >>But I get an xrun every second or so which makes the card useless for 
> >>native alsa apps .

> Hmm. This would appear to be a problem. While I'm not ecouraging people 
> to use the hdsp as a standard consumer playback device... My customer 
> (who runs windows mostly) is expecting to be able to view videos etc 
> with this device simply because he can in his windows env. Should I be 
> encouraging him to purchase a second card or can this be fixed using ALSA?

I think it may be something else in the hardware setup, as it works fine
for me. Are the disks running dma? Is there some interrupt oddness? What
kernel is it? What kind of machine? What filesystem? The fact that it
works with JACK suggests that it is a small delay that aplay doesnt cope
with well.

Justin




-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html

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

* Re: hdsp vs 16bit vs dmix
  2004-01-12 14:01     ` Justin Cormack
@ 2004-01-13  9:24       ` Patrick Shirkey
  0 siblings, 0 replies; 10+ messages in thread
From: Patrick Shirkey @ 2004-01-13  9:24 UTC (permalink / raw)
  To: Justin Cormack; +Cc: Takashi Iwai, alsa list

Justin Cormack wrote:
>
> 
> I think it may be something else in the hardware setup, as it works fine
> for me. Are the disks running dma? Is there some interrupt oddness? What
> kernel is it? What kind of machine? What filesystem? The fact that it
> works with JACK suggests that it is a small delay that aplay doesnt cope
> with well.
> 

Thanks. After this and Takashi's message I have ben convinced to look 
into the kernel and latency stuffs again.




-- 
Patrick Shirkey - Boost Hardware Ltd.
Http://www.boosthardware.com
Http://www.djcj.org - The Linux Audio Users guide
========================================


  Apparently upon the beginning of the barrage, the donkey broke 
discipline and panicked, toppling the cart. At that point, the rockets 
disconnected from the timer, leaving them strewn around the street. 
Tethered to the now toppled cart, the donkey was unable to escape before 
the arrival of U.S. troops.

United Press International
Rockets on donkeys hit major Baghdad sites

By P. MITCHELL PROTHERO
Published 11/21/2003 11:13 AM



-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html

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

* Re: hdsp vs 16bit vs dmix
  2004-01-08 11:19 ` Takashi Iwai
  2004-01-08 11:16   ` Jaroslav Kysela
  2004-01-08 15:49   ` Patrick Shirkey
@ 2004-01-26 12:57   ` Thomas Charbonnel
  2004-01-26 13:15     ` Jaroslav Kysela
  2 siblings, 1 reply; 10+ messages in thread
From: Thomas Charbonnel @ 2004-01-26 12:57 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Patrick Shirkey, alsa-devel

Takashi Iwai wrote :
>>
>>------
>>  aplay -f cd -D default audio.wav
>>ALSA lib pcm_hw.c:324:(snd_pcm_hw_hw_params) SNDRV_PCM_IOCTL_HW_PARAMS 
>>failed: Device or resource busy
>>ALSA lib pcm_direct.c:712:(snd_pcm_direct_initialize_slave) unable to 
>>install hw params
>>ALSA lib pcm_dmix.c:827:(snd_pcm_dmix_open) unable to initialize slave
>>aplay: main:502: audio open error: Device or resource busy
> 
> 
> hmm, it's wierd.  -ENODEV ?
> 

Old thread, but I missed it then. Indeed the dmix plugin doesn't play 
nicely with the hdsp.
The above give -ENODEV because if you don't specify 'channels 18' (for a 
multiface) in the dmix slave definition, the way the hw param settings 
is done tries to switch the card to double speed mode (there are less 
channels then, I guess it's closer to the 2 channels requested).
You should have the following in your logs :
cannot change speed mode (capture PID = -1, playback PID = 3888)

Now if you do specify 'channels 18' in the dmix slave definition, the 
error is as follows :
aplay: set_params:827: Sample format non available
I have 'format S32_LE' set in the dmix slave definition, but it doesn't 
seem to be taken into account.

Thomas




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn

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

* Re: hdsp vs 16bit vs dmix
  2004-01-26 12:57   ` Thomas Charbonnel
@ 2004-01-26 13:15     ` Jaroslav Kysela
  2004-01-26 14:10       ` Thomas Charbonnel
  0 siblings, 1 reply; 10+ messages in thread
From: Jaroslav Kysela @ 2004-01-26 13:15 UTC (permalink / raw)
  To: Thomas Charbonnel; +Cc: Takashi Iwai, Patrick Shirkey, alsa-devel

On Mon, 26 Jan 2004, Thomas Charbonnel wrote:

> Now if you do specify 'channels 18' in the dmix slave definition, the 
> error is as follows :
> aplay: set_params:827: Sample format non available
> I have 'format S32_LE' set in the dmix slave definition, but it doesn't 
> seem to be taken into account.

It should be. Did you used 'aplay -D plug:your_dmix'?

						Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn

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

* Re: hdsp vs 16bit vs dmix
  2004-01-26 13:15     ` Jaroslav Kysela
@ 2004-01-26 14:10       ` Thomas Charbonnel
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Charbonnel @ 2004-01-26 14:10 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: Takashi Iwai, Patrick Shirkey, alsa-devel

Jaroslav Kysela wrote :
> On Mon, 26 Jan 2004, Thomas Charbonnel wrote:
> 
> 
>>Now if you do specify 'channels 18' in the dmix slave definition, the 
>>error is as follows :
>>aplay: set_params:827: Sample format non available
>>I have 'format S32_LE' set in the dmix slave definition, but it doesn't 
>>seem to be taken into account.
> 
> 
> It should be. Did you used 'aplay -D plug:your_dmix'?
> 
> 						Jaroslav
> 

You're right, I only used '-D my_dmix'.
Using '-D plug:my_dmix' works properly, so I guess the problem is 
solved, thanks !

For the record here's the working .asoundrc section :

pcm.hdsp_dmix {
     type dmix
     ipc_key 1024
     slave {
         pcm {
             type hw
             card 2
         }
         rate 44100
         format S32_LE
         channels 18
     }
}

Of course people will have to tweak the card and channels number to 
match their setup.

Thomas




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn

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

end of thread, other threads:[~2004-01-26 14:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-07 17:29 hdsp vs 16bit vs dmix Patrick Shirkey
2004-01-08 11:19 ` Takashi Iwai
2004-01-08 11:16   ` Jaroslav Kysela
2004-01-08 15:49   ` Patrick Shirkey
2004-01-08 16:05     ` Takashi Iwai
2004-01-12 14:01     ` Justin Cormack
2004-01-13  9:24       ` Patrick Shirkey
2004-01-26 12:57   ` Thomas Charbonnel
2004-01-26 13:15     ` Jaroslav Kysela
2004-01-26 14:10       ` Thomas Charbonnel

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.