CRAS breaks alsa programs

183 views
Skip to first unread message

Taylor LeMasurier-Wren

unread,
May 25, 2012, 10:53:45 PM5/25/12
to chromium-...@chromium.org
I build a couple of custom commandline apps to compensate for my CR-48's low processing power, one of them is mplayer2. Most videos I have are unwatchable without it. However, the latest version of Chrome OS introduced CRAS, the new audio server, and it seems to have broken alsa in mplayer2. I either have no audio, or if I do, whenever I try to fast forward, it crashes the program with this:
[AO_ALSA] Write error: Broken pipe
[AO_ALSA] Trying to reset soundcard.
CRAS add failed

That repeats several times until I get a signal 11.
My question is: Can I patch or modify mplayer to somehow play nice with CRAS, or is it just time to install a real Linux OS on my Cr-48? 

Dylan Reid

unread,
May 27, 2012, 11:45:09 PM5/27/12
to ripp...@gmail.com, chromium-...@chromium.org
On Fri, May 25, 2012 at 7:53 PM, Taylor LeMasurier-Wren
<ripp...@gmail.com> wrote:
> I build a couple of custom commandline apps to compensate for my CR-48's low
> processing power, one of them is mplayer2. Most videos I have are
> unwatchable without it. However, the latest version of Chrome OS introduced
> CRAS, the new audio server, and it seems to have broken alsa in mplayer2. I
> either have no audio, or if I do, whenever I try to fast forward, it crashes
> the program with this:
>>
>> [AO_ALSA] Write error: Broken pipe
>> [AO_ALSA] Trying to reset soundcard.
>> CRAS add failed
Interesting, could you attach the contents of /var/log/messages when
that happens? I haven't tried mplayer through CRAS on ChromeOS, but do
use it on my desktop.
>
>
> That repeats several times until I get a signal 11.
> My question is: Can I patch or modify mplayer to somehow play nice with
> CRAS, or is it just time to install a real Linux OS on my Cr-48?
you can tell mplayer to skip CRAS and talk directly to alsa. This has
the caveat that the audio won't be mixed with other streams on your
system, but should work as long as nothing else is playing audio when
you start mplayer.

You'll want an mplayer command similar to this:

$ mplayer -ao alsa:device=plughw=0.0 <filename>
>
> --
> Chromium OS discuss mailing list: chromium-...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-os-discuss?hl=en

Taylor LeMasurier-Wren

unread,
May 28, 2012, 12:55:52 PM5/28/12
to chromium-...@chromium.org, ripp...@gmail.com
Thanks, that worked!
Although, now I'm having issues with volume control. I can sorta work around it with -softvol, but that depends on the initial volume of the card. Using mixer-channel Master doesn't work anymore. I seem to need to set a decent volume using alsamixer -c 0 before I can start mplayer with softvol.

Also, here's some of the output in my /var/log/messages:
2012-05-28T11:48:28.411426-05:00 localhost cras_server[1873]: stream 0 frames 16384, cb_thresh 4096, shm_size 131072
2012-05-28T11:48:28.411490-05:00 localhost cras_server[1873]: Connect to /var/run/cras/.cras_aud-c710000
2012-05-28T11:48:28.412872-05:00 localhost cras_server[1873]: Configure alsa device hw:0,0 rate 48000Hz, 2 channels
2012-05-28T11:48:28.565004-05:00 localhost cras_server[1873]: period, buffer size set to 8192, 16384
2012-05-28T11:48:28.569442-05:00 localhost cras_server[1873]: Send connected for stream c710000
2012-05-28T11:48:28.570101-05:00 localhost cras_client[1381]: format convert output: stream:2 48000 1 hw: 2 48000 2
2012-05-28T11:48:28.570222-05:00 localhost cras_client[1381]: Convert from 1 to 2 channels.
2012-05-28T11:48:28.570278-05:00 localhost cras_client[1381]: setrlimit 10 failed: 1
2012-05-28T11:48:28.570876-05:00 localhost cras_client[1381]: accept on socket
2012-05-28T11:48:28.570946-05:00 localhost cras_client[1381]: audio thread started
2012-05-28T11:48:28.993969-05:00 localhost cras_server[1873]: cb_timeouts:1
2012-05-28T11:48:28.994053-05:00 localhost cras_server[1873]: overruns:0
2012-05-28T11:48:28.994122-05:00 localhost cras_server[1873]: underruns:0
2012-05-28T11:48:29.244503-05:00 localhost cras_server[1873]: stream 0 frames 16384, cb_thresh 4096, shm_size 131072
2012-05-28T11:48:29.244565-05:00 localhost cras_server[1873]: Connect to /var/run/cras/.cras_aud-c720000
2012-05-28T11:48:29.245716-05:00 localhost cras_server[1873]: Configure alsa device hw:0,0 rate 48000Hz, 2 channels
2012-05-28T11:48:29.245775-05:00 localhost cras_server[1873]: period, buffer size set to 8192, 16384
2012-05-28T11:48:29.245809-05:00 localhost cras_server[1873]: Send connected for stream c720000
2012-05-28T11:48:29.245842-05:00 localhost cras_client[1381]: format convert output: stream:2 48000 1 hw: 2 48000 2
2012-05-28T11:48:29.245876-05:00 localhost cras_client[1381]: Convert from 1 to 2 channels.
2012-05-28T11:48:29.248557-05:00 localhost cras_client[1381]: setrlimit 10 failed: 1
2012-05-28T11:48:29.248919-05:00 localhost cras_client[1381]: accept on socket
2012-05-28T11:48:29.249269-05:00 localhost cras_client[1381]: audio thread started
2012-05-28T11:48:29.674764-05:00 localhost cras_server[1873]: alsa cb error -5
2012-05-28T11:48:29.674852-05:00 localhost cras_server[1873]: cb_timeouts:3
2012-05-28T11:48:29.674906-05:00 localhost cras_server[1873]: overruns:0
2012-05-28T11:48:29.674961-05:00 localhost cras_server[1873]: Failed to remove the stream
2012-05-28T11:48:29.675015-05:00 localhost cras_server[1873]: underruns:0
2012-05-28T11:48:29.675069-05:00 localhost cras_server[1873]: handle message -22
2012-05-28T11:48:35.016803-05:00 localhost cras_server[1873]: read err, removing client 3186
2012-05-28T11:48:35.017047-05:00 localhost cras_server[1873]: read err, removing client 3185

Taylor LeMasurier-Wren

unread,
May 28, 2012, 1:00:04 PM5/28/12
to chromium-...@chromium.org, ripp...@gmail.com
 Okay, I figured out that I could control voume by using -mixer Master instead of mixer-channel
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages