first use and some feedback - sound issue

ulf
 
Posts: 1
Joined: Thu Dec 08, 2016 10:57 am

first use and some feedback - sound issue

Thu Dec 08, 2016 11:07 am

hello,
my first post.
so first i want to say thankyou for that nice piece of hardware.
now i have some points i want to share.

1. register to forum
nice try to avoid spam register but the links that are shown to get the answers are "not found"
The requested URL /wiki/index/id:17 was not found on this server.

2. openwrt std. installation
the box starts without any problem, open up a wifi and ssh login is possible, password is vocore (it took me not long to figure this out)
also dhcp on ethernet works out of the box, so here no problems

3. sound
the first test with shairport works to, great default setup. but
and here is my first problem

the sound is very bad. there are some very bad interference with the wifi.
very funny if you hold the vocore very tight in your hand like try to shield it, the sound interference gets less but still there.
if you turn off wifi they are almost gone.

is this a software or design issue?

best

Vonger
 
Posts: 896
Joined: Sun Oct 19, 2014 6:00 am

Re: first use and some feedback - sound issue

Fri Dec 09, 2016 3:39 pm

1. Thank you :) the link is broken I will fix this.
2. ok
3. yes, please upgrade to latest firmware. that will reduce the noise. but it is still not a hifi device :)

stefan
 
Posts: 1
Joined: Wed Dec 14, 2016 8:38 pm

Re: first use and some feedback - sound issue

Wed Dec 14, 2016 8:47 pm

Hi,

I also received my VoCore2 yesterday and I am very happy with it. Works great so far.

