Opened 4 years ago

Closed 3 years ago

#10831 closed task (fixed)

XO-1.75 kernel driver for audio device

Reported by: cjb Owned by: saadia
Priority: blocker Milestone: 1.75-software
Component: kernel Version: not specified
Keywords: Cc: cjl, sascha_silbe
Blocked By: Blocking: #10914, #11155, #11187, #11193, #11219
Deployments affected: Action Needed: code
Verified: no

Description (last modified by Quozl)

Functions that are yet to be implemented:

  • audio input, test case arecord to file,
  • microphone socket detection and switching of input channel,
  • mixer controls for input, output,
  • headphone socket detection and switching of output channel,
  • analog sensor input from external microphone socket, with mixer control for enabling analog input mode.

Mitch has a driver:

http://tracker.coreboot.org/trac/openfirmware/browser/cpu/arm/olpc/1.75/alc5624.fth

and we have a vendor Linux driver in dev:/home/docs/realtek/sound/soc/codecs/.

Change History (27)

comment:1 Changed 3 years ago by martin.langhoff

  • Blocking 10914 added

comment:2 Changed 3 years ago by martin.langhoff

  • Action Needed changed from never set to code
  • Priority changed from normal to high

comment:3 Changed 3 years ago by martin.langhoff

  • Type changed from defect to task

comment:4 Changed 3 years ago by greenfeld

We kind of have an audio driver for 1.75, but there are no mixer controls for it.

If there is or should be another ticket for the audio mixer, please let me know.

comment:5 Changed 3 years ago by Quozl

os36, still needs mixer controls and input capability.

comment:6 Changed 3 years ago by erikos

What I have seen as well is that if you plug in a headphone the speakers are still used to playback the sound. And both microphone inputs (internal and external) do not produce any results. As it all work in the firmware test I presume this is driver related - what is the status of this?

comment:7 Changed 3 years ago by Quozl

agreed, also needs headphone detect and switch. let's make a list:

  • audio input, test case arecord to file,
  • microphone socket detection and switching of input channel,
  • mixer controls for input, output,
  • headphone socket detection and switching of output channel,
  • analog sensor input from external microphone socket, with mixer control for enabling analog input mode.

comment:8 Changed 3 years ago by saadia

  • Owner changed from buytenh to saadia

comment:9 Changed 3 years ago by saadia

The link to Mitch's driver is http://tracker.coreboot.org/trac/openfirmware/browser/cpu/arm/olpc/1.75/alc5631.fth and not the one mentioned in the bug description.

comment:10 Changed 3 years ago by cjl

  • Cc cjl added

comment:11 Changed 3 years ago by Quozl

  • Blocking 11155 added

(In #11155) Yes, that's due to #10831, missing software controls for audio mixer. Added the other tickets as blocking this ticket.

comment:12 Changed 3 years ago by Quozl

  • Blocking 11193 added

(In #11193) Etoys freeze when playing data is probably related to #10831, if it only occurs on XO-1.75 and not on XO-1 not XO-1.5.

comment:13 Changed 3 years ago by Quozl

  • Blocking 11187 added

comment:14 Changed 3 years ago by Quozl

  • Description modified (diff)
  • Summary changed from Audio driver for 1.75 to XO-1.75 kernel driver for audio device

comment:15 Changed 3 years ago by Quozl

  • Blocking 11197 added

(In #11197) I'm a Pippy maintainer.

Attempted to reproduce on XO-1.75 with mechanical keyboard, os41. The Bounce example runs fine, there is no output log screen of messages regarding ALSA.

Looking at the "Bounce", example, there's no use of sound, only a use of pygame.

pygame does depend on a working sound system, and since ours does not yet work (#10831 http://wiki.laptop.org/go/XO_1.75_B1#Software_Restrictions) nothing that relies on pygame will work quite correctly.

comment:16 Changed 3 years ago by Quozl

  • Blocking 11219 added

(In #11219) No action required until kernel audio driver is feature complete, then please retest.

comment:17 Changed 3 years ago by Quozl

Duplicated by Quanta in os42.

comment:18 Changed 3 years ago by Quozl

  • Blocking 11197 removed

(In #11197) Works okay in os6 after volume raised in alsamixer. Used Pippy sound examples Playsince, Playwave, and Sequence.

comment:19 Changed 3 years ago by sascha_silbe

  • Cc sascha_silbe added

comment:20 Changed 3 years ago by erikos

What is the status of recording with the driver? Using arecord does not produce any listenable results here.

comment:21 Changed 3 years ago by dsd

  • Priority changed from high to blocker

comment:22 follow-up: Changed 3 years ago by saadia

In os8, the initial setting of DC Mode Enable is wrong. Run

amixer sset "DC Mode Enable" off

and you will be able to record.

comment:23 in reply to: ↑ 22 ; follow-up: Changed 3 years ago by erikos

Replying to saadia:

In os8, the initial setting of DC Mode Enable is wrong. Run

amixer sset "DC Mode Enable" off

and you will be able to record.

Hmm, I did set 'amixer sset "DC Mode Enable" off' and the option does show 'Mono: Playback [off]' but when I do 'arecord -d 5 test.wav' I still get the following error:

[olpc@xo-6d-61-0c results]$ arecord -d 10 /tmp/test-mic.wav 
Recording WAVE '/tmp/test-mic.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
ALSA lib pcm_mmap.c:369:(snd_pcm_mmap) mmap failed: No such device or address
arecord: set_params:1116: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  U8
SUBFORMAT:  STD
SAMPLE_BITS: 8
FRAME_BITS: 8
CHANNELS: 1
RATE: 8000
PERIOD_TIME: 60000
PERIOD_SIZE: 480
PERIOD_BYTES: 480
PERIODS: 4
BUFFER_TIME: 240000
BUFFER_SIZE: 1920
BUFFER_BYTES: 1920
TICK_TIME: 0
[olpc@xo-6d-61-0c results]$

I did play with the setting and "arecord -d 5 -f S16 test.wav" does not produce the error from above, but when I play back the file there is no output.

comment:24 in reply to: ↑ 23 Changed 3 years ago by saadia

Ok, this is good feed back about the U8 bit format, and I will debug this scenario.

For recording, I have been using -f dat (which is the same as -S16 I believe). After installing OS8, I see that the default volume levels are very low. Try plugging in the headphones to listen to the sound you recorded, and use alsamixer to adjust level. For the next rev I will aim to have the default levels at a usable volume. The recorded sound is there (the test.wav file is not empty), but you need to be able to listen to it.

comment:25 Changed 3 years ago by erikos

Ok, confirmed that I can record (when "DC Mode Enable" set to 'off') but the volume is very low indeed. Even with everything cranked up in/out-put the speakers do not propagate a lot, on the headphones the volume is weak as well.

comment:26 Changed 3 years ago by erikos

When I do a recording with os881 'arecord -d 5 -f dat /tmp/test-mic.wav' and play it back I can sometimes listen to the recording and sometimes I can not. This seem to need further investigation, looks like a regression to a previous build to me.

comment:27 Changed 3 years ago by saadia

  • Resolution set to fixed
  • Status changed from new to closed

I would like to close this bug as the driver itself has been implemented. The remaining issues are covered by different bug numbers, including 11411 and 11409.

Note: See TracTickets for help on using tickets.