From timur at freescale.com Fri May 9 22:20:35 2008 From: timur at freescale.com (Timur Tabi) Date: Fri, 09 May 2008 16:20:35 -0500 Subject: [Alsaplayer-devel] Is alsaplayer endian-safe? Message-ID: <4824C023.2010207@freescale.com> I don't think it is, at least not for WAV files. When I try to play a WAV file on a PowerPC (big-endian) system, I get this: alsaplayer -o alsa /usr/share/apps/korganizer/sounds/lightmag.wav APLAY: Cannot identify WAV APLAY: main_chunk = 52494646 -> 46464952 APLAY: chunk_type = 57415645 -> 45564157 APLAY: sub_chunk = 666d7420 -> 20746d66 APLAY: data_chunk = 64617461 -> 61746164 APLAY: Cannot identify WAV APLAY: main_chunk = 52494646 -> 46464952 APLAY: chunk_type = 57415645 -> 45564157 APLAY: sub_chunk = 666d7420 -> 20746d66 APLAY: data_chunk = 64617461 -> 61746164 If you look at the chunk bytes, they're all reversed. This is because of this code: if (wp->main_chunk == WAV_RIFF && wp->chunk_type == WAV_WAVE && wp->sub_chunk == WAV_FMT && the 'chunk' fields are defined like this: typedef struct wav_header { u_int main_chunk; /* 'RIFF' */ u_int length; /* filelen */ u_int chunk_type; /* 'WAVE' */ u_int sub_chunk; /* 'fmt ' */ u_int sc_len; /* length of sub_chunk, =16 */ (let's ignore the fact that this code assumes that an integer is 4 bytes) So when it tries to read wp->main_chunk from memory, it will treat the 4 bytes as a big-endian integer, and WAV_RIFF is coded for little-endian only. -- Timur Tabi Linux kernel developer at Freescale From andy at carapace-systems.com Fri May 16 10:52:45 2008 From: andy at carapace-systems.com (Andy Hughes) Date: Fri, 16 May 2008 10:52:45 +0100 Subject: [Alsaplayer-devel] mp3 volume Message-ID: <482D596D.5040401@carapace-systems.com> An HTML attachment was scrubbed... URL: http://lists.tartarus.org/pipermail/alsaplayer-devel/attachments/20080516/6bce80e1/attachment.htm From lemenkov at gmail.com Fri May 16 14:12:48 2008 From: lemenkov at gmail.com (Peter Lemenkov) Date: Fri, 16 May 2008 17:12:48 +0400 Subject: [Alsaplayer-devel] mp3 volume In-Reply-To: <482D596D.5040401@carapace-systems.com> References: <482D596D.5040401@carapace-systems.com> Message-ID: Hello All! 2008/5/16 Andy Hughes : > Does alsaplayer recognise and use the volume id3 tag on mp3s? No. -- With best regards!