However, I have the same sound issue as described by ulf. With the factory firmware I was able to stream music to the VoCore2, but had a lot of noise. I then updated to the latest firmware as you sugested Vonger (I used this image http://vonger.cn/misc/vocore2/ultimate.20161114.bin). Now there seams to be less noise, but also there is no sound any more. Although it seams to have some "effect" when I try to stream - kernel prints on serial:

Code: Select all
[  678.170000] es8388_hw_params: 44100Hz 16bit, ADC: 0, DAC: 1


Is there a simple method from the command line to test if sound output is working in general?

Regards,
Stefan

FlapSnac
 
Posts: 1
Joined: Sat Dec 17, 2016 7:13 am

Re: first use and some feedback - sound issue

Sat Dec 17, 2016 2:16 pm

stefan wrote:Is there a simple method from the command line to test if sound output is working in general?


I've used this to test the sound:
Code: Select all
uclient-fetch -O - http://icy1.abacast.com/kplu-jazz24mp3-32 | /usr/bin/madplay - -a -36

The paramter '-a -36' reduces the volume (to protect your ears and headphones), adjust it if necessary.

Vonger
 
Posts: 896
Joined: Sun Oct 19, 2014 6:00 am

Re: first use and some feedback - sound issue

Mon Dec 19, 2016 3:08 am

use madplay play mp3 or asound play wav file, also update your firmware to latest version at vocore.io/v2

ngc
 
Posts: 10
Joined: Mon Dec 12, 2016 10:42 pm

Re: first use and some feedback - sound issue

Sat Dec 24, 2016 1:32 pm

Now I'm trying to port OpenWrt/CC's codes to LEDE.
I imported es8388.c and mt7628-i2s.c to LEDE's kernel and bound both by "simple-audio" description in DTS file.
Playing works a little bit, but very noisy.
LEDE's I2S driver (ralink-i2s.c) does not work at all.

Vonger
 
Posts: 896
Joined: Sun Oct 19, 2014 6:00 am

Re: first use and some feedback - sound issue

Sun Dec 25, 2016 1:48 am

Try this code replace es8388.c(es8388.h is not necessary now)
To make it work, you will need DMA driver, ES8388 driver, and ALSA driver(I2S driver& audio codec driver).

Code: Select all
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/i2c.h>
#include <linux/regmap.h>
#include <sound/core.h>
#include <sound/soc.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>

#include "es8328.h"

void es8388_reset(struct snd_soc_codec *codec)
{
   snd_soc_write(codec, ES8328_CONTROL1, ES8328_CONTROL1_SCP_RESET);
   snd_soc_write(codec, ES8328_CONTROL1, 0x00);
}

static int es8388_hw_params(struct snd_pcm_substream *substream,
             struct snd_pcm_hw_params *params,
             struct snd_soc_dai *dai)
{
   struct snd_soc_codec *codec = dai->codec;
   if (dai->capture_active) {
      snd_soc_write(codec, 0x00, 0x06);
      snd_soc_write(codec, 0x01, 0x40);
      snd_soc_write(codec, 0x02, 0x00);
      snd_soc_write(codec, 0x03, 0x0);
      snd_soc_write(codec, 0x08, 0x00);
      snd_soc_write(codec, 0x09, 0x44); // power gain!
      snd_soc_write(codec, 0x0a, 0x04); // L1
      snd_soc_write(codec, 0x0b, 0x80); //
      snd_soc_write(codec, 0x0c, 0x4c); // 16 bit, CLK,DAT,LRCLK use I2S format
      snd_soc_write(codec, 0x0d, 0x33); // note: use default
      snd_soc_write(codec, 0x0e, 0x00);
      snd_soc_write(codec, 0x10, 0x00); // L vol, 00 0dB, c0 -96dB
      snd_soc_write(codec, 0x11, 0x00); // R vol, 00 0dB, c0 -96dB
      snd_soc_write(codec, 0x12, 0xe2);
      snd_soc_write(codec, 0x13, 0xc0);
      snd_soc_write(codec, 0x14, 0x11);
      snd_soc_write(codec, 0x15, 0x06); // note: default
      snd_soc_write(codec, 0x16, 0xf3);
   }

   pr_info("es8388_hw_params: %dHz %dbit, ADC: %d, DAC: %d\n",
      params_rate(params), params_width(params),
      dai->capture_active, dai->playback_active);
   return 0;
}

static void es8388_enable(struct snd_soc_codec *codec)
{
   snd_soc_write(codec, 0x00, 0x06);
   snd_soc_write(codec, 0x01, 0x40);
   snd_soc_write(codec, 0x02, 0x00);
   // AD and DA power on when ES8388 power on
   snd_soc_write(codec, 0x03, 0x0);
   snd_soc_write(codec, 0x04, 0x3c);

   // slave mode
   snd_soc_write(codec, 0x08, 0x00);

   // AD
   snd_soc_write(codec, 0x09, 0x44);   // power gain!
   // L use L2, R use R2
   snd_soc_write(codec, 0x0a, 0x04);   // L1
   snd_soc_write(codec, 0x0b, 0x80);   //
   snd_soc_write(codec, 0x0c, 0x4c);   // 16 bit, CLK,DAT,LRCLK use I2S format
   snd_soc_write(codec, 0x0d, 0x33); // note: use default
   snd_soc_write(codec, 0x0e, 0x00);
   snd_soc_write(codec, 0x10, 0x00);   // L vol, 00 0dB, c0 -96dB
   snd_soc_write(codec, 0x11, 0x00);   // R vol, 00 0dB, c0 -96dB
   snd_soc_write(codec, 0x12, 0xe2);
   snd_soc_write(codec, 0x13, 0xc0);
   snd_soc_write(codec, 0x14, 0x11);
   snd_soc_write(codec, 0x15, 0x06); // note: default
   snd_soc_write(codec, 0x16, 0xf3); // note: could use default?

   // DA
   snd_soc_write(codec, 0x17, 0x18);
   snd_soc_write(codec, 0x18, 0x33); // note: use default
   snd_soc_write(codec, 0x19, 0x20); // note: use default
   snd_soc_write(codec, 0x1a, 0x00); // volumn: 0dB
   snd_soc_write(codec, 0x1b, 0x00); // volumn: 0dB

   // mix
   snd_soc_write(codec, 0x26, 0x00);
   snd_soc_write(codec, 0x27, 0x80);
   snd_soc_write(codec, 0x2a, 0x80);
   snd_soc_write(codec, 0x2b, 0x80);
   snd_soc_write(codec, 0x2e, 0x1e);
   snd_soc_write(codec, 0x2f, 0x1e);
   snd_soc_write(codec, 0x30, 0x1e);
   snd_soc_write(codec, 0x31, 0x1e);
}

static int es8388_mute(struct snd_soc_dai *dai, int mute)
{
   struct snd_soc_codec *codec = dai->codec;
   static int mutestate = -1;

   if (mute == mutestate)
      return 0;
   mutestate = mute;

   if (mute) {
      es8388_reset(codec);
   } else {
      es8388_enable(codec);
   }
   return 0;
}

static const struct snd_soc_dai_ops es8388_dai_ops = {
   .hw_params = es8388_hw_params,
   .digital_mute = es8388_mute,
};

static struct snd_soc_dai_driver es8388_dai = {
   .name = "es8388-hifi",
   .playback = {
      .stream_name = "Playback",
      .channels_min = 1,
      .channels_max = 2,
      .rates = SNDRV_PCM_RATE_8000_48000,
      .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
   },
   .capture = {
      .stream_name = "Capture",
      .channels_min = 1,
      .channels_max = 2,
      .rates = SNDRV_PCM_RATE_8000_48000,
      .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
   },
   .ops = &es8388_dai_ops,
   .symmetric_rates = 1,
};

static int es8388_suspend(struct snd_soc_codec *codec)
{
   pr_info("es8388_suspend\n");
   return 0;
}

static int es8388_resume(struct snd_soc_codec *codec)
{
   pr_info("es8388_resume\n");
   return 0;
}

static int es8388_probe(struct snd_soc_codec *codec)
{
   pr_info("es8388_codec_probe\n");
   es8388_reset(codec);
   return 0;
}

static int es8388_remove(struct snd_soc_codec *codec)
{
   return 0;
}

static int es8388_set_bias_level(struct snd_soc_codec *codec, enum snd_soc_bias_level level)
{
   return 0;
}

static struct snd_soc_codec_driver codec_es8388 = {
   .probe =   es8388_probe,
   .remove =   es8388_remove,
   .suspend =   es8388_suspend,
   .resume =   es8388_resume,
   .set_bias_level = es8388_set_bias_level,
};

static const struct regmap_config es8388_regmap = {
   .reg_bits = 8,
   .val_bits = 8,
   .max_register = ES8328_REG_MAX,
   .cache_type = REGCACHE_RBTREE,
};

static int es8388_i2c_probe(struct i2c_client *i2c,
             const struct i2c_device_id *id)
{
   struct regmap *regmap;

   regmap = devm_regmap_init_i2c(i2c, &es8388_regmap);
   if (IS_ERR(regmap))
      return PTR_ERR(regmap);

   // call snd_soc_cache_sync, we do not need regmap handler.
   return snd_soc_register_codec(&i2c->dev, &codec_es8388, &es8388_dai, 1);
}

static int es8388_i2c_remove(struct i2c_client *client)
{
   snd_soc_unregister_codec(&client->dev);
   return 0;
}

static const struct i2c_device_id es8388_i2c_id[] = {
   { "es8388", 0 },
   { }
};
MODULE_DEVICE_TABLE(i2c, es8388_i2c_id);

static const struct of_device_id es8388_ofs[] = {
   { .compatible = "everest,es8388", },
   { }
};
MODULE_DEVICE_TABLE(of, es8388_ofs);

static struct i2c_driver es8388_i2c_driver = {
   .driver = {
      .name = "es8388",
      .of_match_table = es8388_ofs,
   },
   .probe = es8388_i2c_probe,
   .remove = es8388_i2c_remove,
   .id_table = es8388_i2c_id,
};

module_i2c_driver(es8388_i2c_driver);

MODULE_DESCRIPTION("Audio codec ES8388 driver");
MODULE_AUTHOR("Qin Wei <me@vocore.io>");
MODULE_LICENSE("GPL");

Return to VoCore2/Lite/Ultimate

Who is online

Users browsing this forum: Google [Bot] and 44 guests