Skip to contentSkip to conversation

Conversion from S16 format to ALAW

DISCUSSION Manu Sharma 4 participants 5 messages Nov 16, 2004 – Nov 17, 2004

lore
Share & tools
lore
#0 lore raw

Hi all,

I am trying to sample and play alaw streams on my iPAQ 5500. The HW driver registers support for S16_LE only. So, to achieve my purpose, I register a plugin like following in my alsa.conf file:

pcm.alaw {
	type alaw
	slave {
		pcm  "hw:0.0"
		format S16_LE
	}
}

With this, when I use arecord to capture sound, I get an error "arecord: set_params:832: Sample format not available".

Is there something wrong in my configuration setup or am I missing something ? Any clues or suggestions would be appreciated.

Regards,
Manu

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#1 lore raw
Quoted 14 lines · Manu Sharma

Hi all,

I am trying to sample and play alaw streams on my iPAQ 5500. The HW driver registers support for S16_LE only. So, to achieve my purpose, I register a plugin like following in my alsa.conf file:

pcm.alaw {
	type alaw
	slave {
		pcm  "hw:0.0"
		format S16_LE
	}
}
Quoted 2 lines

With this, when I use arecord to capture sound, I get an error "arecord:
set_params:832: Sample format not available".

Could you specify the full command? It should be something like:

arecord -D alaw -f A_LAW ...

Anyway, the default device should do this job for you also:

arecord -f A_LAW ...

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#4 lore raw
In reply to Manu Sharma

At Tue, 16 Nov 2004 08:59:05 +0100,

Quoted 11 lines · Manu Sharma

Hi all,

I am trying to sample and play alaw streams on my iPAQ 5500. The HW driver registers support for S16_LE only. So, to achieve my purpose, I register a plugin like following in my alsa.conf file:

pcm.alaw {
	type alaw
	slave {
		pcm  "hw:0.0"

Typo of "0,0"?

Quoted 9 lines
		format S16_LE
	}
}

With this, when I use arecord to capture sound, I get an error "arecord:
set_params:832: Sample format not available".

Is there something wrong in my configuration setup or am I missing something ? Any clues or suggestions would be appreciated.

I didn't get the error message.

	% arecord -Dalaw -traw -fA_LAW -c2 -r44100 foo.raw

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#2 lore raw
In reply to Jaroslav Kysela

Hi,

Thanks Jaroslav and Takashi for your questions; they served as inputs !

I was not explicitly specifying the format (-f A_LAW), considering that since the plugin type itself is "alaw". I missed the fact that I specified default format of this plugin to be S16_LE in my alsa.conf !

I have another question about the warning given in function header of snd_pcm_alaw_open (same applies for corresponding mulaw function).

Does the warning suggest that applications should not be using this function directly, they should instead configure their alsa.conf and use snd_pcm_open ?

Manu

Quoted 24 lines · Jaroslav Kysela
Quoted 12 lines · Manu Sharma

Hi all,

I am trying to sample and play alaw streams on my iPAQ 5500. The HW driver registers support for S16_LE only. So, to achieve my purpose, I register a plugin like following in my alsa.conf file:

pcm.alaw {
	type alaw
	slave {
		pcm  "hw:0.0"
		format S16_LE
	}
}
Quoted 1 line

With this, when I use arecord to capture sound, I get an error "arecord: set_params:832: Sample format not available".

Could you specify the full command? It should be something like:

arecord -D alaw -f A_LAW ...

Anyway, the default device should do this job for you also:

Quoted 10 lines

arecord -f A_LAW ...

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#3 lore raw
Quoted 6 lines · Manu Sharma

I have another question about the warning given in function header of snd_pcm_alaw_open (same applies for corresponding mulaw function).

Does the warning suggest that applications should not be using this function directly, they should instead configure their alsa.conf and use snd_pcm_open ?

Yes. The way how alsa-lib creates plugins might change in the future.

HTH
Clemens

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8