Opened 7 years ago

Closed 6 years ago

#1978 closed defect (duplicate)

TamTam is silent under qemu

Reported by: MitchellNCharity Owned by: Nat
Priority: normal Milestone: Opportunity
Component: tamtam-activity Version:
Keywords: Cc:
Blocked By: Blocking:
Deployments affected: Action Needed: never set
Verified: no

Description

TamTam is silent in devel_ext3 images running in qemu (build 494). But Etoy's sound works. Both have been true for a long time.

I've not knowingly tried other activities which generate sound, so I don't know if this is an obstacle to using emulation for development or not.

Attachments (2)

TamTam_DEBUG.log (5.1 KB) - added by MitchellNCharity 7 years ago.
Build 496, running on qemu. DEBUG file with "10". Started TamTam, selected left app, clicked on three instruments.
clooper.log (819 bytes) - added by MitchellNCharity 7 years ago.
/home/olpc/.sugar/default/tamtam/clooper.log; build 602; TamTamJam; Config.py with PLUGIN_VERBOSE = 2

Download all attachments as: .zip

Change History (13)

comment:1 in reply to: ↑ description Changed 7 years ago by Nat

TamTam uses Csound and if I recall correctly Csound doesn't work on Qemu, sadly.

comment:2 Changed 7 years ago by jg

  • Component changed from distro to kernel
  • Milestone changed from Untriaged to CTest
  • Owner changed from jg to dilinger

This seems much more likely to be a driver problem than CSound's problem. Is there an alsa driver supported by qemu?

comment:3 Changed 7 years ago by MitchellNCharity

Re alsa driver, yes. emu can emulate an es1370. And 'modprobe snd_ens1370' works.

On starting TamTam, the following error goes by:

oss: Could not initialize ADC
oss: Failed to open `/dev/dsp'
oss: Reason: Device or resource busy
oss: Could not initialize ADC
oss: Failed to open `/dev/dsp'
oss: Reason: Device or resource busy
audio: Failed to create voice `es1370.adc'

comment:4 Changed 7 years ago by MitchellNCharity

The "Failed to open '/dev/dsp'" errors were a red herring. My own host side problem. Once resolved, the is no error, but as ususal, no tamtam sound either.

I can run csound to generate a wav file. And playwav works.

playwave TamTam.activity/Resources/Sounds/didjeridu works.

A DEBUG 10 trace of a tamtam run is attached. I started tamtam, and cliked on three instruments.

Changed 7 years ago by MitchellNCharity

Build 496, running on qemu. DEBUG file with "10". Started TamTam, selected left app, clicked on three instruments.

comment:5 in reply to: ↑ description Changed 7 years ago by jaberg

Replying to MitchellNCharity:

TamTam is silent in devel_ext3 images running in qemu (build 494). But Etoy's sound works. Both have been true for a long time.

I've not knowingly tried other activities which generate sound, so I don't know if this is an obstacle to using emulation for development or not.

To see if the problem is related to how my plugin initializes the sound device, could you please do the following?

  • edit the Config.py file in the TamTam activity folder,
    • change the line PLUGIN_VERBOSE = 0 to PLUGIN_VERBOSE = 2
  • re-run tamtam, and look for a file in your account's tamtam folder called clooper.log
    • ( this folder is defined in python as env.get_profile_path() + '/tamtam' )
  • review clooper.log for a more helpful error message, and maybe attach it here too

Changed 7 years ago by MitchellNCharity

/home/olpc/.sugar/default/tamtam/clooper.log; build 602; TamTamJam; Config.py with PLUGIN_VERBOSE = 2

comment:6 Changed 7 years ago by MitchellNCharity

Build 602, qemu 0.8.2-4.fc6.x86_64, kqemu 1.3.0-2 on 2.6.22.7.

Command line:

qemu-system-x86_64 -soundhw es1370 -serial tty -kernel-kqemu -net user -net nic,model=rtl8139 -hda xo-602a.img

From /var/log/messages:

[ 1036.915838] Advanced Linux Sound Architecture Driver Version 1.0.14 (Thu May 31 09:03:25 2007 UTC).
[ 1036.984873] ALSA device list:
[ 1037.024169] No soundcards found.

Probing:

# lsmod
Module Size Used by
i2c_dev 7268 0
mousedev 11192 1
serio_raw 6628 0
psmouse 22700 0
snd_ens1370 17828 1
snd_rawmidi 23360 1 snd_ens1370
snd_seq_device 7660 1 snd_rawmidi
snd_ak4531_codec 8448 1 snd_ens1370
8139cp 21344 0
mii 5056 1 8139cp
ide_disk 13472 2
piix 8772 0 [permanent]
ide_core 88792 2 ide_disk,piix

# lspci
...
00:04.0 Multimedia audio controller: Ensoniq ES1370 [AudioPCI]

# cat /proc/asound/cards

0 [AudioPCI ]: ENS1370 - Ensoniq AudioPCI

Ensoniq AudioPCI ENS1370 at 0xc200, irq 9

This works:

cat /usr/share/sounds/alsa/Side_Left.wav | gst-launch fdsrc fd=0 ! wavparse ! alsasink

clooper.log attached.

I'm sorry for the delay.

comment:7 Changed 7 years ago by dilinger

  • Component changed from kernel to tamtam-activity
  • Owner changed from dilinger to Nat

comment:8 Changed 7 years ago by jg

  • Milestone changed from Untriaged to Opportunity (please help!)

comment:9 Changed 7 years ago by mihi

I don't really know anything about ALSA programming, but I tried to debug build 622 in qemu a bit:

  • It seems that clooper disables resampling in ALSA and tries to resample itself to 16000 and multiples of it.
  • at least on my PC, the only "natively" supported sampling rate in qemu is 47040 Hz. I don't know if that depends on the native sampling rates of the host.
  • editing Config.py and setting PLUGIN_RATE from 16000 to 15680 (one third) creates strange noise but you can hear the samples (tested in TamTamJam)
  • setting the sample rate to 23520 works for me.
  • Tested only with TamTam Jam, but should work with the others as well.

I am aware that this is only a workaround; the proper solution would be to automatically determine the best sampling rate (or to enable automatic resampling if no rate is available).

comment:10 Changed 7 years ago by Nat

Just to tell that we recently fixed an issue and that sound works better when running TamTam under Parallels. It's not perfect yet but much better than it was.

comment:11 Changed 6 years ago by alsroot

  • Action Needed set to never set
  • Resolution set to duplicate
  • Status changed from new to closed

it was fixed in #9136
by using snd_pcm_hw_params_set_rate_near() to set proper rate

Note: See TracTickets for help on using tickets.