[mpg123-devel] [ mpg123-Bugs-1547470 ] ALSA output fails on x86-64 64-bit
Brought to you by:
sobukus
From: SourceForge.net <no...@so...> - 2011-03-28 02:48:33
|
Bugs item #1547470, was opened at 2006-08-27 12:23 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=733194&aid=1547470&group_id=135704 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: mpg123 Group: 0.60-beta5 Status: Closed Resolution: Fixed Priority: 5 Private: No Submitted By: Stanley (sw_stanley) Assigned to: Nobody/Anonymous (nobody) Summary: ALSA output fails on x86-64 64-bit Initial Comment: I compiled a 64-bit binary and a 32-bit binary of mpg123 0.60-beta6 (using --with-cpu=generic_fpu for fair test) When playing an mp3 file using 64-bit version on Gentoo Linux, only OSS output works. ALSA output is just silence, but decoder exits normally. Using 32-bit binary, both output works. Is it something 64-bit related? ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2011-03-28 02:48 Message: Index.. Neat :) ---------------------------------------------------------------------- Comment By: Stanley (sw_stanley) Date: 2006-11-10 12:37 Message: Logged In: YES user_id=1584814 With ALSA 1.0.13, the output now works. May someone make a note of this on the homepage? ---------------------------------------------------------------------- Comment By: Clemens Ladisch (cladisch) Date: 2006-11-03 17:08 Message: Logged In: YES user_id=240068 There was a bug in the handling of the threshold values in the sample rate converter plugin. Please try the latest version of alsa-lib. ---------------------------------------------------------------------- Comment By: Thomas Orgis (sobukus) Date: 2006-10-20 11:57 Message: Logged In: YES user_id=470743 I guess I'll ask Clemens personally... meanwhile: any update with a possibly upgraded Alsa/Kernel? ---------------------------------------------------------------------- Comment By: Thomas Orgis (sobukus) Date: 2006-09-04 04:34 Message: Logged In: YES user_id=470743 Just to lend the word fro while from sw_stanley: Perhaps you've found an Alsa bug... but let's wait what the Alsa expert says. Clemens? ---------------------------------------------------------------------- Comment By: Stanley (sw_stanley) Date: 2006-09-02 10:32 Message: Logged In: YES user_id=1584814 I was always too quick to draw a conclusion! Here are what I actually found, hope it helps: 1)In the main code, detecting/recovering from underrun depends on the value of snd_pcm_delay. However, I never see delay becomes < 0 EVEN when written == -EPIPE. (Possibly an ALSA bug/doc error/misunderstanding) IMO, the xrun state is not recovered using snd_pcm_forward too. 2)Stop threshold is odd on my machine. When threshold == boundary, it works with 32-bit but no luck with 64-bit: After first successful write scm_pcm_writei keeps returning -EPIPE. Shouldn't be xrun prevented using boundary? ---------------------------------------------------------------------- Comment By: Stanley (sw_stanley) Date: 2006-09-01 15:57 Message: Logged In: YES user_id=1584814 I found it! The error is not caused by stop thershold or anything else, but the audio_play_samples function in audio_alsa.c! Line 221: written = snd_pcm_writei(ai->handle, buf, frames); if (written >= 0) return snd_pcm_frames_to_bytes(ai->handle, written); else return written; On my box, snd_pcm_writei always returns -32(-EPIPE) except for the first time(returns 4096). According to ALSA documentation, -ve value means 3 types of errors: -EBADFD, -EPIPE and -ESTRPIPE. AFAIK, there is no proper handling of these errors in the mpg123 code. ---------------------------------------------------------------------- Comment By: Stanley (sw_stanley) Date: 2006-08-30 14:11 Message: Logged In: YES user_id=1584814 I forgot to mention that the decoder exits after a short period of time, just like decode and output to /dev/null ---------------------------------------------------------------------- Comment By: Stanley (sw_stanley) Date: 2006-08-30 13:46 Message: Logged In: YES user_id=1584814 I'm using Gentoo Linux with gentoo-linux-2.6.17-r5 and ALSA v1.0.11, with snd-intel8x0 driver. I understand that by setting stop_threshold to boundary, ALSA would not stop device on underrun. But, this does not work well in 64-bit mode. Maybe an ALSA driver bug? ---------------------------------------------------------------------- Comment By: Clemens Ladisch (cladisch) Date: 2006-08-30 11:16 Message: Logged In: YES user_id=240068 The stop threshold is set to the boundary value to prevent underruns from stopping the device. (There's a comment right in front of that line.) The boundary value tells where the hardware/application sample pointers wrap around. It's a multiple of the buffer size and chosen to be quite large. On a 64-bit architecture it's bigger because snd_pcm_(u)frames_t has more bits. Neither of these has anything to do with the output being silent. sw_stanley, what is your kernel version and your ALSA version? ---------------------------------------------------------------------- Comment By: Stanley (sw_stanley) Date: 2006-08-30 09:28 Message: Logged In: YES user_id=1584814 32-bit: [audio_alsa.c:147] debug: Alsa buffer_size 3763 vs. boundary 986447872 64-bit: [audio_alsa.c:147] debug: Alsa buffer_size 3763 vs. boundary 4236761349448794112 ---------------------------------------------------------------------- Comment By: Thomas Orgis (sobukus) Date: 2006-08-30 02:43 Message: Logged In: YES user_id=470743 Hm, reading the alsa doc, the hw buffer size kindof makes sense to me in that place. But I don't know if the guy who kindly made that alsa code for mpg123 had something in mind with it. Could you check out the current svn version and (after ./autogen.sh) build with debugging enabled? I added output of these two possible values, looking like this for my ia32 laptop: [audio_alsa.c:147] debug: Alsa buffer_size 22050 vs. boundary 1445068800 It would be interesting to see if these values are indeed different for you in 32 or 64bit mode - or if it is even more subtle. ---------------------------------------------------------------------- Comment By: Stanley (sw_stanley) Date: 2006-08-29 03:48 Message: Logged In: YES user_id=1584814 audio_alsa.c, line 144: snd_pcm_sw_params_set_stop_threshold(ai->handle,sw,boundary) I found that in ALSA aplay utility, the stop threshold is NOT set to sw_params boundary BUT the HW buffer_size. I don't know why setting to boundary doesn't give the same effect for mpg123! However, change to HW buffer_size works for me in either 32-bit or 64-bit mode. Maybe it is a bug in my own ALSA?(If then, sorry for annoying) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=733194&aid=1547470&group_id=135704 |