Candice the personal assistant robot

L67GS
Posts: 166
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: english
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 55 times
Been thanked: 24 times
Contact:

Re: Candice the personal assistant robot

Post by L67GS »

speaker-test -c2 just runs and runs but this is the first part of the output:

root@odroid:/# speaker-test -c2

speaker-test 1.2.2

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 32 to 16384
Period size range from 16 to 8192
Using max buffer size 16384
Periods = 4
was set period_size = 4096
was set buffer_size = 16384
0 - Front Left
1 - Front Right
Time per period = 5.651652
0 - Front Left
1 - Front Right
Time per period = 5.979910
0 - Front Left
1 - Front Right
Time per period = 5.979942

That pattern just repeats with slightly different numbers for time per period, up and down.
I eventually removed the power and re-booted.
peaker-test -c1 does much the same, no sound with either test.

root@odroid:~# speaker-test -c1

speaker-test 1.2.2

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 64 to 32768
Period size range from 32 to 16384
Using max buffer size 32768
Periods = 4
was set period_size = 8192
was set buffer_size = 32768
0 - Front Left
Time per period = 2.229557
0 - Front Left
Time per period = 2.909872
0 - Front Left
Time per period = 2.899954
0 - Front Left
Time per period = 2.899927

User avatar
odroid
Site Admin
Posts: 35266
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 1074 times
Been thanked: 821 times
Contact:

Re: Candice the personal assistant robot

Post by odroid »

'c1' should be the HDMI sound output and 'c2' should be the HFi Shield DAC sound output.
I think Ubuntu 20.04 seems to have a problem with the stock ALSA driver.
If you don't mind, keep using the 18.04 for your project.
These users thanked the author odroid for the post:
L67GS (Tue Sep 08, 2020 1:24 pm)

L67GS
Posts: 166
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: english
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 55 times
Been thanked: 24 times
Contact:

Re: Candice the personal assistant robot

Post by L67GS »

odroid wrote:
Tue Sep 08, 2020 1:20 pm
'c1' should be the HDMI sound output and 'c2' should be the HFi Shield DAC sound output.
I think Ubuntu 20.04 seems to have a problem with the stock ALSA driver.
If you don't mind, keep using the 18.04 for your project.
I saw another user having trouble with 20.04 and was thinking the same thing.
BTW, ctrl + Z exits speaker-test or it just runs and runs....

L67GS
Posts: 166
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: english
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 55 times
Been thanked: 24 times
Contact:

Re: Candice the personal assistant robot

Post by L67GS »

This is interesting, alsa driver is also not working in 18.04 mate. Same nothing from command line but if I plug in a monitor, keyboard, and trackball and use gui it plays audio like it did when I did my sound test in mate.
It looks like pulseaudio is the only sound server working. I'm going to try aplay/terminal again and resample the wav files at different frequencies tonight and try that. Alsa may not be decoding properly.

mad_ady
Posts: 8458
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 577 times
Been thanked: 461 times
Contact:

Re: Candice the personal assistant robot

Post by mad_ady »

Also run alsamixer and check if audio is muted. Or use paplay instead of aplay.
These users thanked the author mad_ady for the post:
L67GS (Wed Sep 09, 2020 12:40 am)

L67GS
Posts: 166
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: english
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 55 times
Been thanked: 24 times
Contact:

Re: Candice the personal assistant robot

Post by L67GS »

mad_ady wrote:
Wed Sep 09, 2020 12:32 am
Also run alsamixer and check if audio is muted. Or use paplay instead of aplay.
I'll try that tonight, I also want to learn about any alsa config files tonight and see if something is happening there.
Before I get too invested I need to see what sound server is used by Festival and if it can be changed or if that's going to focus my efforts.

L67GS
Posts: 166
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: english
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 55 times
Been thanked: 24 times
Contact:

Re: Candice the personal assistant robot

Post by L67GS »

Here's a recent picture too, I can't wait to be finished and clean the bench in my lab. Robots are soooo messy!

