maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   "Audio already in use" problem on N900 (https://talk.maemo.org/showthread.php?t=38998)

shiny 2010-01-01 20:47

[FIXED] "Audio already in use" problem on N900
 
Hello all. First post here (and I'm afraid it's a problem, sorry.) I've had an N900 since early December - amazing little device and I'm a satisfied customer. Unfortunately today something quite odd has happened, and I was wondering if anyone could shed any light on it.

It seems that somehow the internal audio system has become "locked" - whenever I try to play any audio, either nothing happens or (as in the case of Media Player) I get a message to the effect of "Audio already in use by another application." Rebooting has no effect. I recently had a random reboot I had while using maemo-pc-connectivity, which may be the root of the problem.

Some other odd behaviour too that I think may be related:

- Anyone calling by phone can't be heard
- Calling out by phone forces other caller to speakerphone
- Nokia Video on bootup plays as expected
- /usr/bin/browser hangs at 100%
- Any kind of DNS resolution appears to be broken
- Text message noises etc. are replaced by a system "beep"

I have some extras-devel/extras-testing apps installed. While comfortable with the command-line, I don't know much about the internals of the N900 so it would be great if anyone could point me in the direction of what might be going on.

Andre Klapper 2010-01-02 15:31

Re: "Audio already in use" problem on N900
 
Quote:

Originally Posted by shiny (Post 449204)
"Audio already in use by another application."

Is that the exact error message, or is it translated?

Eero Nurkkala 2010-01-02 15:43

Re: "Audio already in use" problem on N900
 
How about "lsof /dev/snd/*" from xterm
and kill the process owning the entries?

maybe post the results also, would be nice..

shiny 2010-01-02 17:51

Re: "Audio already in use" problem on N900
 
Quote:

Originally Posted by Andre Klapper (Post 449917)
Is that the exact error message, or is it translated?

Sorry for not posting the exact message - didn't have my N900 at the time. When trying to play audio through the media player I get the following Hildon banner:

Unable to play media.
Audio in use by another application.

Likewise, opening the camera gives the Standby screen and:

Unable to use camera.
Audio in use by another application.

This is a UK phone (bought from London.)

shiny 2010-01-02 18:00

Re: "Audio already in use" problem on N900
 
Quote:

Originally Posted by Eero Nurkkala (Post 449937)
How about "lsof /dev/snd/*" from xterm
and kill the process owning the entries?

maybe post the results also, would be nice..

Sure: running this as root gives the following output (apologies for the poor formatting):

COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
alsaped 1676 root 3u CHR 116,0 1746 /dev/snd/controlC0
pulseaudi 1718 root 18u CHR 116,0 1746 /dev/snd/controlC0


Killing these process makes them restart, but playing any media then results in silence for the first try, and then the "audio in use" error again.

Thanks for your advice so far. It almost feels like there might be some kind of lockfile issue, but my Linux audio knowledge is admittedly zilch.

Eero Nurkkala 2010-01-02 18:35

Re: "Audio already in use" problem on N900
 
Quote:

Originally Posted by shiny (Post 450105)
Sure: running this as root gives the following output (apologies for the poor formatting):

COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
alsaped 1676 root 3u CHR 116,0 1746 /dev/snd/controlC0
pulseaudi 1718 root 18u CHR 116,0 1746 /dev/snd/controlC0


Killing these process makes them restart, but playing any media then results in silence for the first try, and then the "audio in use" error again.

Thanks for your advice so far. It almost feels like there might be some kind of lockfile issue, but my Linux audio knowledge is admittedly zilch.

Hmm. That doesn't look bad. IIRC, if you're aplay'ing stuff and try to play MP3s at the same time from the media player, you get the "audio in use" -message.

I think you can stop / start pulseaudio with
"stop pulseaudio" and "start pulseaudio". May be worth a try.. as well as starting the pulseaudio with "pulseaudio --system -v &" (may give some traces)

also it'd be interesting to see what "aplay -Dhw:0 -fdat /dev/zero" says.

shiny 2010-01-02 18:52

Re: "Audio already in use" problem on N900
 
Quote:

Originally Posted by Eero Nurkkala (Post 450146)
Hmm. That doesn't look bad. IIRC, if you're aplay'ing stuff and try to play MP3s at the same time from the media player, you get the "audio in use" -message.

Yeah, I've seen that previously when using the Camera & Mediaplayer at the same time.

Quote:

Originally Posted by Eero Nurkkala (Post 450146)
I think you can stop / start pulseaudio with
"stop pulseaudio" and "start pulseaudio". May be worth a try.. as well as starting the pulseaudio with "pulseaudio --system -v &" (may give some traces)

also it'd be interesting to see what "aplay -Dhw:0 -fdat /dev/zero" says.

Stopping and starting pulseaudio as described works without errors, but doesn't fix the problem.

I ran the pulseaudio --system -v & commandline as above, and just happened to receive a call. Upon heading back to the terminal, I found the following errors:

E: voice-cmtspeech.c: Sending ul frame #1
.
. [Omitted]
.
E: voice-cmtspeech.c: Sending ul frame #10

And then later on:

E: voice-cmtspeech.c: cmtspeech_ul_buffer_acquire failed -1

While trying to play some media, I also got an "Unable to perform operation" message and the following which may be of interest:

I: module-alsa-sink-old.c: unsuspend hw:0...
W: module-alsa-sink-old.c: Buffer underrun ! frames : 1920

Finally, running the "aplay" command suggested appears to work, but no sound is produced.

shiny 2010-01-02 19:08

Re: "Audio already in use" problem on N900
 
Just thought that I'd add that I had a look around Bugzilla and couldn't find anything related to my search, and that I'm prepared to reflash my device if it looks likely that it'll fix it.

shiny 2010-01-03 00:14

Re: "Audio already in use" problem on N900
 
Hello again, all. I'm pleased to report that after some investigation, I've managed to fix this problem. I'll detail the problem here so hopefully anyone else who runs across this can fix it.

The problem was, as I thought, with maemo-pc-connectivity. Through what is I assume a bug, it seems to have managed to manipulate my network configuration files into a state which meant that the local loopback interface had disappeared entirely.

Somehow the following files were broken and needed fixing:

/etc/resolv.conf
Contained nothing but a comment line. I restored this to its original state from another N900.

/etc/network/interfaces
Contained just USB networking config from pc-connectivity-manager. I re-added the lines for lo and eth0 from a working N900 at the top.

Rebooting after making these changes caused my networking (and sound) to reappear. I hope this can be of some use to anyone who runs into similar problems.

If anyone would like more information to track down the cause of the problem, just shout.

Andre Klapper 2010-01-04 12:01

Re: "Audio already in use" problem on N900
 
This definitely sounds buggy and might be worth filing a bug report in bugs.maemo.org. Did you ever reflash the device and restored from a backup?


All times are GMT. The time now is 02:05.

vBulletin® Version 3.8.8