Discussion:
[Alsa-user] Multiple rates with dmix plugin
Andrew Martin
2004-06-26 03:24:00 UTC
Permalink
Hello,

I'm wondering if it's possible to have software mixing via the dmix
plugin, but still be able to choose either 48000hz or 44100hz as the
rate for a specific app. Something like having two dmix statements in
.asoundrc. Being able to specify 'mplayer -ao alsa:dmix48' would be
ideal. I currently have one dmix block with 'rate 44100'.

Alternatively, I would not mind having 48KHz audio resampled to 44.1KHz
if I could get it to work properly. Whenever I have a song paused in
XMMS (alsa output plugin), and then attempt to play 48KHz audio in
mplayer (alsa output), I hear a distorted crackling noise in the audio.
Interestingly, this does not happen when a song is *stopped* in XMMS.

I'm using ALSA 1.05a with kernel 2.6.7 on Debian (sarge). I have a
M-Audio Revolution 7.1 card (Envy24HT chipset - driver does not support
hardware mixing). My current .asoundrc is as follows:


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

pcm.dmix44 {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 8192
#periods 128
rate 44100
}

bindings {
0 0
1 1
}
}


Thanks,

Andrew Martin
Florian Schmidt
2004-06-26 08:34:00 UTC
Permalink
On Sat, 26 Jun 2004 01:23:52 -0400
Post by Andrew Martin
pcm.!default {
type plug
slave.pcm "dmix44"
}
pcm.dmix44 {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 8192
#periods 128
rate 44100 #set this to the native samplerate of your card
#if it doesn't have one, comment out..
Post by Andrew Martin
}
bindings {
0 0
1 1
}
}
pcm.pdmixed {
type plug
slave.pcm "dmixed"
}


and use the pdmixed device in your alsa app. the plug layer does automatic samplerate conversion, etc.. you could also use "plug:dmix44" as ddevice name, but some commandline tools choke on the colon ":"..

flo
--
Palimm Palimm!
Florian Schmidt
2004-06-27 23:09:08 UTC
Permalink
On Sat, 26 Jun 2004 12:39:16 +0200
Florian Schmidt <***@gmx.net> wrote:

oops [see below]
Post by Florian Schmidt
On Sat, 26 Jun 2004 01:23:52 -0400
Post by Andrew Martin
pcm.!default {
type plug
slave.pcm "dmix44"
}
pcm.dmix44 {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 8192
#periods 128
rate 44100 #set this to the native samplerate of your card
#if it doesn't have one, comment out..
Post by Andrew Martin
}
bindings {
0 0
1 1
}
}
pcm.pdmixed {
type plug
slave.pcm "dmixed"
}
should be:

pcm.pdmixed {
type plug
slave.pcm "dmix44"
}
Post by Florian Schmidt
and use the pdmixed device in your alsa app. the plug layer does automatic samplerate conversion, etc.. you could also use "plug:dmix44" as ddevice name, but some commandline tools choke on the colon ":"..
flo
--
Palimm Palimm!
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Alsa-user mailing list
https://lists.sourceforge.net/lists/listinfo/alsa-user
--
Palimm Palimm!
http://affenbande.org/~tapas/wiki
Dominique Dumont
2004-06-26 09:37:06 UTC
Permalink
Post by Andrew Martin
Hello,
I'm wondering if it's possible to have software mixing via the dmix
plugin, but still be able to choose either 48000hz or 44100hz as the
rate for a specific app. Something like having two dmix statements in
.asoundrc. Being able to specify 'mplayer -ao alsa:dmix48' would be
ideal. I currently have one dmix block with 'rate 44100'.
AFAIK you have to use a "type rate" device to have a correct
resampling. For isntance:

pcm.nforce {
type rate
slave {
pcm "hw:0,0"
rate 44100
}
}
Post by Andrew Martin
pcm.dmix44 {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 8192
#periods 128
rate 44100
}
I'd use:


pcm.dmix44 {
type rate
rate 44100
slave {
pcm "hw:0,0"
}
}

HTH
Maykel Moya
2004-06-27 20:28:06 UTC
Permalink
Post by Andrew Martin
Alternatively, I would not mind having 48KHz audio resampled to 44.1KHz
if I could get it to work properly. Whenever I have a song paused in
XMMS (alsa output plugin), and then attempt to play 48KHz audio in
mplayer (alsa output), I hear a distorted crackling noise in the audio.
Interestingly, this does not happen when a song is *stopped* in XMMS.
I had the same problem, fixed it removing the line of rate in asound.
conf.

Regards
mike
Robert Rozman
2004-06-27 22:51:32 UTC
Permalink
Hi,

could you give more detail about what line did you remove ? Could you share
your asoundrc ?

I'm having similar problems and still didn't find a solution ...

Thanks,

Robert.

----- Original Message -----
From: "Maykel Moya" <***@icc-cuba.com>
To: <alsa-***@lists.sourceforge.net>
Sent: Monday, June 28, 2004 12:27 AM
Subject: Re: [Alsa-user] Multiple rates with dmix plugin
Post by Maykel Moya
Post by Andrew Martin
Alternatively, I would not mind having 48KHz audio resampled to 44.1KHz
if I could get it to work properly. Whenever I have a song paused in
XMMS (alsa output plugin), and then attempt to play 48KHz audio in
mplayer (alsa output), I hear a distorted crackling noise in the audio.
Interestingly, this does not happen when a song is *stopped* in XMMS.
I had the same problem, fixed it removing the line of rate in asound.
conf.
Regards
mike
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Alsa-user mailing list
https://lists.sourceforge.net/lists/listinfo/alsa-user
Maykel Moya
2004-06-28 00:06:01 UTC
Permalink
Post by Robert Rozman
could you give more detail about what line did you remove ? Could you share
your asoundrc ?
I'm having similar problems and still didn't find a solution ...
pcm.alsamix {
type dmix
ipc_key 1027
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
# rate 44100
# ^^^^^^^^^^ this line commented
}

bindings {
0 0
1 1
}
}

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

Regards
mike

Loading...