20200908_115055.jpg
20200908_115055.jpg (427.33 KiB) Viewed 190 times

mad_ady
Posts: 8458
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 577 times
Been thanked: 461 times
Contact:

Re: Candice the personal assistant robot

Post by mad_ady »

Robots are soooo messy!

I'm sure they think the same about humans...
These users thanked the author mad_ady for the post:
L67GS (Thu Sep 10, 2020 12:03 am)

L67GS
Posts: 166
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: english
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 55 times
Been thanked: 24 times
Contact:

Re: Candice the personal assistant robot

Post by L67GS »

Last night I got wiringpi working on the C1+ to where it can control the amplifier and send input to the PIC. I need to invert an input on the PIC but that's a simple matter.
One significant snag was in 18.04 I was unable to compile Candice's program even with very specific flags in g++ <filesystem> wasn't happening so I went back to 20.04 minimal and decided to continue the battle with sound.
Also, adding Candice's program to rc.local results in a corruption with journaling, even if I sleep 30 before it there's still corruption but I think I have a workaround for it.
Tonight I'm tackling that, making an image at that point, and working on sound.

mad_ady
Posts: 8458
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 577 times
Been thanked: 461 times
Contact:

Re: Candice the personal assistant robot

Post by mad_ady »

You should abandon rc.local and try a systemd service file instead.
These users thanked the author mad_ady for the post:
L67GS (Thu Sep 10, 2020 1:58 am)

L67GS
Posts: 166
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: english
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 55 times
Been thanked: 24 times
Contact:

Re: Candice the personal assistant robot

Post by L67GS »

mad_ady wrote:
Thu Sep 10, 2020 1:17 am
You should abandon rc.local and try a systemd service file instead.
That makes sense, I'm using systemd for autologin. I wonder if I can do something like a short sleep and then execute in that same file.
My initial try was going to have rc.local start a small c++ program that waited 30 seconds and then start the ai.
Then when the ai loads the audio drivers and calls for wiringpi the computer would be safely booted.
Theoretically I could just install the audio the right way and then use systemd to start the ai.

mad_ady
Posts: 8458
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 577 times
Been thanked: 461 times
Contact:

Re: Candice the personal assistant robot

Post by mad_ady »

Here's an example that starts x11vnc after the x11 server starts:

Code: Select all

adrianp@spica-c2:~$ cat /etc/systemd/system/x11vnc.service
[Unit]
Description=VNC Server for X11
#Requires=display-manager.service
#After=display-manager.service
After=graphical.target

[Service]
Type=forking
ExecStart=/usr/bin/x11vnc -forever -bg -geometry 1280x720 -usepw -shared -noprimary \
  -auth /var/run/lightdm/root/:0 -display :0 -rfbauth /etc/x11vnc.pass

[Install]
WantedBy=multi-user.target
You normally set dependencies between services and don't rely on sleep.

L67GS
Posts: 166
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: english
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 55 times
Been thanked: 24 times
Contact:

Re: Candice the personal assistant robot

Post by L67GS »

Poking at sound in 20.04 minimal again tonight. I decided to see if there was any life through HDMI audio, speaker-test works fine with HDMI but I just get a pop and a few squeaks through it when I play a file with aplay.
I'm going to do some more tests with wav files under HDMI audio.

L67GS
Posts: 166
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: english
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 55 times
Been thanked: 24 times
Contact:

Re: Candice the personal assistant robot

Post by L67GS »

Got sound working with pulseaudio. She's making sounds, and festival is running and configured so she's even talking in the right voice!

L67GS
Posts: 166
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: english
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 55 times
Been thanked: 24 times
Contact:

Re: Candice the personal assistant robot

Post by L67GS »

mad_ady wrote:
Mon Aug 31, 2020 2:32 pm
It's probably been discussed a few times, but not in a centralized way.
The simplest and less efficient way of doing it would be to put your emmc in a card reader on a linux system and running

Code: Select all

sudo dd if=/dev/sdX of=/path/to/backup.img bs=1M
Pros: you can flash it with etcher, and it's simple
Cons: It backs up free space, and you can restore to a same size or larger media

Method 2 involves using gparted to shrink the last partition, using a dd parameter to copy up to the point after the last partition ends and adding back /aafirstboot so that it resizes on first boot.
It's more work but results in a smaller backup and it's faster to restore.
I cheated, I cheat whenever I can. I've switched to an 8Gig eMMC until it's all working properly so I can just DD images quick & dirty without resizing. Once she's up and everything is cool I'll flash my 128gb eMMC.
I've already made two progressive images as things progress so there are distinct restore points at milestones.

L67GS
Posts: 166
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: english
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 55 times
Been thanked: 24 times
Contact:

Re: Candice the personal assistant robot

Post by L67GS »

Having some hiccups with wiringPi but this was still a fruitful day. Candice is running assembled for the first time.
I had to use system ("gpio write pinnumber state"); for now but Candice is controlling the MOSFET through the microcontroller, muting/unmuting the amplifier, and controlling the eye LEDs.

I have to get wiringpi running to do the analog read for her battery monitor and 7 inputs for the sensor array yet so I'll just convert the outputs to wiringpi when I get there.

Still haven't gotten her program to autostart, when I put it in systemd it causes a weird loop that prohibits successful booting. I'm thinking about installing a small maintenance switch under her mask and then when I can get autostart working just have it start a small c++ program to check a GPIO and see if the swith is in maintenance mode. If the switch isn't in maintenance mode it would start candice.out and terminate itself, and if it is in maintenance mode it'll just terminate and leave the C0 running so I can interact through serial or ssh.

The sensor array got assembled and installed yesterday but I don't have jumpers to GPIO made yet. It's 3 sensitivities of vibration/shock, and 4 tilt switches. I've been kicking around the idea of installing a PIR at some point so she knows when someone is approaching but that would require the removal of the transparent window on the front and I'm not sure I want to do that yet.

Yesterday I got geared up to make her face mask but the plastic I had for it has mysteriously vanished so I ordered more, lemonade from lemons I suppose because it gave me more time this weekend to work on software.

I'm going to make an image file here before I keep tinkering with wiringpi and lose traction, but I'm still very satisfied with the recent progress.

L67GS
Posts: 166
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: english
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 55 times
Been thanked: 24 times
Contact:

Re: Candice the personal assistant robot

Post by L67GS »

I got wiringpi working, but it complains some of the ports aren't valid, also pin 7 will go high when commanded, but only stay high for a second.
I also rewrote and optimized the PIC, adding more turn off delay and changing the eye LEDs to have a 500ms start delay, and be 50ms faster to better match festival's speech rate.

mad_ady
Posts: 8458
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 577 times
Been thanked: 461 times
Contact:

Re: Candice the personal assistant robot

Post by mad_ady »

Check that pin 7 isn't being used by some driver (maybe one wire w1?). cat /sys/kernel/debug/gpio will tell you.

User avatar
odroid
Site Admin
Posts: 35266
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 1074 times
Been thanked: 821 times
Contact:

Re: Candice the personal assistant robot

Post by odroid »

Also check 'lsmod' output too.

L67GS
Posts: 166
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: english
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 55 times
Been thanked: 24 times
Contact:

Re: Candice the personal assistant robot

Post by L67GS »

I figured out why some of the ports weren't working, it was because I was dumb. They aren't GPIO, but data and analog....
I'm still not sure why 7 is peculiar but I did the suggested tests and posted the outputs in a more specific thread.
It doesn't look like 7 is busy.
viewtopic.php?f=115&t=40260&p=306420#p306420

mad_ady
Posts: 8458
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 577 times
Been thanked: 461 times
Contact:

Re: Candice the personal assistant robot

Post by mad_ady »

It is onewire. You can blacklist the module, or maybe disable it via dtb...

Post Reply

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 1 guest